summaryrefslogtreecommitdiff
path: root/legacy/emotion/src/modules/gstreamer/emotion_gstreamer.h
blob: fcdfe21e6603582d4c0f0c4285fe32402decadc3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
/*
 * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
 */
#ifndef __EMOTION_GSTREAMER_H__
#define __EMOTION_GSTREAMER_H__


#include <Evas.h>
#include <Ecore.h>
#include <Ecore_Data.h>

#define HTTP_STREAM 0
#define RTSP_STREAM 1
#include <gst/gst.h>

#include "emotion_private.h"


typedef struct _Emotion_Video_Sink Emotion_Video_Sink;

struct _Emotion_Video_Sink
{
   GstElement *sink;
   gdouble     length_time;
   gint        width;
   gint        height;
   gint        fps_num;
   gint        fps_den;
   guint32     fourcc;
};

typedef struct _Emotion_Audio_Sink Emotion_Audio_Sink;

struct _Emotion_Audio_Sink
{
   GstElement *sink;
   gdouble     length_time;
   gint        channels;
   gint        samplerate;
};

typedef struct _Emotion_Gstreamer_Metadata Emotion_Gstreamer_Metadata;

struct _Emotion_Gstreamer_Metadata
{
   char *title;
   char *album;
   char *artist;
   char *genre;
   char *comment;
   char *year;
   char *count;
   char *disc_id;
};


typedef struct _Emotion_Gstreamer_Video Emotion_Gstreamer_Video;

struct _Emotion_Gstreamer_Video
{
   /* Gstreamer elements */
   GstElement       *pipeline;

   /* eos */
   GstBus           *eos_bus;
   Ecore_Timer      *eos_timer;

   /* Sinks */
   Ecore_List       *video_sinks;
   Ecore_List       *audio_sinks;

   int               video_sink_nbr;
   int               audio_sink_nbr;

   /* Evas object */
   Evas_Object      *obj;
   unsigned char    *obj_data;

   /* Characteristics of stream */
   double            position;
   double            ratio;
   double            volume;

   volatile int      seek_to;
   volatile int      get_poslen;
   volatile double   seek_to_pos;

   int               fd_ev_read;
   int               fd_ev_write;
   Ecore_Fd_Handler *fd_ev_handler;

   Emotion_Gstreamer_Metadata *metadata;

   Emotion_Vis       vis;

   unsigned char     play : 1;
   unsigned char     video_mute : 1;
   unsigned char     audio_mute : 1;
};

EAPI unsigned char module_open(Evas_Object *obj,
                               Emotion_Video_Module **module,
                               void **video, Emotion_Module_Options *opt);

EAPI void          module_close(Emotion_Video_Module  *module,
                                void                  *video);


#endif /* __EMOTION_GSTREAMER_H__ */