diff --git a/legacy/emotion/ChangeLog b/legacy/emotion/ChangeLog index 13510b70b8..bc79a9a154 100644 --- a/legacy/emotion/ChangeLog +++ b/legacy/emotion/ChangeLog @@ -1,12 +1,15 @@ -2012-04-26 Carsten Haitzler (The Rasterman) +2012-04-26 Carsten Haitzler (The Rasterman) * 1.0.0 release -2012-04-30 Jérôme Pinot +2012-04-30 Jérôme Pinot * Fix build out of tree. -2012-05-16 Carsten Haitzler (The Rasterman) +2012-05-16 Carsten Haitzler (The Rasterman) * Fix emotion video overlay support to detect correct engine name. +2012-06-07 Cedric Bail + + * Fix stride for all YUV video stream. diff --git a/legacy/emotion/NEWS b/legacy/emotion/NEWS index e6e0f7ee0b..a3c86a9c55 100644 --- a/legacy/emotion/NEWS +++ b/legacy/emotion/NEWS @@ -7,6 +7,7 @@ Additions: Fixes: - build out of tree. + - stride of all YUV video. Improvements: diff --git a/legacy/emotion/src/modules/gstreamer/emotion_convert.c b/legacy/emotion/src/modules/gstreamer/emotion_convert.c index 1bfc19a9cd..3d3b46e189 100644 --- a/legacy/emotion/src/modules/gstreamer/emotion_convert.c +++ b/legacy/emotion/src/modules/gstreamer/emotion_convert.c @@ -78,45 +78,57 @@ _evas_video_bgra(unsigned char *evas_data, const unsigned char *gst_data, unsign } static void -_evas_video_i420(unsigned char *evas_data, const unsigned char *gst_data, unsigned int w, unsigned int h __UNUSED__, unsigned int output_height) +_evas_video_i420(unsigned char *evas_data, const unsigned char *gst_data, unsigned int w, unsigned int h, unsigned int output_height) { const unsigned char **rows; unsigned int i, j; unsigned int rh; + unsigned int stride_y, stride_uv; rh = output_height; rows = (const unsigned char **)evas_data; + stride_y = GST_ROUND_UP_4(w); + stride_uv = GST_ROUND_UP_8(w) / 2; + for (i = 0; i < rh; i++) - rows[i] = &gst_data[i * w]; + rows[i] = &gst_data[i * stride_y]; for (j = 0; j < (rh / 2); j++, i++) - rows[i] = &gst_data[h * w + j * (w / 2)]; + rows[i] = &gst_data[h * stride_y + j * stride_uv]; for (j = 0; j < (rh / 2); j++, i++) - rows[i] = &gst_data[h * w + rh * (w / 4) + j * (w / 2)]; + rows[i] = &gst_data[h * stride_y + + (rh / 2) * stride_uv + + j * stride_uv]; } static void -_evas_video_yv12(unsigned char *evas_data, const unsigned char *gst_data, unsigned int w, unsigned int h __UNUSED__, unsigned int output_height) +_evas_video_yv12(unsigned char *evas_data, const unsigned char *gst_data, unsigned int w, unsigned int h, unsigned int output_height) { const unsigned char **rows; unsigned int i, j; unsigned int rh; + unsigned int stride_y, stride_uv; rh = output_height; rows = (const unsigned char **)evas_data; + stride_y = GST_ROUND_UP_4(w); + stride_uv = GST_ROUND_UP_8(w) / 2; + for (i = 0; i < rh; i++) - rows[i] = &gst_data[i * w]; + rows[i] = &gst_data[i * stride_y]; for (j = 0; j < (rh / 2); j++, i++) - rows[i] = &gst_data[h * w + rh * (w / 4) + j * (w / 2)]; + rows[i] = &gst_data[h * stride_y + + (rh / 2) * stride_uv + + j * stride_uv]; for (j = 0; j < (rh / 2); j++, i++) - rows[i] = &gst_data[h * w + j * (w / 2)]; + rows[i] = &gst_data[h * stride_y + j * stride_uv]; } static void @@ -124,11 +136,14 @@ _evas_video_yuy2(unsigned char *evas_data, const unsigned char *gst_data, unsign { const unsigned char **rows; unsigned int i; + unsigned int stride; rows = (const unsigned char **)evas_data; + stride = GST_ROUND_UP_4(w * 2); + for (i = 0; i < output_height; i++) - rows[i] = &gst_data[i * w * 2]; + rows[i] = &gst_data[i * stride]; } static void