summaryrefslogtreecommitdiff
path: root/legacy/emotion/src/lib/emotion_smart.c
diff options
context:
space:
mode:
authormoom16 <moom16>2005-07-08 19:56:48 +0000
committermoom16 <moom16@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>2005-07-08 19:56:48 +0000
commit8e4e372d878c2a964d9b3ef123c7aa34f0691915 (patch)
tree93f0724f2865b2f5478fd384b8e25063603dd4f6 /legacy/emotion/src/lib/emotion_smart.c
parent0bc77892a096d12a14a5bdda233be7c310fe7670 (diff)
* 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. SVN revision: 15675
Diffstat (limited to '')
-rw-r--r--legacy/emotion/src/lib/emotion_smart.c63
1 files changed, 38 insertions, 25 deletions
diff --git a/legacy/emotion/src/lib/emotion_smart.c b/legacy/emotion/src/lib/emotion_smart.c
index 834841b038..a5596cb685 100644
--- a/legacy/emotion/src/lib/emotion_smart.c
+++ b/legacy/emotion/src/lib/emotion_smart.c
@@ -982,42 +982,55 @@ _pos_set_job(void *data)
982static void 982static void
983_pixels_get(void *data, Evas_Object *obj) 983_pixels_get(void *data, Evas_Object *obj)
984{ 984{
985 Evas_Pixel_Import_Source ps;
986 int iw, ih, w, h; 985 int iw, ih, w, h;
987 int i;
988 unsigned char **rows;
989 Smart_Data *sd; 986 Smart_Data *sd;
987 Emotion_Format format;
990 988
991 sd = data; 989 sd = data;
992 evas_object_image_size_get(obj, &iw, &ih); 990 evas_object_image_size_get(obj, &iw, &ih);
993 sd->module->yuv_size_get(sd->video, &w, &h); 991 sd->module->video_data_size_get(sd->video, &w, &h);
994 if ((w != iw) || (h != ih)) 992 if ((w != iw) || (h != ih))
995 { 993 {
996 evas_object_image_size_set(obj, w, h); 994 evas_object_image_size_set(obj, w, h);
997 iw = w; 995 iw = w;
998 ih = h; 996 ih = h;
999 } 997 }
1000 ps.format = EVAS_PIXEL_FORMAT_YUV420P_601; 998 format = sd->module->format_get(sd->video);
1001 ps.w = iw; 999 if (format == EMOTION_YV12)
1002 ps.h = ih; 1000 {
1001 unsigned char **rows;
1002 Evas_Pixel_Import_Source ps;
1003 1003
1004 ps.rows = malloc(ps.h * 2 * sizeof(void *)); 1004 ps.format = EVAS_PIXEL_FORMAT_YUV420P_601;
1005 if (!ps.rows) 1005 ps.w = iw;
1006 ps.h = ih;
1007
1008 ps.rows = malloc(ps.h * 2 * sizeof(void *));
1009 if (!ps.rows)
1010 {
1011 sd->module->frame_done(sd->video);
1012 return;
1013 }
1014
1015 rows = (unsigned char **)ps.rows;
1016
1017 if (sd->module->yuv_rows_get(sd->video, iw, ih,
1018 rows,
1019 &rows[ps.h],
1020 &rows[ps.h + (ps.h / 2)]))
1021 evas_object_image_pixels_import(obj, &ps);
1022 evas_object_image_pixels_dirty_set(obj, 0);
1023 free(ps.rows);
1024 }
1025 else if (format == EMOTION_BGRA)
1006 { 1026 {
1007 sd->module->frame_done(sd->video); 1027 unsigned char *bgra_data;
1008 return; 1028 if (sd->module->bgra_data_get(sd->video, &bgra_data));
1029 {
1030 evas_object_image_data_set(obj, bgra_data);
1031 }
1009 } 1032 }
1010 1033
1011
1012 rows = (unsigned char **)ps.rows;
1013
1014 if (sd->module->yuv_rows_get(sd->video, iw, ih,
1015 rows,
1016 &rows[ps.h],
1017 &rows[ps.h + (ps.h / 2)]))
1018 evas_object_image_pixels_import(obj, &ps);
1019 evas_object_image_pixels_dirty_set(obj, 0);
1020 free(ps.rows);
1021 sd->module->frame_done(sd->video); 1034 sd->module->frame_done(sd->video);
1022} 1035}
1023 1036