summaryrefslogtreecommitdiff
path: root/legacy/emotion/src/lib
diff options
context:
space:
mode:
authormoom16 <moom16>2005-07-08 23:08:48 +0000
committermoom16 <moom16@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>2005-07-08 23:08:48 +0000
commitee5135f71f2c18ead808851f55f43c4d087b4036 (patch)
treedd49ea346794d16d76c6def4e73de054cb6a0271 /legacy/emotion/src/lib
parent8e204f7f5668256ec7508a6f88f8c9f8a3c4255e (diff)
* Have rewritten the yuy2->rgb converter to avoid license problems.
So now, emotion_xine supports yuy2-encoded movies (such as .wmv). SVN revision: 15678
Diffstat (limited to '')
-rw-r--r--legacy/emotion/src/lib/emotion_private.h12
-rw-r--r--legacy/emotion/src/lib/emotion_smart.c63
2 files changed, 49 insertions, 26 deletions
diff --git a/legacy/emotion/src/lib/emotion_private.h b/legacy/emotion/src/lib/emotion_private.h
index 15eab8e56d..8afc748d4b 100644
--- a/legacy/emotion/src/lib/emotion_private.h
+++ b/legacy/emotion/src/lib/emotion_private.h
@@ -15,8 +15,16 @@
15#define META_TRACK_YEAR 6 15#define META_TRACK_YEAR 6
16#define META_TRACK_DISCID 7 16#define META_TRACK_DISCID 7
17 17
18typedef enum _Emotion_Format Emotion_Format;
18typedef struct _Emotion_Video_Module Emotion_Video_Module; 19typedef struct _Emotion_Video_Module Emotion_Video_Module;
19 20
21enum _Emotion_Format
22{
23 EMOTION_YV12,
24 EMOTION_YUY2, /* unused for now since evas does not support yuy2 format */
25 EMOTION_BGRA
26};
27
20struct _Emotion_Video_Module 28struct _Emotion_Video_Module
21{ 29{
22 unsigned char (*init) (Evas_Object *obj, void **video); 30 unsigned char (*init) (Evas_Object *obj, void **video);
@@ -35,8 +43,10 @@ struct _Emotion_Video_Module
35 int (*audio_handled) (void *ef); 43 int (*audio_handled) (void *ef);
36 int (*seekable) (void *ef); 44 int (*seekable) (void *ef);
37 void (*frame_done) (void *ef); 45 void (*frame_done) (void *ef);
38 void (*yuv_size_get) (void *ef, int *w, int *h); 46 Emotion_Format (*format_get) (void *ef);
47 void (*video_data_size_get) (void *ef, int *w, int *h);
39 int (*yuv_rows_get) (void *ef, int w, int h, unsigned char **yrows, unsigned char **urows, unsigned char **vrows); 48 int (*yuv_rows_get) (void *ef, int w, int h, unsigned char **yrows, unsigned char **urows, unsigned char **vrows);
49 int (*bgra_data_get) (void *ef, unsigned char **bgra_data);
40 void (*event_feed) (void *ef, int event); 50 void (*event_feed) (void *ef, int event);
41 void (*event_mouse_button_feed) (void *ef, int button, int x, int y); 51 void (*event_mouse_button_feed) (void *ef, int button, int x, int y);
42 void (*event_mouse_move_feed) (void *ef, int x, int y); 52 void (*event_mouse_move_feed) (void *ef, int x, int y);
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