summaryrefslogtreecommitdiff
path: root/legacy/emotion
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2011-11-07 15:45:24 +0000
committerCedric BAIL <cedric.bail@free.fr>2011-11-07 15:45:24 +0000
commitff41dfa5b5effbbd53023e0c803823d0e0c1f6e0 (patch)
treee696e4bb02315fb08cbf3722f2e8c4dc0e06b119 /legacy/emotion
parent191c19be9620007fdd6e283a78fa798991c41186 (diff)
emotion: minor cleanup.
SVN revision: 64869
Diffstat (limited to 'legacy/emotion')
-rw-r--r--legacy/emotion/src/modules/gstreamer/Makefile.am4
-rw-r--r--legacy/emotion/src/modules/gstreamer/emotion_convert.c216
-rw-r--r--legacy/emotion/src/modules/gstreamer/emotion_gstreamer.h26
-rw-r--r--legacy/emotion/src/modules/gstreamer/emotion_sink.c228
4 files changed, 247 insertions, 227 deletions
diff --git a/legacy/emotion/src/modules/gstreamer/Makefile.am b/legacy/emotion/src/modules/gstreamer/Makefile.am
index f861cde56d..fef825e756 100644
--- a/legacy/emotion/src/modules/gstreamer/Makefile.am
+++ b/legacy/emotion/src/modules/gstreamer/Makefile.am
@@ -23,7 +23,9 @@ gstreamer_la_SOURCES = \
23emotion_gstreamer.c \ 23emotion_gstreamer.c \
24emotion_sink.c \ 24emotion_sink.c \
25emotion_alloc.c \ 25emotion_alloc.c \
26emotion_fakeeos.c 26emotion_fakeeos.c \
27emotion_convert.c
28
27gstreamer_la_LIBADD = @ECORE_X_LIBS@ @GSTREAMER_LIBS@ @GSTREAMER_INTERFACE_LIBS@ $(top_builddir)/src/lib/libemotion.la 29gstreamer_la_LIBADD = @ECORE_X_LIBS@ @GSTREAMER_LIBS@ @GSTREAMER_INTERFACE_LIBS@ $(top_builddir)/src/lib/libemotion.la
28gstreamer_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -module -avoid-version 30gstreamer_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -module -avoid-version
29gstreamer_la_LIBTOOLFLAGS = --tag=disable-static 31gstreamer_la_LIBTOOLFLAGS = --tag=disable-static
diff --git a/legacy/emotion/src/modules/gstreamer/emotion_convert.c b/legacy/emotion/src/modules/gstreamer/emotion_convert.c
new file mode 100644
index 0000000000..c3d5d7233a
--- /dev/null
+++ b/legacy/emotion/src/modules/gstreamer/emotion_convert.c
@@ -0,0 +1,216 @@
1#include "emotion_gstreamer.h"
2
3static inline void
4_evas_video_bgrx_step(unsigned char *evas_data, const unsigned char *gst_data,
5 unsigned int w, unsigned int h __UNUSED__, unsigned int output_height, unsigned int step)
6{
7 unsigned int x;
8 unsigned int y;
9
10 for (y = 0; y < output_height; ++y)
11 {
12 for (x = 0; x < w; x++)
13 {
14 evas_data[0] = gst_data[0];
15 evas_data[1] = gst_data[1];
16 evas_data[2] = gst_data[2];
17 evas_data[3] = 255;
18 gst_data += step;
19 evas_data += 4;
20 }
21 }
22}
23
24static void
25_evas_video_bgr(unsigned char *evas_data, const unsigned char *gst_data, unsigned int w, unsigned int h, unsigned int output_height)
26{
27 _evas_video_bgrx_step(evas_data, gst_data, w, h, output_height, 3);
28}
29
30static void
31_evas_video_bgrx(unsigned char *evas_data, const unsigned char *gst_data, unsigned int w, unsigned int h, unsigned int output_height)
32{
33 _evas_video_bgrx_step(evas_data, gst_data, w, h, output_height, 4);
34}
35
36static void
37_evas_video_bgra(unsigned char *evas_data, const unsigned char *gst_data, unsigned int w, unsigned int h __UNUSED__, unsigned int output_height)
38{
39 unsigned int x;
40 unsigned int y;
41
42 for (y = 0; y < output_height; ++y)
43 {
44 unsigned char alpha;
45
46 for (x = 0; x < w; ++x)
47 {
48 alpha = gst_data[3];
49 evas_data[0] = (gst_data[0] * alpha) / 255;
50 evas_data[1] = (gst_data[1] * alpha) / 255;
51 evas_data[2] = (gst_data[2] * alpha) / 255;
52 evas_data[3] = alpha;
53 gst_data += 4;
54 evas_data += 4;
55 }
56 }
57}
58
59static void
60_evas_video_i420(unsigned char *evas_data, const unsigned char *gst_data, unsigned int w, unsigned int h __UNUSED__, unsigned int output_height)
61{
62 const unsigned char **rows;
63 unsigned int i, j;
64 unsigned int rh;
65
66 rh = output_height;
67
68 rows = (const unsigned char **)evas_data;
69
70 for (i = 0; i < rh; i++)
71 rows[i] = &gst_data[i * w];
72
73 for (j = 0; j < (rh / 2); j++, i++)
74 rows[i] = &gst_data[h * w + j * (w / 2)];
75
76 for (j = 0; j < (rh / 2); j++, i++)
77 rows[i] = &gst_data[h * w + rh * (w / 4) + j * (w / 2)];
78}
79
80static void
81_evas_video_yv12(unsigned char *evas_data, const unsigned char *gst_data, unsigned int w, unsigned int h __UNUSED__, unsigned int output_height)
82{
83 const unsigned char **rows;
84 unsigned int i, j;
85 unsigned int rh;
86
87 rh = output_height;
88
89 rows = (const unsigned char **)evas_data;
90
91 for (i = 0; i < rh; i++)
92 rows[i] = &gst_data[i * w];
93
94 for (j = 0; j < (rh / 2); j++, i++)
95 rows[i] = &gst_data[h * w + rh * (w / 4) + j * (w / 2)];
96
97 for (j = 0; j < (rh / 2); j++, i++)
98 rows[i] = &gst_data[h * w + j * (w / 2)];
99}
100
101static void
102_evas_video_yuy2(unsigned char *evas_data, const unsigned char *gst_data, unsigned int w, unsigned int h __UNUSED__, unsigned int output_height)
103{
104 const unsigned char **rows;
105 unsigned int i;
106
107 rows = (const unsigned char **)evas_data;
108
109 for (i = 0; i < output_height; i++)
110 rows[i] = &gst_data[i * w * 2];
111}
112
113static void
114_evas_video_nv12(unsigned char *evas_data, const unsigned char *gst_data, unsigned int w, unsigned int h __UNUSED__, unsigned int output_height)
115{
116 const unsigned char **rows;
117 unsigned int i, j;
118 unsigned int rh;
119
120 rh = output_height;
121
122 rows = (const unsigned char **)evas_data;
123
124 for (i = 0; i < rh; i++)
125 rows[i] = &gst_data[i * w];
126
127 for (j = 0; j < (rh / 2); j++, i++)
128 rows[i] = &gst_data[rh * w + j * w];
129}
130
131static void
132_evas_video_mt12(unsigned char *evas_data, const unsigned char *gst_data, unsigned int w, unsigned int h, unsigned int output_height __UNUSED__)
133{
134 const unsigned char **rows;
135 unsigned int i;
136 unsigned int j;
137
138 rows = (const unsigned char **)evas_data;
139
140 for (i = 0; i < (h / 32) / 2; i++)
141 rows[i] = &gst_data[i * w * 2 * 32];
142
143 if ((h / 32) % 2)
144 {
145 rows[i] = &gst_data[i * w * 2 * 32];
146 i++;
147 }
148
149 for (j = 0; j < ((h / 2) / 32) / 2; ++j, ++i)
150 rows[i] = &gst_data[h * w + j * (w / 2) * 2 * 16];
151}
152
153void
154_evas_video_st12_multiplane(unsigned char *evas_data, const unsigned char *gst_data, unsigned int w, unsigned int h, unsigned int output_height __UNUSED__)
155{
156 const GstMultiPlaneImageBuffer *mp_buf = (const GstMultiPlaneImageBuffer *) gst_data;
157 const unsigned char **rows;
158 unsigned int i;
159 unsigned int j;
160
161 rows = (const unsigned char **)evas_data;
162
163 for (i = 0; i < (h / 32) / 2; i++)
164 rows[i] = mp_buf->uaddr[0] + i * w * 2 * 32;
165 if ((h / 32) % 2)
166 {
167 rows[i] = mp_buf->uaddr[0] + i * w * 2 * 32;
168 i++;
169 }
170
171 for (j = 0; j < ((h / 2) / 16) / 2; j++, i++)
172 {
173 rows[i] = mp_buf->uaddr[1] + j * w * 2 * 16 * 2;
174 }
175 if (((h / 2) / 16) % 2)
176 rows[i] = mp_buf->uaddr[1] + j * w * 2 * 16 * 2;
177}
178
179void
180_evas_video_st12(unsigned char *evas_data, const unsigned char *gst_data, unsigned int w __UNUSED__, unsigned int h, unsigned int output_height __UNUSED__)
181{
182 const SCMN_IMGB *imgb = (const SCMN_IMGB *) gst_data;
183 const unsigned char **rows;
184 unsigned int i, j;
185
186 rows = (const unsigned char **)evas_data;
187
188 for (i = 0; i < (h / 32) / 2; i++)
189 rows[i] = imgb->uaddr[0] + i * imgb->stride[0] * 2 * 32;
190 if ((h / 32) % 2)
191 {
192 rows[i] = imgb->uaddr[0] + i * imgb->stride[0] * 2 * 32;
193 i++;
194 }
195
196 for (j = 0; j < (unsigned int) imgb->elevation[1] / 32 / 2; j++, i++)
197 rows[i] = imgb->uaddr[1] + j * imgb->stride[1] * 32 * 2;
198 if ((imgb->elevation[1] / 32) % 2)
199 rows[i++] = imgb->uaddr[1] + j * imgb->stride[1] * 32 * 2;
200}
201
202const ColorSpace_FourCC_Convertion colorspace_fourcc_convertion[] = {
203 { "I420", GST_MAKE_FOURCC('I', '4', '2', '0'), EVAS_COLORSPACE_YCBCR422P601_PL, _evas_video_i420, EINA_TRUE },
204 { "YV12", GST_MAKE_FOURCC('Y', 'V', '1', '2'), EVAS_COLORSPACE_YCBCR422P601_PL, _evas_video_yv12, EINA_TRUE },
205 { "YUY2", GST_MAKE_FOURCC('Y', 'U', 'Y', '2'), EVAS_COLORSPACE_YCBCR422601_PL, _evas_video_yuy2, EINA_FALSE },
206 { "NV12", GST_MAKE_FOURCC('N', 'V', '1', '2'), EVAS_COLORSPACE_YCBCR420NV12601_PL, _evas_video_nv12, EINA_TRUE },
207 { "TM12", GST_MAKE_FOURCC('T', 'M', '1', '2'), EVAS_COLORSPACE_YCBCR420TM12601_PL, _evas_video_mt12, EINA_TRUE },
208 { NULL, 0, 0, NULL, 0 }
209};
210
211const ColorSpace_Format_Convertion colorspace_format_convertion[] = {
212 { "BGR", GST_VIDEO_FORMAT_BGR, EVAS_COLORSPACE_ARGB8888, _evas_video_bgr },
213 { "BGRx", GST_VIDEO_FORMAT_BGRx, EVAS_COLORSPACE_ARGB8888, _evas_video_bgrx },
214 { "BGRA", GST_VIDEO_FORMAT_BGRA, EVAS_COLORSPACE_ARGB8888, _evas_video_bgra },
215 { NULL, 0, 0, NULL }
216};
diff --git a/legacy/emotion/src/modules/gstreamer/emotion_gstreamer.h b/legacy/emotion/src/modules/gstreamer/emotion_gstreamer.h
index 517ff4fc25..93a638d7d5 100644
--- a/legacy/emotion/src/modules/gstreamer/emotion_gstreamer.h
+++ b/legacy/emotion/src/modules/gstreamer/emotion_gstreamer.h
@@ -260,6 +260,29 @@ Eina_Bool _emotion_gstreamer_video_pipeline_parse(Emotion_Gstreamer_Video *ev,
260 260
261int em_shutdown(void *video); 261int em_shutdown(void *video);
262 262
263typedef struct _ColorSpace_FourCC_Convertion ColorSpace_FourCC_Convertion;
264typedef struct _ColorSpace_Format_Convertion ColorSpace_Format_Convertion;
265
266struct _ColorSpace_FourCC_Convertion
267{
268 const char *name;
269 guint32 fourcc;
270 Evas_Colorspace eformat;
271 Evas_Video_Convert_Cb func;
272 Eina_Bool force_height;
273};
274
275struct _ColorSpace_Format_Convertion
276{
277 const char *name;
278 GstVideoFormat format;
279 Evas_Colorspace eformat;
280 Evas_Video_Convert_Cb func;
281};
282
283extern const ColorSpace_FourCC_Convertion colorspace_fourcc_convertion[];
284extern const ColorSpace_Format_Convertion colorspace_format_convertion[];
285
263/** Samsung specific infrastructure - do not touch, do not modify */ 286/** Samsung specific infrastructure - do not touch, do not modify */
264#define MPLANE_IMGB_MAX_COUNT 4 287#define MPLANE_IMGB_MAX_COUNT 4
265#define SCMN_IMGB_MAX_PLANE 4 288#define SCMN_IMGB_MAX_PLANE 4
@@ -319,4 +342,7 @@ struct _SCMN_IMGB
319 int data[16]; 342 int data[16];
320}; 343};
321 344
345void _evas_video_st12_multiplane(unsigned char *evas_data, const unsigned char *gst_data, unsigned int w, unsigned int h, unsigned int output_height __UNUSED__);
346void _evas_video_st12(unsigned char *evas_data, const unsigned char *gst_data, unsigned int w __UNUSED__, unsigned int h, unsigned int output_height __UNUSED__);
347
322#endif /* __EMOTION_GSTREAMER_H__ */ 348#endif /* __EMOTION_GSTREAMER_H__ */
diff --git a/legacy/emotion/src/modules/gstreamer/emotion_sink.c b/legacy/emotion/src/modules/gstreamer/emotion_sink.c
index 81932bbc21..ae4b27ec63 100644
--- a/legacy/emotion/src/modules/gstreamer/emotion_sink.c
+++ b/legacy/emotion/src/modules/gstreamer/emotion_sink.c
@@ -42,230 +42,6 @@ static void evas_video_sink_main_render(void *data);
42static void evas_video_sink_samsung_main_render(void *data); 42static void evas_video_sink_samsung_main_render(void *data);
43 43
44static void 44static void
45_evas_video_bgrx_step(unsigned char *evas_data, const unsigned char *gst_data,
46 unsigned int w, unsigned int h __UNUSED__, unsigned int output_height, unsigned int step)
47{
48 unsigned int x;
49 unsigned int y;
50
51 for (y = 0; y < output_height; ++y)
52 {
53 for (x = 0; x < w; x++)
54 {
55 evas_data[0] = gst_data[0];
56 evas_data[1] = gst_data[1];
57 evas_data[2] = gst_data[2];
58 evas_data[3] = 255;
59 gst_data += step;
60 evas_data += 4;
61 }
62 }
63}
64
65static void
66_evas_video_bgr(unsigned char *evas_data, const unsigned char *gst_data, unsigned int w, unsigned int h, unsigned int output_height)
67{
68 _evas_video_bgrx_step(evas_data, gst_data, w, h, output_height, 3);
69}
70
71static void
72_evas_video_bgrx(unsigned char *evas_data, const unsigned char *gst_data, unsigned int w, unsigned int h, unsigned int output_height)
73{
74 _evas_video_bgrx_step(evas_data, gst_data, w, h, output_height, 4);
75}
76
77static void
78_evas_video_bgra(unsigned char *evas_data, const unsigned char *gst_data, unsigned int w, unsigned int h __UNUSED__, unsigned int output_height)
79{
80 unsigned int x;
81 unsigned int y;
82
83 for (y = 0; y < output_height; ++y)
84 {
85 unsigned char alpha;
86
87 for (x = 0; x < w; ++x)
88 {
89 alpha = gst_data[3];
90 evas_data[0] = (gst_data[0] * alpha) / 255;
91 evas_data[1] = (gst_data[1] * alpha) / 255;
92 evas_data[2] = (gst_data[2] * alpha) / 255;
93 evas_data[3] = alpha;
94 gst_data += 4;
95 evas_data += 4;
96 }
97 }
98}
99
100static void
101_evas_video_i420(unsigned char *evas_data, const unsigned char *gst_data, unsigned int w, unsigned int h __UNUSED__, unsigned int output_height)
102{
103 const unsigned char **rows;
104 unsigned int i, j;
105 unsigned int rh;
106
107 rh = output_height;
108
109 rows = (const unsigned char **)evas_data;
110
111 for (i = 0; i < rh; i++)
112 rows[i] = &gst_data[i * w];
113
114 for (j = 0; j < (rh / 2); j++, i++)
115 rows[i] = &gst_data[h * w + j * (w / 2)];
116
117 for (j = 0; j < (rh / 2); j++, i++)
118 rows[i] = &gst_data[h * w + rh * (w / 4) + j * (w / 2)];
119}
120
121static void
122_evas_video_yv12(unsigned char *evas_data, const unsigned char *gst_data, unsigned int w, unsigned int h __UNUSED__, unsigned int output_height)
123{
124 const unsigned char **rows;
125 unsigned int i, j;
126 unsigned int rh;
127
128 rh = output_height;
129
130 rows = (const unsigned char **)evas_data;
131
132 for (i = 0; i < rh; i++)
133 rows[i] = &gst_data[i * w];
134
135 for (j = 0; j < (rh / 2); j++, i++)
136 rows[i] = &gst_data[h * w + rh * (w / 4) + j * (w / 2)];
137
138 for (j = 0; j < (rh / 2); j++, i++)
139 rows[i] = &gst_data[h * w + j * (w / 2)];
140}
141
142static void
143_evas_video_yuy2(unsigned char *evas_data, const unsigned char *gst_data, unsigned int w, unsigned int h __UNUSED__, unsigned int output_height)
144{
145 const unsigned char **rows;
146 unsigned int i;
147
148 rows = (const unsigned char **)evas_data;
149
150 for (i = 0; i < output_height; i++)
151 rows[i] = &gst_data[i * w * 2];
152}
153
154static void
155_evas_video_nv12(unsigned char *evas_data, const unsigned char *gst_data, unsigned int w, unsigned int h __UNUSED__, unsigned int output_height)
156{
157 const unsigned char **rows;
158 unsigned int i, j;
159 unsigned int rh;
160
161 rh = output_height;
162
163 rows = (const unsigned char **)evas_data;
164
165 for (i = 0; i < rh; i++)
166 rows[i] = &gst_data[i * w];
167
168 for (j = 0; j < (rh / 2); j++, i++)
169 rows[i] = &gst_data[rh * w + j * w];
170}
171
172static void
173_evas_video_mt12(unsigned char *evas_data, const unsigned char *gst_data, unsigned int w, unsigned int h, unsigned int output_height __UNUSED__)
174{
175 const unsigned char **rows;
176 unsigned int i;
177 unsigned int j;
178
179 rows = (const unsigned char **)evas_data;
180
181 for (i = 0; i < (h / 32) / 2; i++)
182 rows[i] = &gst_data[i * w * 2 * 32];
183
184 if ((h / 32) % 2)
185 {
186 rows[i] = &gst_data[i * w * 2 * 32];
187 i++;
188 }
189
190 for (j = 0; j < ((h / 2) / 32) / 2; ++j, ++i)
191 rows[i] = &gst_data[h * w + j * (w / 2) * 2 * 16];
192}
193
194static void
195_evas_video_st12_multiplane(unsigned char *evas_data, const unsigned char *gst_data, unsigned int w, unsigned int h, unsigned int output_height __UNUSED__)
196{
197 const GstMultiPlaneImageBuffer *mp_buf = (const GstMultiPlaneImageBuffer *) gst_data;
198 const unsigned char **rows;
199 unsigned int i;
200 unsigned int j;
201
202 rows = (const unsigned char **)evas_data;
203
204 for (i = 0; i < (h / 32) / 2; i++)
205 rows[i] = mp_buf->uaddr[0] + i * w * 2 * 32;
206 if ((h / 32) % 2)
207 {
208 rows[i] = mp_buf->uaddr[0] + i * w * 2 * 32;
209 i++;
210 }
211
212 for (j = 0; j < ((h / 2) / 16) / 2; j++, i++)
213 {
214 rows[i] = mp_buf->uaddr[1] + j * w * 2 * 16 * 2;
215 }
216 if (((h / 2) / 16) % 2)
217 rows[i] = mp_buf->uaddr[1] + j * w * 2 * 16 * 2;
218}
219
220static void
221_evas_video_st12(unsigned char *evas_data, const unsigned char *gst_data, unsigned int w __UNUSED__, unsigned int h, unsigned int output_height __UNUSED__)
222{
223 const SCMN_IMGB *imgb = (const SCMN_IMGB *) gst_data;
224 const unsigned char **rows;
225 unsigned int i, j;
226
227 rows = (const unsigned char **)evas_data;
228
229 for (i = 0; i < (h / 32) / 2; i++)
230 rows[i] = imgb->uaddr[0] + i * imgb->stride[0] * 2 * 32;
231 if ((h / 32) % 2)
232 {
233 rows[i] = imgb->uaddr[0] + i * imgb->stride[0] * 2 * 32;
234 i++;
235 }
236
237 for (j = 0; j < (unsigned int) imgb->elevation[1] / 32 / 2; j++, i++)
238 rows[i] = imgb->uaddr[1] + j * imgb->stride[1] * 32 * 2;
239 if ((imgb->elevation[1] / 32) % 2)
240 rows[i++] = imgb->uaddr[1] + j * imgb->stride[1] * 32 * 2;
241}
242
243static const struct {
244 const char *name;
245 guint32 fourcc;
246 Evas_Colorspace eformat;
247 Evas_Video_Convert_Cb func;
248 Eina_Bool force_height;
249} colorspace_fourcc_convertion[] = {
250 { "I420", GST_MAKE_FOURCC('I', '4', '2', '0'), EVAS_COLORSPACE_YCBCR422P601_PL, _evas_video_i420, EINA_TRUE },
251 { "YV12", GST_MAKE_FOURCC('Y', 'V', '1', '2'), EVAS_COLORSPACE_YCBCR422P601_PL, _evas_video_yv12, EINA_TRUE },
252 { "YUY2", GST_MAKE_FOURCC('Y', 'U', 'Y', '2'), EVAS_COLORSPACE_YCBCR422601_PL, _evas_video_yuy2, EINA_FALSE },
253 { "NV12", GST_MAKE_FOURCC('N', 'V', '1', '2'), EVAS_COLORSPACE_YCBCR420NV12601_PL, _evas_video_nv12, EINA_TRUE },
254 { "TM12", GST_MAKE_FOURCC('T', 'M', '1', '2'), EVAS_COLORSPACE_YCBCR420TM12601_PL, _evas_video_mt12, EINA_TRUE }
255};
256
257static const struct {
258 const char *name;
259 GstVideoFormat format;
260 Evas_Colorspace eformat;
261 Evas_Video_Convert_Cb func;
262} colorspace_format_convertion[] = {
263 { "BGR", GST_VIDEO_FORMAT_BGR, EVAS_COLORSPACE_ARGB8888, _evas_video_bgr },
264 { "BGRx", GST_VIDEO_FORMAT_BGRx, EVAS_COLORSPACE_ARGB8888, _evas_video_bgrx },
265 { "BGRA", GST_VIDEO_FORMAT_BGRA, EVAS_COLORSPACE_ARGB8888, _evas_video_bgra }
266};
267
268static void
269evas_video_sink_base_init(gpointer g_class) 45evas_video_sink_base_init(gpointer g_class)
270{ 46{
271 GstElementClass* element_class; 47 GstElementClass* element_class;
@@ -425,7 +201,7 @@ gboolean evas_video_sink_set_caps(GstBaseSink *bsink, GstCaps *caps)
425 { 201 {
426 priv->source_height = priv->height; 202 priv->source_height = priv->height;
427 203
428 for (i = 0; i < sizeof (colorspace_fourcc_convertion) / sizeof (colorspace_fourcc_convertion[0]); ++i) 204 for (i = 0; colorspace_fourcc_convertion[i].name != NULL; ++i)
429 if (fourcc == colorspace_fourcc_convertion[i].fourcc) 205 if (fourcc == colorspace_fourcc_convertion[i].fourcc)
430 { 206 {
431 fprintf(stderr, "Found '%s'\n", colorspace_fourcc_convertion[i].name); 207 fprintf(stderr, "Found '%s'\n", colorspace_fourcc_convertion[i].name);
@@ -464,7 +240,7 @@ gboolean evas_video_sink_set_caps(GstBaseSink *bsink, GstCaps *caps)
464 240
465 priv->source_height = priv->height; 241 priv->source_height = priv->height;
466 242
467 for (i = 0; i < sizeof (colorspace_format_convertion) / sizeof (colorspace_format_convertion[0]); ++i) 243 for (i = 0; colorspace_format_convertion[i].name != NULL; ++i)
468 if (format == colorspace_format_convertion[i].format) 244 if (format == colorspace_format_convertion[i].format)
469 { 245 {
470 fprintf(stderr, "Found '%s'\n", colorspace_format_convertion[i].name); 246 fprintf(stderr, "Found '%s'\n", colorspace_format_convertion[i].name);