summaryrefslogtreecommitdiff
path: root/legacy/emotion/src/lib/emotion_smart.c
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2006-12-19 14:15:17 +0000
committerCarsten Haitzler <raster@rasterman.com>2006-12-19 14:15:17 +0000
commiteb21b3503cb3ffbae204dc4e56d56310b33dd2fe (patch)
treea7010fc0e75e32bdc9d523dfb12f5f4887751af1 /legacy/emotion/src/lib/emotion_smart.c
parent9e27a0d98cb7931e582b4eb3aeaec8ab771b8b16 (diff)
use the new colorspace support in evas... :)
SVN revision: 27519
Diffstat (limited to 'legacy/emotion/src/lib/emotion_smart.c')
-rw-r--r--legacy/emotion/src/lib/emotion_smart.c120
1 files changed, 83 insertions, 37 deletions
diff --git a/legacy/emotion/src/lib/emotion_smart.c b/legacy/emotion/src/lib/emotion_smart.c
index f8b9c2e9f4..539b7d2b5b 100644
--- a/legacy/emotion/src/lib/emotion_smart.c
+++ b/legacy/emotion/src/lib/emotion_smart.c
@@ -35,7 +35,7 @@ struct _Smart_Data
35 Emotion_Video_Module *module; 35 Emotion_Video_Module *module;
36 void *video; 36 void *video;
37 37
38 char *module_name; 38 char *module_name;
39 39
40 char *file; 40 char *file;
41 Evas_Object *obj; 41 Evas_Object *obj;
@@ -51,12 +51,12 @@ struct _Smart_Data
51 51
52 char *title; 52 char *title;
53 struct { 53 struct {
54 char *info; 54 char *info;
55 double stat; 55 double stat;
56 } progress; 56 } progress;
57 struct { 57 struct {
58 char *file; 58 char *file;
59 int num; 59 int num;
60 } ref; 60 } ref;
61 struct { 61 struct {
62 int button_num; 62 int button_num;
@@ -992,53 +992,99 @@ _pixels_get(void *data, Evas_Object *obj)
992 int iw, ih, w, h; 992 int iw, ih, w, h;
993 Smart_Data *sd; 993 Smart_Data *sd;
994 Emotion_Format format; 994 Emotion_Format format;
995 995 unsigned char *bgra_data;
996
996 sd = data; 997 sd = data;
997 evas_object_image_size_get(obj, &iw, &ih); 998 evas_object_image_size_get(obj, &iw, &ih);
998 sd->module->video_data_size_get(sd->video, &w, &h); 999 sd->module->video_data_size_get(sd->video, &w, &h);
999 if ((w != iw) || (h != ih)) 1000 if ((w != iw) || (h != ih))
1000 { 1001 {
1001 evas_object_image_size_set(obj, w, h); 1002 evas_object_image_colorspace_set(obj, EVAS_COLORSPACE_YCBCR422P601_PL);
1002 iw = w; 1003 evas_object_image_alpha_set(obj, 0);
1003 ih = h; 1004 evas_object_image_size_set(obj, w, h);
1005 iw = w;
1006 ih = h;
1007 }
1008 if ((iw < 1) || (ih < 1))
1009 {
1010 evas_object_image_pixels_dirty_set(obj, 0);
1011 }
1012 else
1013 {
1014 format = sd->module->format_get(sd->video);
1015 if ((format == EMOTION_FORMAT_YV12) || (format == EMOTION_FORMAT_I420))
1016 {
1017 unsigned char **rows;
1018
1019 evas_object_image_colorspace_set(obj, EVAS_COLORSPACE_YCBCR422P601_PL);
1020 rows = evas_object_image_data_get(obj, 1);
1021 if (rows)
1022 {
1023 if (sd->module->yuv_rows_get(sd->video, iw, ih,
1024 rows,
1025 &rows[ih],
1026 &rows[ih + (ih / 2)]))
1027 evas_object_image_data_update_add(obj, 0, 0, iw, ih);
1028 }
1029 evas_object_image_data_set(obj, rows);
1030 evas_object_image_pixels_dirty_set(obj, 0);
1031 }
1032 else if (format == EMOTION_FORMAT_BGRA)
1033 {
1034 if (sd->module->bgra_data_get(sd->video, &bgra_data));
1035 {
1036 evas_object_image_data_set(obj, bgra_data);
1037 evas_object_image_pixels_dirty_set(obj, 0);
1038 }
1039 }
1040 }
1041// sd->module->frame_done(sd->video);
1042/*
1043 evas_object_image_size_get(obj, &iw, &ih);
1044 sd->module->video_data_size_get(sd->video, &w, &h);
1045 if ((w != iw) || (h != ih))
1046 {
1047 evas_object_image_size_set(obj, w, h);
1048 iw = w;
1049 ih = h;
1004 } 1050 }
1005 format = sd->module->format_get(sd->video); 1051 format = sd->module->format_get(sd->video);
1006 if ((format == EMOTION_FORMAT_YV12) || (format == EMOTION_FORMAT_I420)) 1052 if ((format == EMOTION_FORMAT_YV12) || (format == EMOTION_FORMAT_I420))
1007 { 1053 {
1008 unsigned char **rows; 1054 unsigned char **rows;
1009 Evas_Pixel_Import_Source ps; 1055 Evas_Pixel_Import_Source ps;
1010 1056
1011 ps.format = EVAS_PIXEL_FORMAT_YUV420P_601; 1057 ps.format = EVAS_PIXEL_FORMAT_YUV420P_601;
1012 ps.w = iw; 1058 ps.w = iw;
1013 ps.h = ih; 1059 ps.h = ih;
1014 1060
1015 ps.rows = malloc(ps.h * 2 * sizeof(void *)); 1061 ps.rows = malloc(ps.h * 2 * sizeof(void *));
1016 if (!ps.rows) 1062 if (!ps.rows)
1017 { 1063 {
1018 sd->module->frame_done(sd->video); 1064 sd->module->frame_done(sd->video);
1019 return; 1065 return;
1020 } 1066 }
1021 1067
1022 rows = (unsigned char **)ps.rows; 1068 rows = (unsigned char **)ps.rows;
1023 1069
1024 if (sd->module->yuv_rows_get(sd->video, iw, ih, 1070 if (sd->module->yuv_rows_get(sd->video, iw, ih,
1025 rows, 1071 rows,
1026 &rows[ps.h], 1072 &rows[ps.h],
1027 &rows[ps.h + (ps.h / 2)])) 1073 &rows[ps.h + (ps.h / 2)]))
1028 evas_object_image_pixels_import(obj, &ps); 1074 evas_object_image_pixels_import(obj, &ps);
1029 evas_object_image_pixels_dirty_set(obj, 0); 1075 evas_object_image_pixels_dirty_set(obj, 0);
1030 free(ps.rows); 1076 free(ps.rows);
1031 } 1077 }
1032 else if (format == EMOTION_FORMAT_BGRA) 1078 else if (format == EMOTION_FORMAT_BGRA)
1033 { 1079 {
1034 unsigned char *bgra_data; 1080 if (sd->module->bgra_data_get(sd->video, &bgra_data));
1035 if (sd->module->bgra_data_get(sd->video, &bgra_data)); 1081 {
1036 { 1082 evas_object_image_data_set(obj, bgra_data);
1037 evas_object_image_data_set(obj, bgra_data); 1083 evas_object_image_pixels_dirty_set(obj, 0);
1038 } 1084 }
1039 } 1085 }
1040
1041 sd->module->frame_done(sd->video); 1086 sd->module->frame_done(sd->video);
1087 */
1042} 1088}
1043 1089
1044/*******************************************/ 1090/*******************************************/