summaryrefslogtreecommitdiff
path: root/legacy/emotion
diff options
context:
space:
mode:
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>2011-03-23 22:54:45 +0000
committerMike Blumenkrantz <michael.blumenkrantz@gmail.com>2011-03-23 22:54:45 +0000
commit35d2b567bcfb77863894ebcb2b4e5ecf8a75ce41 (patch)
tree7b8db61dd5124dd8b3d01bf5eab692123a5a0cc6 /legacy/emotion
parente1adb0fe65a43c11e6afbe2bf43c6f44a4446021 (diff)
fix vlc module loading, disable slow vmem options, begin work on fast render output
SVN revision: 58049
Diffstat (limited to 'legacy/emotion')
-rw-r--r--legacy/emotion/src/modules/vlc/emotion_vlc.c66
1 files changed, 53 insertions, 13 deletions
diff --git a/legacy/emotion/src/modules/vlc/emotion_vlc.c b/legacy/emotion/src/modules/vlc/emotion_vlc.c
index f776a412a5..eec07eae75 100644
--- a/legacy/emotion/src/modules/vlc/emotion_vlc.c
+++ b/legacy/emotion/src/modules/vlc/emotion_vlc.c
@@ -3,8 +3,18 @@
3 * code@ife-sit.info 3 * code@ife-sit.info
4 */ 4 */
5 5
6#ifdef HAVE_CONFIG_H
7# include "config.h"
8#endif
6#include <sys/types.h> 9#include <sys/types.h>
7#include <unistd.h> 10#include <unistd.h>
11#include <Evas.h>
12#ifdef HAVE_EVAS_SOFWARE_X11
13# include <Evas_Engine_Software_X11.h>
14#endif
15#ifdef HAVE_EVAS_OPENGL_X11
16# include <Evas_Engine_GL_X11.h>
17#endif
8 18
9#include "Emotion.h" 19#include "Emotion.h"
10#include "emotion_private.h" 20#include "emotion_private.h"
@@ -116,15 +126,7 @@ static unsigned char em_init(Evas_Object *obj, void **emotion_video, Emotion_Mod
116 { 126 {
117 "-q", 127 "-q",
118 //"-vvvvv", 128 //"-vvvvv",
119 "--ignore-config", 129 "--ignore-config"
120 "--vout", "vmem",
121 "--vmem-width", ev->width,
122 "--vmem-height", ev->height,
123 "--vmem-pitch", ev->pitch,
124 "--vmem-chroma", "RV32",
125 "--vmem-lock", ev->clock,
126 "--vmem-unlock", ev->cunlock,
127 "--vmem-data", ev->cdata,
128 }; 130 };
129 vlc_argc = sizeof(vlc_argv) / sizeof(*vlc_argv); 131 vlc_argc = sizeof(vlc_argv) / sizeof(*vlc_argv);
130 sprintf(ev->clock, "%lld", (long long int)(intptr_t)_em_lock); 132 sprintf(ev->clock, "%lld", (long long int)(intptr_t)_em_lock);
@@ -187,8 +189,13 @@ static int em_shutdown(void *ef)
187static unsigned char em_file_open(const char *file, Evas_Object *obj, void *ef) 189static unsigned char em_file_open(const char *file, Evas_Object *obj, void *ef)
188{ 190{
189 Emotion_Vlc_Video *ev; 191 Emotion_Vlc_Video *ev;
190 int i; 192 int i, method;
191 193 Evas *e;
194 Eina_List *methods, *l;
195 char *name;
196#ifndef _WIN32
197 uint32_t xid;
198#endif
192 ev = (Emotion_Vlc_Video *)ef; 199 ev = (Emotion_Vlc_Video *)ef;
193 ASSERT_EV(ev) return 0; 200 ASSERT_EV(ev) return 0;
194 ASSERT_EV_VLC(ev) return 0; 201 ASSERT_EV_VLC(ev) return 0;
@@ -200,6 +207,39 @@ static unsigned char em_file_open(const char *file, Evas_Object *obj, void *ef)
200 ev->vlc_m = NULL; 207 ev->vlc_m = NULL;
201 ASSERT_EV_MP(ev) return 0; 208 ASSERT_EV_MP(ev) return 0;
202 209
210 e = evas_object_evas_get(obj);
211 method = evas_output_method_get(e);
212 methods = evas_render_method_list();
213 EINA_LIST_FOREACH(methods, l, name)
214 if (evas_render_method_lookup(name) == method) break;
215
216#ifdef _WIN32 /* NOT IMPLEMENTED YET */
217 libvlc_media_player_set_hwnd(ev->vlc_mp, (void*)xid);
218#else
219#ifdef HAVE_EVAS_SOFWARE_X11
220 if (!strcmp(name, "software_x11"))
221 {
222 Evas_Engine_Info_Software_X11 *einfo;
223 einfo = (Evas_Engine_Info_Software_X11*)evas_engine_info_get(e);
224 xid = einfo->info.drawable;
225 }
226#endif
227#ifdef HAVE_EVAS_OPENGL_X11
228 if (!strcmp(name, "gl_x11"))
229 {
230 Evas_Engine_Info_GL_X11 *einfo;
231 einfo = (Evas_Engine_Info_GL_X11*)evas_engine_info_get(e);
232 xid = einfo->info.drawable;
233 }
234#endif
235 if (strcmp(name, "software_x11") && strcmp(name, "gl_x11")) /* FIXME */
236 {
237 fprintf(stderr, "FATAL: engine unsupported!\n");
238 exit(1);
239 }
240 libvlc_media_player_set_xwindow(ev->vlc_mp, xid);
241#endif
242
203 ev->vlc_evtmngr = libvlc_media_player_event_manager (ev->vlc_mp); 243 ev->vlc_evtmngr = libvlc_media_player_event_manager (ev->vlc_mp);
204 244
205 for(i = EVENT_BEG_ID; i<EVENT_BEG_ID+NB_EVENTS; i++) { 245 for(i = EVENT_BEG_ID; i<EVENT_BEG_ID+NB_EVENTS; i++) {
@@ -214,7 +254,7 @@ static unsigned char em_file_open(const char *file, Evas_Object *obj, void *ef)
214 254
215 /* set properties to video object */ 255 /* set properties to video object */
216 ev->just_loaded = 1; 256 ev->just_loaded = 1;
217 257 evas_render_method_list_free(methods);
218 return 1; 258 return 1;
219} 259}
220 260
@@ -414,7 +454,7 @@ static int em_seekable(void *ef)
414 ASSERT_EV(ev) return 0; 454 ASSERT_EV(ev) return 0;
415 ASSERT_EV_MP(ev) return 0; 455 ASSERT_EV_MP(ev) return 0;
416 if (ev->opening || (!ev->play_ok)) return 0; 456 if (ev->opening || (!ev->play_ok)) return 0;
417 ret = vlc_media_player_is_seekable(ev->vlc_mp); 457 ret = libvlc_media_player_is_seekable(ev->vlc_mp);
418 return ret; 458 return ret;
419} 459}
420 460