summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2016-12-27 11:56:49 -0800
committerCedric BAIL <cedric@osg.samsung.com>2016-12-27 11:56:49 -0800
commitf59b16435137fbf99de4d09e56cb900bb46e95d6 (patch)
tree8f9410fd1f727e19988f409e9413cd0270e10cbb
parentcd80106f5466e8e1e796c800c91bd44765e27c9c (diff)
attempt to use the new buffer_copy_set API.
It does currently crash or fails. Seems to me like an evas issue.
-rw-r--r--src/bin/image_data_ycbcr601pl.c13
-rw-r--r--src/bin/image_data_ycbcr601pl_wide_stride.c12
2 files changed, 15 insertions, 10 deletions
diff --git a/src/bin/image_data_ycbcr601pl.c b/src/bin/image_data_ycbcr601pl.c
index c2ca581..0507b9a 100644
--- a/src/bin/image_data_ycbcr601pl.c
+++ b/src/bin/image_data_ycbcr601pl.c
@@ -23,8 +23,10 @@ static void _setup(void)
23{ 23{
24 int i, y; 24 int i, y;
25 FILE *f; 25 FILE *f;
26 unsigned char *data, **lp; 26 unsigned char **lp;
27 Evas_Object *o; 27 Evas_Object *o;
28 Eina_Slice slice;
29
28 for (i = 0; i < 1; i++) 30 for (i = 0; i < 1; i++)
29 { 31 {
30 o = efl_add(EFL_CANVAS_IMAGE_CLASS, evas); 32 o = efl_add(EFL_CANVAS_IMAGE_CLASS, evas);
@@ -34,7 +36,8 @@ static void _setup(void)
34 efl_gfx_fill_set(o, 0, 0, 640, 480); 36 efl_gfx_fill_set(o, 0, 0, 640, 480);
35 efl_gfx_size_set(o, 640, 480); 37 efl_gfx_size_set(o, 640, 480);
36 efl_gfx_visible_set(o, EINA_TRUE); 38 efl_gfx_visible_set(o, EINA_TRUE);
37 data = malloc(sizeof (void*) * (480 + 240 + 240)); 39 slice.mem = malloc(sizeof (void*) * (480 + 240 + 240));
40 slice.len = (480 + 240 + 240);
38 yp = malloc(640 * 480); 41 yp = malloc(640 * 480);
39 up = malloc(320 * 240); 42 up = malloc(320 * 240);
40 vp = malloc(320 * 240); 43 vp = malloc(320 * 240);
@@ -46,7 +49,7 @@ static void _setup(void)
46 fread(vp, 320 * 240, 1, f); 49 fread(vp, 320 * 240, 1, f);
47 fclose(f); 50 fclose(f);
48 } 51 }
49 lp = (unsigned char**) data; 52 lp = (unsigned char**) slice.bytes;
50 53
51 for (y = 0; y < 480; y++) 54 for (y = 0; y < 480; y++)
52 { 55 {
@@ -63,8 +66,8 @@ static void _setup(void)
63 *lp = vp + (y * 320); 66 *lp = vp + (y * 320);
64 lp++; 67 lp++;
65 } 68 }
66 efl_gfx_buffer_copy_set(o_images[i], data, 640, 480, 640 * sizeof (int), EVAS_COLORSPACE_YCBCR422P601_PL, 0); 69 /* efl_gfx_buffer_copy_set(o_images[i], &slice, 640, 480, 640 * sizeof (int), EVAS_COLORSPACE_YCBCR422P601_PL, 0); */
67 free(data); 70 free(slice.mem);
68 // Not a real copy in fact... 71 // Not a real copy in fact...
69 /* free(yp); */ 72 /* free(yp); */
70 /* free(up); */ 73 /* free(up); */
diff --git a/src/bin/image_data_ycbcr601pl_wide_stride.c b/src/bin/image_data_ycbcr601pl_wide_stride.c
index c9eeb14..b004a61 100644
--- a/src/bin/image_data_ycbcr601pl_wide_stride.c
+++ b/src/bin/image_data_ycbcr601pl_wide_stride.c
@@ -89,9 +89,10 @@ static void _loop(double t, int f)
89{ 89{
90 int i; 90 int i;
91 Evas_Coord x, y, w, h; 91 Evas_Coord x, y, w, h;
92 Eina_Slice slice;
92 for (i = 0; i < 1; i++) 93 for (i = 0; i < 1; i++)
93 { 94 {
94 unsigned char **data, **lp; 95 unsigned char **lp;
95 96
96 w = 640; 97 w = 640;
97 h = 480; 98 h = 480;
@@ -107,8 +108,9 @@ static void _loop(double t, int f)
107 108
108 w &= ~0x1; 109 w &= ~0x1;
109 110
110 data = malloc(sizeof (void*) * (480 + 240 + 240)); 111 slice.mem = malloc(sizeof (void*) * (480 + 240 + 240));
111 lp = data; 112 slice.len = (480 + 240 + 240);
113 lp = slice.mem;
112 for (y = 0; y < 480; y++) 114 for (y = 0; y < 480; y++)
113 { 115 {
114 *lp = yp + (y * 640); 116 *lp = yp + (y * 640);
@@ -125,9 +127,9 @@ static void _loop(double t, int f)
125 lp++; 127 lp++;
126 } 128 }
127 129
128 efl_gfx_buffer_copy_set(o_images[i], data, w, 480, w * sizeof (int), EVAS_COLORSPACE_YCBCR422P601_PL, 0); 130 /* efl_gfx_buffer_copy_set(o_images[i], &slice, w, 480, w * sizeof (int), EVAS_COLORSPACE_YCBCR422P601_PL, 0); */
129 efl_gfx_buffer_update_add(o_images[i], 0, 0, w, 480); 131 efl_gfx_buffer_update_add(o_images[i], 0, 0, w, 480);
130 free(data); 132 free(slice.mem);
131 } 133 }
132 FPS_STD(NAME); 134 FPS_STD(NAME);
133} 135}