summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@gmail.com>2013-01-10 22:11:07 +0000
committerGustavo Sverzut Barbieri <barbieri@gmail.com>2013-01-10 22:11:07 +0000
commit8a4248732aa6896122db2bd18c6c0698c7802241 (patch)
treedc35c3cf0634b84e4ee45f06c308d98ed6c5a844 /src
parentd1341cc826481f6c17ce82bf251e9a2a1b75ea8b (diff)
efl/emotion: move module stuff.
* do not abuse emotion_private.h by using that in modules * split emotion_module.c to allow more changes later. SVN revision: 82592
Diffstat (limited to 'src')
-rw-r--r--src/Makefile_Emotion.am2
-rw-r--r--src/lib/emotion/Emotion_Module.h139
-rw-r--r--src/lib/emotion/emotion_main.c157
-rw-r--r--src/lib/emotion/emotion_modules.c126
-rw-r--r--src/lib/emotion/emotion_private.h137
-rw-r--r--src/modules/emotion/generic/emotion_generic.c3
-rw-r--r--src/modules/emotion/gstreamer/emotion_gstreamer.c3
-rw-r--r--src/modules/emotion/gstreamer/emotion_sink.c3
-rw-r--r--src/modules/emotion/xine/emotion_xine.c3
-rw-r--r--src/modules/emotion/xine/emotion_xine_vo_out.c3
10 files changed, 293 insertions, 283 deletions
diff --git a/src/Makefile_Emotion.am b/src/Makefile_Emotion.am
index 9b83f56a50..72c0d2df59 100644
--- a/src/Makefile_Emotion.am
+++ b/src/Makefile_Emotion.am
@@ -47,9 +47,11 @@ dist_installed_emotionmainheaders_DATA = lib/emotion/Emotion.h
47 47
48# libemotion.la 48# libemotion.la
49lib_emotion_libemotion_la_SOURCES = \ 49lib_emotion_libemotion_la_SOURCES = \
50lib/emotion/Emotion_Module.h \
50lib/emotion/emotion_private.h \ 51lib/emotion/emotion_private.h \
51lib/emotion/emotion_smart.c \ 52lib/emotion/emotion_smart.c \
52lib/emotion/emotion_webcam.c \ 53lib/emotion/emotion_webcam.c \
54lib/emotion/emotion_modules.c \
53lib/emotion/emotion_main.c 55lib/emotion/emotion_main.c
54 56
55EMOTION_COMMON_LIBADD = $(EMOTION_COMMON_LDADD) @EMOTION_LIBS@ 57EMOTION_COMMON_LIBADD = $(EMOTION_COMMON_LDADD) @EMOTION_LIBS@
diff --git a/src/lib/emotion/Emotion_Module.h b/src/lib/emotion/Emotion_Module.h
new file mode 100644
index 0000000000..8c53c21688
--- /dev/null
+++ b/src/lib/emotion/Emotion_Module.h
@@ -0,0 +1,139 @@
1#ifndef _EMOTION_MODULE_H_
2#define _EMOTION_MODULE_H_ 1
3
4#include "Emotion.h"
5
6#define META_TRACK_TITLE 1
7#define META_TRACK_ARTIST 2
8#define META_TRACK_GENRE 3
9#define META_TRACK_COMMENT 4
10#define META_TRACK_ALBUM 5
11#define META_TRACK_YEAR 6
12#define META_TRACK_DISCID 7
13#define META_TRACK_COUNT 8
14
15typedef enum _Emotion_Format Emotion_Format;
16typedef struct _Emotion_Video_Module Emotion_Video_Module;
17typedef struct _Emotion_Module_Options Emotion_Module_Options;
18typedef struct _Eina_Emotion_Plugins Eina_Emotion_Plugins;
19
20typedef Eina_Bool (*Emotion_Module_Open)(Evas_Object *, const Emotion_Video_Module **, void **, Emotion_Module_Options *);
21typedef void (*Emotion_Module_Close)(Emotion_Video_Module *module, void *);
22
23enum _Emotion_Format
24{
25 EMOTION_FORMAT_NONE,
26 EMOTION_FORMAT_I420,
27 EMOTION_FORMAT_YV12,
28 EMOTION_FORMAT_YUY2, /* unused for now since evas does not support yuy2 format */
29 EMOTION_FORMAT_BGRA
30};
31
32struct _Emotion_Module_Options
33{
34 const char *player;
35 Eina_Bool no_video : 1;
36 Eina_Bool no_audio : 1;
37};
38
39struct _Eina_Emotion_Plugins
40{
41 Emotion_Module_Open open;
42 Emotion_Module_Close close;
43};
44
45struct _Emotion_Video_Module
46{
47 unsigned char (*init) (Evas_Object *obj, void **video, Emotion_Module_Options *opt);
48 int (*shutdown) (void *video);
49 unsigned char (*file_open) (const char *file, Evas_Object *obj, void *video);
50 void (*file_close) (void *ef);
51 void (*play) (void *ef, double pos);
52 void (*stop) (void *ef);
53 void (*size_get) (void *ef, int *w, int *h);
54 void (*pos_set) (void *ef, double pos);
55 double (*len_get) (void *ef);
56 double (*buffer_size_get) (void *ef);
57 int (*fps_num_get) (void *ef);
58 int (*fps_den_get) (void *ef);
59 double (*fps_get) (void *ef);
60 double (*pos_get) (void *ef);
61 void (*vis_set) (void *ef, Emotion_Vis vis);
62 Emotion_Vis (*vis_get) (void *ef);
63 Eina_Bool (*vis_supported) (void *ef, Emotion_Vis vis);
64 double (*ratio_get) (void *ef);
65 int (*video_handled) (void *ef);
66 int (*audio_handled) (void *ef);
67 int (*seekable) (void *ef);
68 void (*frame_done) (void *ef);
69 Emotion_Format (*format_get) (void *ef);
70 void (*video_data_size_get) (void *ef, int *w, int *h);
71 int (*yuv_rows_get) (void *ef, int w, int h, unsigned char **yrows, unsigned char **urows, unsigned char **vrows);
72 int (*bgra_data_get) (void *ef, unsigned char **bgra_data);
73 void (*event_feed) (void *ef, int event);
74 void (*event_mouse_button_feed) (void *ef, int button, int x, int y);
75 void (*event_mouse_move_feed) (void *ef, int x, int y);
76 int (*video_channel_count) (void *ef);
77 void (*video_channel_set) (void *ef, int channel);
78 int (*video_channel_get) (void *ef);
79 void (*video_subtitle_file_set) (void *ef, const char *filepath);
80 const char * (*video_subtitle_file_get) (void *ef);
81 const char * (*video_channel_name_get) (void *ef, int channel);
82 void (*video_channel_mute_set) (void *ef, int mute);
83 int (*video_channel_mute_get) (void *ef);
84 int (*audio_channel_count) (void *ef);
85 void (*audio_channel_set) (void *ef, int channel);
86 int (*audio_channel_get) (void *ef);
87 const char * (*audio_channel_name_get) (void *ef, int channel);
88 void (*audio_channel_mute_set) (void *ef, int mute);
89 int (*audio_channel_mute_get) (void *ef);
90 void (*audio_channel_volume_set) (void *ef, double vol);
91 double (*audio_channel_volume_get) (void *ef);
92 int (*spu_channel_count) (void *ef);
93 void (*spu_channel_set) (void *ef, int channel);
94 int (*spu_channel_get) (void *ef);
95 const char * (*spu_channel_name_get) (void *ef, int channel);
96 void (*spu_channel_mute_set) (void *ef, int mute);
97 int (*spu_channel_mute_get) (void *ef);
98 int (*chapter_count) (void *ef);
99 void (*chapter_set) (void *ef, int chapter);
100 int (*chapter_get) (void *ef);
101 const char * (*chapter_name_get) (void *ef, int chapter);
102 void (*speed_set) (void *ef, double speed);
103 double (*speed_get) (void *ef);
104 int (*eject) (void *ef);
105 const char * (*meta_get) (void *ef, int meta);
106 void (*priority_set) (void *ef, Eina_Bool priority);
107 Eina_Bool (*priority_get) (void *ef);
108
109 Eina_Emotion_Plugins *plugin;
110};
111
112EAPI void *_emotion_video_get(const Evas_Object *obj);
113EAPI void _emotion_frame_new(Evas_Object *obj);
114EAPI void _emotion_video_pos_update(Evas_Object *obj, double pos, double len);
115EAPI void _emotion_frame_resize(Evas_Object *obj, int w, int h, double ratio);
116EAPI void _emotion_frame_refill(Evas_Object *obj, double w, double h);
117EAPI void _emotion_decode_stop(Evas_Object *obj);
118EAPI void _emotion_open_done(Evas_Object *obj);
119EAPI void _emotion_playback_started(Evas_Object *obj);
120EAPI void _emotion_playback_finished(Evas_Object *obj);
121EAPI void _emotion_audio_level_change(Evas_Object *obj);
122EAPI void _emotion_channels_change(Evas_Object *obj);
123EAPI void _emotion_title_set(Evas_Object *obj, char *title);
124EAPI void _emotion_progress_set(Evas_Object *obj, char *info, double stat);
125EAPI void _emotion_file_ref_set(Evas_Object *obj, const char *file, int num);
126EAPI void _emotion_spu_button_num_set(Evas_Object *obj, int num);
127EAPI void _emotion_spu_button_set(Evas_Object *obj, int button);
128EAPI void _emotion_seek_done(Evas_Object *obj);
129EAPI void _emotion_image_reset(Evas_Object *obj);
130
131EAPI void _emotion_pending_object_ref(void);
132EAPI void _emotion_pending_object_unref(void);
133
134EAPI const char *emotion_webcam_custom_get(const char *device);
135
136EAPI Eina_Bool _emotion_module_register(const char *name, Emotion_Module_Open open, Emotion_Module_Close close);
137EAPI Eina_Bool _emotion_module_unregister(const char *name);
138
139#endif
diff --git a/src/lib/emotion/emotion_main.c b/src/lib/emotion/emotion_main.c
index 807d9ea300..908f7da51a 100644
--- a/src/lib/emotion/emotion_main.c
+++ b/src/lib/emotion/emotion_main.c
@@ -17,26 +17,11 @@
17 17
18#include "emotion_private.h" 18#include "emotion_private.h"
19 19
20#ifdef EMOTION_STATIC_BUILD_XINE
21Eina_Bool xine_module_init(void);
22void xine_module_shutdown(void);
23#endif
24#ifdef EMOTION_STATIC_BUILD_GSTREAMER
25Eina_Bool gstreamer_module_init(void);
26void gstreamer_module_shutdown(void);
27#endif
28#ifdef EMOTION_STATIC_BUILD_GENERIC
29Eina_Bool generic_module_init(void);
30void generic_module_shutdown(void);
31#endif
32
33static Emotion_Version _version = { VMAJ, VMIN, VMIC, VREV }; 20static Emotion_Version _version = { VMAJ, VMIN, VMIC, VREV };
34static int emotion_pending_objects = 0; 21static int emotion_pending_objects = 0;
35EAPI Emotion_Version *emotion_version = &_version; 22EAPI Emotion_Version *emotion_version = &_version;
36 23
37static Eina_Prefix *pfx = NULL; 24Eina_Prefix *_emotion_pfx = NULL;
38Eina_Hash *_emotion_backends = NULL;
39Eina_Array *_emotion_modules = NULL;
40int _emotion_log_domain = -1; 25int _emotion_log_domain = -1;
41 26
42static Eet_File *_emotion_config_file = NULL; 27static Eet_File *_emotion_config_file = NULL;
@@ -146,66 +131,10 @@ emotion_object_extension_may_play_get(const char *file)
146static int _emotion_init_count = 0; 131static int _emotion_init_count = 0;
147 132
148 133
149static void
150_emotion_modules_init(void)
151{
152 char buf[PATH_MAX];
153 char *path;
154
155 if (getenv("EFL_RUN_IN_TREE"))
156 {
157 struct stat st;
158 snprintf(buf, sizeof(buf), "%s/src/modules/emotion",
159 PACKAGE_BUILD_DIR);
160 if (stat(buf, &st) == 0)
161 {
162 const char *built_modules[] = {
163#ifdef EMOTION_BUILD_GSTREAMER
164 "gstreamer",
165#endif
166#ifdef EMOTION_BUILD_XINE
167 "xine",
168#endif
169 NULL
170 };
171 const char **itr;
172 for (itr = built_modules; *itr != NULL; itr++)
173 {
174 snprintf(buf, sizeof(buf),
175 "%s/src/modules/emotion/%s/.libs",
176 PACKAGE_BUILD_DIR, *itr);
177 _emotion_modules = eina_module_list_get(_emotion_modules, buf,
178 EINA_FALSE, NULL, NULL);
179 }
180
181 return;
182 }
183 }
184
185 path = eina_module_environment_path_get("EMOTION_MODULES_DIR",
186 "/emotion/modules");
187 if (path)
188 {
189 _emotion_modules = eina_module_arch_list_get(_emotion_modules, path, MODULE_ARCH);
190 free(path);
191 }
192
193 path = eina_module_environment_path_get("HOME", "/.emotion");
194 if (path)
195 {
196 _emotion_modules = eina_module_arch_list_get(_emotion_modules, path, MODULE_ARCH);
197 free(path);
198 }
199
200 snprintf(buf, sizeof(buf), "%s/emotion/modules", eina_prefix_lib_get(pfx));
201 _emotion_modules = eina_module_arch_list_get(_emotion_modules, buf, MODULE_ARCH);
202}
203
204EAPI Eina_Bool 134EAPI Eina_Bool
205emotion_init(void) 135emotion_init(void)
206{ 136{
207 char buffer[PATH_MAX]; 137 char buffer[PATH_MAX];
208 int static_modules = 0;
209 138
210 if (_emotion_init_count > 0) 139 if (_emotion_init_count > 0)
211 { 140 {
@@ -223,68 +152,33 @@ emotion_init(void)
223 return EINA_FALSE; 152 return EINA_FALSE;
224 } 153 }
225 154
226 pfx = eina_prefix_new(NULL, emotion_init, 155 _emotion_pfx = eina_prefix_new(NULL, emotion_init,
227 "EMOTION", "emotion", "checkme", 156 "EMOTION", "emotion", "checkme",
228 PACKAGE_BIN_DIR, PACKAGE_LIB_DIR, 157 PACKAGE_BIN_DIR, PACKAGE_LIB_DIR,
229 PACKAGE_DATA_DIR, PACKAGE_DATA_DIR); 158 PACKAGE_DATA_DIR, PACKAGE_DATA_DIR);
230 EINA_SAFETY_ON_NULL_GOTO(pfx, error); 159 EINA_SAFETY_ON_NULL_GOTO(_emotion_pfx, error);
231 160
232 _emotion_backends = eina_hash_string_small_new(free); 161 _emotion_backends = eina_hash_string_small_new(free);
233 EINA_SAFETY_ON_NULL_GOTO(_emotion_backends, error_hash); 162 EINA_SAFETY_ON_NULL_GOTO(_emotion_backends, error_hash);
234 163
235 _emotion_modules_init();
236
237 /* Init static module */
238#ifdef EMOTION_STATIC_BUILD_XINE
239 static_modules += xine_module_init();
240#endif
241#ifdef EMOTION_STATIC_BUILD_GSTREAMER
242 static_modules += gstreamer_module_init();
243#endif
244#ifdef EMOTION_STATIC_BUILD_GENERIC
245 static_modules += generic_module_init();
246#endif
247
248 if ((!_emotion_modules) && (!static_modules))
249 WRN("No emotion modules found!");
250 else if (_emotion_modules)
251 eina_module_list_load(_emotion_modules);
252
253 ecore_init(); 164 ecore_init();
254 eet_init(); 165 eet_init();
255 166
256 snprintf(buffer, sizeof(buffer), "%s/emotion.cfg", eina_prefix_data_get(pfx)); 167 snprintf(buffer, sizeof(buffer), "%s/emotion.cfg",
168 eina_prefix_data_get(_emotion_pfx));
257 _emotion_config_file = eet_open(buffer, EET_FILE_MODE_READ); 169 _emotion_config_file = eet_open(buffer, EET_FILE_MODE_READ);
258 170
259 emotion_webcam_init(); 171 emotion_webcam_init();
260 emotion_webcam_config_load(_emotion_config_file); 172 emotion_webcam_config_load(_emotion_config_file);
261 173
174 emotion_modules_init();
175
262 _emotion_init_count = 1; 176 _emotion_init_count = 1;
263 return EINA_TRUE; 177 return EINA_TRUE;
264 178
265#ifdef EMOTION_STATIC_BUILD_XINE
266 xine_module_shutdown();
267#endif
268#ifdef EMOTION_STATIC_BUILD_GSTREAMER
269 gstreamer_module_shutdown();
270#endif
271#ifdef EMOTION_STATIC_BUILD_GENERIC
272 generic_module_shutdown();
273#endif
274
275 if (_emotion_modules)
276 {
277 eina_module_list_free(_emotion_modules);
278 eina_array_free(_emotion_modules);
279 _emotion_modules = NULL;
280 }
281
282 eina_hash_free(_emotion_backends);
283 _emotion_backends = NULL;
284
285 error_hash: 179 error_hash:
286 eina_prefix_free(pfx); 180 eina_prefix_free(_emotion_pfx);
287 pfx = NULL; 181 _emotion_pfx = NULL;
288 182
289 error: 183 error:
290 eina_log_domain_unregister(_emotion_log_domain); 184 eina_log_domain_unregister(_emotion_log_domain);
@@ -306,8 +200,9 @@ emotion_shutdown(void)
306 } 200 }
307 if (--_emotion_init_count) return EINA_TRUE; 201 if (--_emotion_init_count) return EINA_TRUE;
308 202
309 emotion_webcam_shutdown(); 203 emotion_modules_shutdown();
310 204
205 emotion_webcam_shutdown();
311 206
312 if (_emotion_config_file) 207 if (_emotion_config_file)
313 { 208 {
@@ -328,28 +223,8 @@ emotion_shutdown(void)
328 eet_shutdown(); 223 eet_shutdown();
329 ecore_shutdown(); 224 ecore_shutdown();
330 225
331#ifdef EMOTION_STATIC_BUILD_XINE 226 eina_prefix_free(_emotion_pfx);
332 xine_module_shutdown(); 227 _emotion_pfx = NULL;
333#endif
334#ifdef EMOTION_STATIC_BUILD_GSTREAMER
335 gstreamer_module_shutdown();
336#endif
337#ifdef EMOTION_STATIC_BUILD_GENERIC
338 generic_module_shutdown();
339#endif
340
341 if (_emotion_modules)
342 {
343 eina_module_list_free(_emotion_modules);
344 eina_array_free(_emotion_modules);
345 _emotion_modules = NULL;
346 }
347
348 eina_hash_free(_emotion_backends);
349 _emotion_backends = NULL;
350
351 eina_prefix_free(pfx);
352 pfx = NULL;
353 228
354 eina_log_domain_unregister(_emotion_log_domain); 229 eina_log_domain_unregister(_emotion_log_domain);
355 _emotion_log_domain = -1; 230 _emotion_log_domain = -1;
diff --git a/src/lib/emotion/emotion_modules.c b/src/lib/emotion/emotion_modules.c
new file mode 100644
index 0000000000..bf5b787d82
--- /dev/null
+++ b/src/lib/emotion/emotion_modules.c
@@ -0,0 +1,126 @@
1#ifdef HAVE_CONFIG_H
2# include "config.h"
3#endif
4
5#include "emotion_private.h"
6
7#ifdef EMOTION_STATIC_BUILD_XINE
8Eina_Bool xine_module_init(void);
9void xine_module_shutdown(void);
10#endif
11#ifdef EMOTION_STATIC_BUILD_GSTREAMER
12Eina_Bool gstreamer_module_init(void);
13void gstreamer_module_shutdown(void);
14#endif
15#ifdef EMOTION_STATIC_BUILD_GENERIC
16Eina_Bool generic_module_init(void);
17void generic_module_shutdown(void);
18#endif
19
20Eina_Hash *_emotion_backends = NULL;
21Eina_Array *_emotion_modules = NULL;
22
23static void
24_emotion_modules_load(void)
25{
26 char buf[PATH_MAX];
27 char *path;
28
29 if (getenv("EFL_RUN_IN_TREE"))
30 {
31 struct stat st;
32 snprintf(buf, sizeof(buf), "%s/src/modules/emotion",
33 PACKAGE_BUILD_DIR);
34 if (stat(buf, &st) == 0)
35 {
36 const char *built_modules[] = {
37#ifdef EMOTION_BUILD_GSTREAMER
38 "gstreamer",
39#endif
40#ifdef EMOTION_BUILD_XINE
41 "xine",
42#endif
43 NULL
44 };
45 const char **itr;
46 for (itr = built_modules; *itr != NULL; itr++)
47 {
48 snprintf(buf, sizeof(buf),
49 "%s/src/modules/emotion/%s/.libs",
50 PACKAGE_BUILD_DIR, *itr);
51 _emotion_modules = eina_module_list_get(_emotion_modules, buf,
52 EINA_FALSE, NULL, NULL);
53 }
54
55 return;
56 }
57 }
58
59 path = eina_module_environment_path_get("EMOTION_MODULES_DIR",
60 "/emotion/modules");
61 if (path)
62 {
63 _emotion_modules = eina_module_arch_list_get(_emotion_modules, path, MODULE_ARCH);
64 free(path);
65 }
66
67 path = eina_module_environment_path_get("HOME", "/.emotion");
68 if (path)
69 {
70 _emotion_modules = eina_module_arch_list_get(_emotion_modules, path, MODULE_ARCH);
71 free(path);
72 }
73
74 snprintf(buf, sizeof(buf), "%s/emotion/modules", eina_prefix_lib_get(_emotion_pfx));
75 _emotion_modules = eina_module_arch_list_get(_emotion_modules, buf, MODULE_ARCH);
76}
77
78Eina_Bool
79emotion_modules_init(void)
80{
81 int static_modules = 0;
82
83 _emotion_modules_load();
84
85 /* Init static module */
86#ifdef EMOTION_STATIC_BUILD_XINE
87 static_modules += xine_module_init();
88#endif
89#ifdef EMOTION_STATIC_BUILD_GSTREAMER
90 static_modules += gstreamer_module_init();
91#endif
92#ifdef EMOTION_STATIC_BUILD_GENERIC
93 static_modules += generic_module_init();
94#endif
95
96 if ((!_emotion_modules) && (!static_modules))
97 WRN("No emotion modules found!");
98 else if (_emotion_modules)
99 eina_module_list_load(_emotion_modules);
100
101 return EINA_TRUE;
102}
103
104void
105emotion_modules_shutdown(void)
106{
107#ifdef EMOTION_STATIC_BUILD_XINE
108 xine_module_shutdown();
109#endif
110#ifdef EMOTION_STATIC_BUILD_GSTREAMER
111 gstreamer_module_shutdown();
112#endif
113#ifdef EMOTION_STATIC_BUILD_GENERIC
114 generic_module_shutdown();
115#endif
116
117 if (_emotion_modules)
118 {
119 eina_module_list_free(_emotion_modules);
120 eina_array_free(_emotion_modules);
121 _emotion_modules = NULL;
122 }
123
124 eina_hash_free(_emotion_backends);
125 _emotion_backends = NULL;
126}
diff --git a/src/lib/emotion/emotion_private.h b/src/lib/emotion/emotion_private.h
index 5cd4b0dcba..99a2e0c2c8 100644
--- a/src/lib/emotion/emotion_private.h
+++ b/src/lib/emotion/emotion_private.h
@@ -1,15 +1,6 @@
1#ifndef EMOTION_PRIVATE_H 1#ifndef EMOTION_PRIVATE_H
2#define EMOTION_PRIVATE_H 2#define EMOTION_PRIVATE_H
3 3
4#define META_TRACK_TITLE 1
5#define META_TRACK_ARTIST 2
6#define META_TRACK_GENRE 3
7#define META_TRACK_COMMENT 4
8#define META_TRACK_ALBUM 5
9#define META_TRACK_YEAR 6
10#define META_TRACK_DISCID 7
11#define META_TRACK_COUNT 8
12
13#include <Evas.h> 4#include <Evas.h>
14#include <Eet.h> 5#include <Eet.h>
15#include "Emotion.h" 6#include "Emotion.h"
@@ -18,133 +9,13 @@ Eina_Bool emotion_webcam_init(void);
18void emotion_webcam_shutdown(void); 9void emotion_webcam_shutdown(void);
19Eina_Bool emotion_webcam_config_load(Eet_File *ef); 10Eina_Bool emotion_webcam_config_load(Eet_File *ef);
20 11
21typedef enum _Emotion_Format Emotion_Format; 12Eina_Bool emotion_modules_init(void);
22typedef struct _Emotion_Video_Module Emotion_Video_Module; 13void emotion_modules_shutdown(void);
23typedef struct _Emotion_Module_Options Emotion_Module_Options;
24typedef struct _Eina_Emotion_Plugins Eina_Emotion_Plugins;
25
26typedef Eina_Bool (*Emotion_Module_Open)(Evas_Object *, const Emotion_Video_Module **, void **, Emotion_Module_Options *);
27typedef void (*Emotion_Module_Close)(Emotion_Video_Module *module, void *);
28
29enum _Emotion_Format
30{
31 EMOTION_FORMAT_NONE,
32 EMOTION_FORMAT_I420,
33 EMOTION_FORMAT_YV12,
34 EMOTION_FORMAT_YUY2, /* unused for now since evas does not support yuy2 format */
35 EMOTION_FORMAT_BGRA
36};
37
38struct _Emotion_Module_Options
39{
40 const char *player;
41 Eina_Bool no_video : 1;
42 Eina_Bool no_audio : 1;
43};
44
45struct _Eina_Emotion_Plugins
46{
47 Emotion_Module_Open open;
48 Emotion_Module_Close close;
49};
50
51struct _Emotion_Video_Module
52{
53 unsigned char (*init) (Evas_Object *obj, void **video, Emotion_Module_Options *opt);
54 int (*shutdown) (void *video);
55 unsigned char (*file_open) (const char *file, Evas_Object *obj, void *video);
56 void (*file_close) (void *ef);
57 void (*play) (void *ef, double pos);
58 void (*stop) (void *ef);
59 void (*size_get) (void *ef, int *w, int *h);
60 void (*pos_set) (void *ef, double pos);
61 double (*len_get) (void *ef);
62 double (*buffer_size_get) (void *ef);
63 int (*fps_num_get) (void *ef);
64 int (*fps_den_get) (void *ef);
65 double (*fps_get) (void *ef);
66 double (*pos_get) (void *ef);
67 void (*vis_set) (void *ef, Emotion_Vis vis);
68 Emotion_Vis (*vis_get) (void *ef);
69 Eina_Bool (*vis_supported) (void *ef, Emotion_Vis vis);
70 double (*ratio_get) (void *ef);
71 int (*video_handled) (void *ef);
72 int (*audio_handled) (void *ef);
73 int (*seekable) (void *ef);
74 void (*frame_done) (void *ef);
75 Emotion_Format (*format_get) (void *ef);
76 void (*video_data_size_get) (void *ef, int *w, int *h);
77 int (*yuv_rows_get) (void *ef, int w, int h, unsigned char **yrows, unsigned char **urows, unsigned char **vrows);
78 int (*bgra_data_get) (void *ef, unsigned char **bgra_data);
79 void (*event_feed) (void *ef, int event);
80 void (*event_mouse_button_feed) (void *ef, int button, int x, int y);
81 void (*event_mouse_move_feed) (void *ef, int x, int y);
82 int (*video_channel_count) (void *ef);
83 void (*video_channel_set) (void *ef, int channel);
84 int (*video_channel_get) (void *ef);
85 void (*video_subtitle_file_set) (void *ef, const char *filepath);
86 const char * (*video_subtitle_file_get) (void *ef);
87 const char * (*video_channel_name_get) (void *ef, int channel);
88 void (*video_channel_mute_set) (void *ef, int mute);
89 int (*video_channel_mute_get) (void *ef);
90 int (*audio_channel_count) (void *ef);
91 void (*audio_channel_set) (void *ef, int channel);
92 int (*audio_channel_get) (void *ef);
93 const char * (*audio_channel_name_get) (void *ef, int channel);
94 void (*audio_channel_mute_set) (void *ef, int mute);
95 int (*audio_channel_mute_get) (void *ef);
96 void (*audio_channel_volume_set) (void *ef, double vol);
97 double (*audio_channel_volume_get) (void *ef);
98 int (*spu_channel_count) (void *ef);
99 void (*spu_channel_set) (void *ef, int channel);
100 int (*spu_channel_get) (void *ef);
101 const char * (*spu_channel_name_get) (void *ef, int channel);
102 void (*spu_channel_mute_set) (void *ef, int mute);
103 int (*spu_channel_mute_get) (void *ef);
104 int (*chapter_count) (void *ef);
105 void (*chapter_set) (void *ef, int chapter);
106 int (*chapter_get) (void *ef);
107 const char * (*chapter_name_get) (void *ef, int chapter);
108 void (*speed_set) (void *ef, double speed);
109 double (*speed_get) (void *ef);
110 int (*eject) (void *ef);
111 const char * (*meta_get) (void *ef, int meta);
112 void (*priority_set) (void *ef, Eina_Bool priority);
113 Eina_Bool (*priority_get) (void *ef);
114
115 Eina_Emotion_Plugins *plugin;
116};
117
118EAPI void *_emotion_video_get(const Evas_Object *obj);
119EAPI void _emotion_frame_new(Evas_Object *obj);
120EAPI void _emotion_video_pos_update(Evas_Object *obj, double pos, double len);
121EAPI void _emotion_frame_resize(Evas_Object *obj, int w, int h, double ratio);
122EAPI void _emotion_frame_refill(Evas_Object *obj, double w, double h);
123EAPI void _emotion_decode_stop(Evas_Object *obj);
124EAPI void _emotion_open_done(Evas_Object *obj);
125EAPI void _emotion_playback_started(Evas_Object *obj);
126EAPI void _emotion_playback_finished(Evas_Object *obj);
127EAPI void _emotion_audio_level_change(Evas_Object *obj);
128EAPI void _emotion_channels_change(Evas_Object *obj);
129EAPI void _emotion_title_set(Evas_Object *obj, char *title);
130EAPI void _emotion_progress_set(Evas_Object *obj, char *info, double stat);
131EAPI void _emotion_file_ref_set(Evas_Object *obj, const char *file, int num);
132EAPI void _emotion_spu_button_num_set(Evas_Object *obj, int num);
133EAPI void _emotion_spu_button_set(Evas_Object *obj, int button);
134EAPI void _emotion_seek_done(Evas_Object *obj);
135EAPI void _emotion_image_reset(Evas_Object *obj);
136
137EAPI Eina_Bool _emotion_module_register(const char *name, Emotion_Module_Open open, Emotion_Module_Close close);
138EAPI Eina_Bool _emotion_module_unregister(const char *name);
139
140EAPI const char *emotion_webcam_custom_get(const char *device);
141
142EAPI void _emotion_pending_object_ref(void);
143EAPI void _emotion_pending_object_unref(void);
144 14
145extern Eina_Hash *_emotion_backends; 15extern Eina_Hash *_emotion_backends;
146extern Eina_Array *_emotion_modules; 16extern Eina_Array *_emotion_modules;
147extern int _emotion_log_domain; 17extern int _emotion_log_domain;
18extern Eina_Prefix *_emotion_pfx;
148 19
149#define DBG(...) EINA_LOG_DOM_DBG(_emotion_log_domain, __VA_ARGS__) 20#define DBG(...) EINA_LOG_DOM_DBG(_emotion_log_domain, __VA_ARGS__)
150#define INF(...) EINA_LOG_DOM_INFO(_emotion_log_domain, __VA_ARGS__) 21#define INF(...) EINA_LOG_DOM_INFO(_emotion_log_domain, __VA_ARGS__)
@@ -152,4 +23,6 @@ extern int _emotion_log_domain;
152#define ERR(...) EINA_LOG_DOM_ERR(_emotion_log_domain, __VA_ARGS__) 23#define ERR(...) EINA_LOG_DOM_ERR(_emotion_log_domain, __VA_ARGS__)
153#define CRITICAL(...) EINA_LOG_DOM_CRIT(_emotion_log_domain, __VA_ARGS__) 24#define CRITICAL(...) EINA_LOG_DOM_CRIT(_emotion_log_domain, __VA_ARGS__)
154 25
26#include "Emotion_Module.h"
27
155#endif 28#endif
diff --git a/src/modules/emotion/generic/emotion_generic.c b/src/modules/emotion/generic/emotion_generic.c
index a195329114..d19ce6e24c 100644
--- a/src/modules/emotion/generic/emotion_generic.c
+++ b/src/modules/emotion/generic/emotion_generic.c
@@ -14,8 +14,7 @@
14#include <Evas.h> 14#include <Evas.h>
15#include <Ecore.h> 15#include <Ecore.h>
16 16
17#include "Emotion.h" 17#include "Emotion_Module.h"
18#include "emotion_private.h"
19#include "emotion_generic.h" 18#include "emotion_generic.h"
20 19
21static Eina_Prefix *pfx = NULL; 20static Eina_Prefix *pfx = NULL;
diff --git a/src/modules/emotion/gstreamer/emotion_gstreamer.c b/src/modules/emotion/gstreamer/emotion_gstreamer.c
index f5669caf61..014d26d5c3 100644
--- a/src/modules/emotion/gstreamer/emotion_gstreamer.c
+++ b/src/modules/emotion/gstreamer/emotion_gstreamer.c
@@ -24,8 +24,7 @@
24# endif 24# endif
25#endif 25#endif
26 26
27#include "Emotion.h" 27#include "Emotion_Module.h"
28#include "emotion_private.h"
29#include "emotion_gstreamer.h" 28#include "emotion_gstreamer.h"
30 29
31Eina_Bool window_manager_video = EINA_FALSE; 30Eina_Bool window_manager_video = EINA_FALSE;
diff --git a/src/modules/emotion/gstreamer/emotion_sink.c b/src/modules/emotion/gstreamer/emotion_sink.c
index dcba379200..755d48ae10 100644
--- a/src/modules/emotion/gstreamer/emotion_sink.c
+++ b/src/modules/emotion/gstreamer/emotion_sink.c
@@ -22,8 +22,7 @@
22# endif 22# endif
23#endif 23#endif
24 24
25#include "Emotion.h" 25#include "Emotion_Module.h"
26#include "emotion_private.h"
27#include "emotion_gstreamer.h" 26#include "emotion_gstreamer.h"
28 27
29static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE("sink", 28static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE("sink",
diff --git a/src/modules/emotion/xine/emotion_xine.c b/src/modules/emotion/xine/emotion_xine.c
index 1ea745dc9f..69f962a812 100644
--- a/src/modules/emotion/xine/emotion_xine.c
+++ b/src/modules/emotion/xine/emotion_xine.c
@@ -6,8 +6,7 @@
6#include <Evas.h> 6#include <Evas.h>
7#include <Ecore.h> 7#include <Ecore.h>
8 8
9#include "Emotion.h" 9#include "Emotion_Module.h"
10#include "emotion_private.h"
11#include "emotion_xine.h" 10#include "emotion_xine.h"
12 11
13int _emotion_xine_log_domain = -1; 12int _emotion_xine_log_domain = -1;
diff --git a/src/modules/emotion/xine/emotion_xine_vo_out.c b/src/modules/emotion/xine/emotion_xine_vo_out.c
index e6370279fc..007c316527 100644
--- a/src/modules/emotion/xine/emotion_xine_vo_out.c
+++ b/src/modules/emotion/xine/emotion_xine_vo_out.c
@@ -14,8 +14,7 @@
14#include <Evas.h> 14#include <Evas.h>
15#include <Ecore.h> 15#include <Ecore.h>
16 16
17#include "Emotion.h" 17#include "Emotion_Module.h"
18#include "emotion_private.h"
19#include "emotion_xine.h" 18#include "emotion_xine.h"
20 19
21#include <xine.h> 20#include <xine.h>