Enlightenment CVS committal Author : moom16 Project : e17 Module : libs/emotion
Dir : e17/libs/emotion/src/lib Modified Files: emotion_private.h emotion_smart.c Log Message: * Have rewritten the yuy2->rgb converter to avoid license problems. So now, emotion_xine supports yuy2-encoded movies (such as .wmv). =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/emotion/src/lib/emotion_private.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -3 -r1.7 -r1.8 --- emotion_private.h 8 Jul 2005 20:28:50 -0000 1.7 +++ emotion_private.h 8 Jul 2005 23:08:40 -0000 1.8 @@ -15,8 +15,16 @@ #define META_TRACK_YEAR 6 #define META_TRACK_DISCID 7 +typedef enum _Emotion_Format Emotion_Format; typedef struct _Emotion_Video_Module Emotion_Video_Module; +enum _Emotion_Format +{ + EMOTION_YV12, + EMOTION_YUY2, /* unused for now since evas does not support yuy2 format */ + EMOTION_BGRA +}; + struct _Emotion_Video_Module { unsigned char (*init) (Evas_Object *obj, void **video); @@ -35,8 +43,10 @@ int (*audio_handled) (void *ef); int (*seekable) (void *ef); void (*frame_done) (void *ef); - void (*yuv_size_get) (void *ef, int *w, int *h); + Emotion_Format (*format_get) (void *ef); + void (*video_data_size_get) (void *ef, int *w, int *h); int (*yuv_rows_get) (void *ef, int w, int h, unsigned char **yrows, unsigned char **urows, unsigned char **vrows); + int (*bgra_data_get) (void *ef, unsigned char **bgra_data); void (*event_feed) (void *ef, int event); void (*event_mouse_button_feed) (void *ef, int button, int x, int y); void (*event_mouse_move_feed) (void *ef, int x, int y); =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/emotion/src/lib/emotion_smart.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -3 -r1.14 -r1.15 --- emotion_smart.c 8 Jul 2005 20:28:50 -0000 1.14 +++ emotion_smart.c 8 Jul 2005 23:08:47 -0000 1.15 @@ -982,42 +982,55 @@ static void _pixels_get(void *data, Evas_Object *obj) { - Evas_Pixel_Import_Source ps; int iw, ih, w, h; - int i; - unsigned char **rows; Smart_Data *sd; + Emotion_Format format; sd = data; evas_object_image_size_get(obj, &iw, &ih); - sd->module->yuv_size_get(sd->video, &w, &h); + sd->module->video_data_size_get(sd->video, &w, &h); if ((w != iw) || (h != ih)) { - evas_object_image_size_set(obj, w, h); - iw = w; - ih = h; + evas_object_image_size_set(obj, w, h); + iw = w; + ih = h; } - ps.format = EVAS_PIXEL_FORMAT_YUV420P_601; - ps.w = iw; - ps.h = ih; - - ps.rows = malloc(ps.h * 2 * sizeof(void *)); - if (!ps.rows) + format = sd->module->format_get(sd->video); + if (format == EMOTION_YV12) { - sd->module->frame_done(sd->video); - return; - } + unsigned char **rows; + Evas_Pixel_Import_Source ps; + ps.format = EVAS_PIXEL_FORMAT_YUV420P_601; + ps.w = iw; + ps.h = ih; + + ps.rows = malloc(ps.h * 2 * sizeof(void *)); + if (!ps.rows) + { + sd->module->frame_done(sd->video); + return; + } - rows = (unsigned char **)ps.rows; - - if (sd->module->yuv_rows_get(sd->video, iw, ih, - rows, - &rows[ps.h], - &rows[ps.h + (ps.h / 2)])) - evas_object_image_pixels_import(obj, &ps); - evas_object_image_pixels_dirty_set(obj, 0); - free(ps.rows); + rows = (unsigned char **)ps.rows; + + if (sd->module->yuv_rows_get(sd->video, iw, ih, + rows, + &rows[ps.h], + &rows[ps.h + (ps.h / 2)])) + evas_object_image_pixels_import(obj, &ps); + evas_object_image_pixels_dirty_set(obj, 0); + free(ps.rows); + } + else if (format == EMOTION_BGRA) + { + unsigned char *bgra_data; + if (sd->module->bgra_data_get(sd->video, &bgra_data)); + { + evas_object_image_data_set(obj, bgra_data); + } + } + sd->module->frame_done(sd->video); } ------------------------------------------------------- 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