Enlightenment CVS committal Author : moom16 Project : e17 Module : libs/emotion
Dir : e17/libs/emotion/src/modules Modified Files: emotion_xine.c emotion_xine.h Log Message: * Add support of yuy2 to emotion_xine module. So now, we can play wmv movies! I had to make some module API changes: - rename yuv_size_get to video_data_size_get - add the function "Emotion_Format (*format_get) (void *ef);" in Emotion_Video_Module. This function should return the format used by the video (EMOTION_YV12, EMOTION_YUY2 or EMOTION_BGRA). I use a yuy2->bgra converter since evas doesn't support YUY2. This converter should be rewrite since it's really not optimized and since it is under GPLv2 (emotion is under BSD). I added an explicit comment above the function for that, but it'd be better to use a converter under BSD. If it's really incompatible with emotion license, I will remove it. =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/emotion/src/modules/emotion_xine.c,v retrieving revision 1.21 retrieving revision 1.22 diff -u -3 -r1.21 -r1.22 --- emotion_xine.c 17 Jun 2005 17:20:00 -0000 1.21 +++ emotion_xine.c 8 Jul 2005 19:56:47 -0000 1.22 @@ -16,8 +16,10 @@ static double em_ratio_get(void *ef); static int em_seekable(void *ef); static void em_frame_done(void *ef); -static void em_yuv_size_get(void *ef, int *w, int *h); +static Emotion_Format em_format_get(void *ef); +static void em_video_data_size_get(void *ef, int *w, int *h); static int em_yuv_rows_get(void *ef, int w, int h, unsigned char **yrows, unsigned char **urows, unsigned char **vrows); +static int em_bgra_data_get(void *ef, unsigned char **bgra_data); static void em_event_feed(void *ef, int event); static void em_event_mouse_button_feed(void *ef, int button, int x, int y); static void em_event_mouse_move_feed(void *ef, int x, int y); @@ -544,8 +546,21 @@ } } +static Emotion_Format em_format_get(void *ef) +{ + Emotion_Xine_Video *ev; + Emotion_Xine_Video_Frame *fr; + + ev = (Emotion_Xine_Video *)ef; + fr = ev->cur_frame; + + if (fr) + return fr->format; + return EMOTION_YV12; +} + static void -em_yuv_size_get(void *ef, int *w, int *h) +em_video_data_size_get(void *ef, int *w, int *h) { Emotion_Xine_Video *ev; Emotion_Xine_Video_Frame *fr; @@ -583,6 +598,23 @@ return 0; } +static int +em_bgra_data_get(void *ef, unsigned char **bgra_data) +{ + Emotion_Xine_Video *ev; + Emotion_Xine_Video_Frame *fr; + + ev = (Emotion_Xine_Video *)ef; + fr = ev->cur_frame; + if (!fr) return 0; + if (fr->bgra_data) + { + *bgra_data = fr->bgra_data; + return 1; + } + return 0; +} + static void em_event_feed(void *ef, int event) { @@ -1337,8 +1369,10 @@ em_audio_handled, /* audio_handled */ em_seekable, /* seekable */ em_frame_done, /* frame_done */ - em_yuv_size_get, /* yuv_size_get */ + em_format_get, /* format_get */ + em_video_data_size_get, /* video_data_size_get */ em_yuv_rows_get, /* yuv_rows_get */ + em_bgra_data_get, /* bgra_data_get */ em_event_feed, /* event_feed */ em_event_mouse_button_feed, /* event_mouse_button_feed */ em_event_mouse_move_feed, /* event_mouse_move_feed */ =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/emotion/src/modules/emotion_xine.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -3 -r1.8 -r1.9 --- emotion_xine.h 15 Apr 2005 07:27:02 -0000 1.8 +++ emotion_xine.h 8 Jul 2005 19:56:47 -0000 1.9 @@ -57,7 +57,9 @@ { int w, h; double ratio; + Emotion_Format format; unsigned char *y, *u, *v; + unsigned char *bgra_data; int y_stride, u_stride, v_stride; Evas_Object *obj; double timestamp; ------------------------------------------------------- This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual core and dual graphics technology at this free one hour event hosted by HP, AMD, and NVIDIA. To register visit http://www.hp.com/go/dualwebinar _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs