diff options
author | Carsten Haitzler (Rasterman) <raster@rasterman.com> | 2015-05-27 23:31:28 +0900 |
---|---|---|
committer | Carsten Haitzler (Rasterman) <raster@rasterman.com> | 2015-05-27 23:34:08 +0900 |
commit | 2b8d54c35769934101989c9ab14ecb11cf740e75 (patch) | |
tree | d57c96f4c50b609ee8cf2d20cb49332d9f539b2a | |
parent | 742d7c394ca99587fbe01fb0da5fd744c7ffbaee (diff) |
emotion gstreamer1 module - support 709 color matrix properly now
now that 709 colorsp[ace works in evas, use it properly in gst1 module
if possible
-rw-r--r-- | src/modules/emotion/gstreamer1/emotion_convert.c | 31 | ||||
-rw-r--r-- | src/modules/emotion/gstreamer1/emotion_gstreamer.h | 1 | ||||
-rw-r--r-- | src/modules/emotion/gstreamer1/emotion_sink.c | 26 |
3 files changed, 39 insertions, 19 deletions
diff --git a/src/modules/emotion/gstreamer1/emotion_convert.c b/src/modules/emotion/gstreamer1/emotion_convert.c index 2a3aaa58ed..db83477ef7 100644 --- a/src/modules/emotion/gstreamer1/emotion_convert.c +++ b/src/modules/emotion/gstreamer1/emotion_convert.c | |||
@@ -148,13 +148,28 @@ _evas_video_nv12(unsigned char *evas_data, const unsigned char *gst_data, unsign | |||
148 | } | 148 | } |
149 | 149 | ||
150 | const ColorSpace_Format_Convertion colorspace_format_convertion[] = { | 150 | const ColorSpace_Format_Convertion colorspace_format_convertion[] = { |
151 | { "I420", GST_VIDEO_FORMAT_I420, EVAS_COLORSPACE_YCBCR422P601_PL, _evas_video_i420, EINA_TRUE }, | 151 | { "I420-709", GST_VIDEO_FORMAT_I420, GST_VIDEO_COLOR_MATRIX_BT709, |
152 | { "YV12", GST_VIDEO_FORMAT_YV12, EVAS_COLORSPACE_YCBCR422P601_PL, _evas_video_yv12, EINA_TRUE }, | 152 | EVAS_COLORSPACE_YCBCR422P709_PL, _evas_video_i420, EINA_TRUE }, |
153 | { "YUY2", GST_VIDEO_FORMAT_YUY2, EVAS_COLORSPACE_YCBCR422601_PL, _evas_video_yuy2, EINA_FALSE }, | 153 | { "I420", GST_VIDEO_FORMAT_I420, GST_VIDEO_COLOR_MATRIX_BT601, |
154 | { "NV12", GST_VIDEO_FORMAT_NV12, EVAS_COLORSPACE_YCBCR420NV12601_PL, _evas_video_nv12, EINA_TRUE }, | 154 | EVAS_COLORSPACE_YCBCR422P601_PL, _evas_video_i420, EINA_TRUE }, |
155 | { "BGR", GST_VIDEO_FORMAT_BGR, EVAS_COLORSPACE_ARGB8888, _evas_video_bgr, EINA_FALSE }, | 155 | |
156 | { "BGRx", GST_VIDEO_FORMAT_BGRx, EVAS_COLORSPACE_ARGB8888, _evas_video_bgrx, EINA_FALSE }, | 156 | { "YV12-709", GST_VIDEO_FORMAT_YV12, GST_VIDEO_COLOR_MATRIX_BT709, |
157 | { "BGRA", GST_VIDEO_FORMAT_BGRA, EVAS_COLORSPACE_ARGB8888, _evas_video_bgra, EINA_FALSE }, | 157 | EVAS_COLORSPACE_YCBCR422P709_PL, _evas_video_yv12, EINA_TRUE }, |
158 | { NULL, 0, 0, NULL, 0 } | 158 | { "YV12", GST_VIDEO_FORMAT_YV12, GST_VIDEO_COLOR_MATRIX_BT601, |
159 | EVAS_COLORSPACE_YCBCR422P601_PL, _evas_video_yv12, EINA_TRUE }, | ||
160 | |||
161 | { "YUY2", GST_VIDEO_FORMAT_YUY2, GST_VIDEO_COLOR_MATRIX_BT601, | ||
162 | EVAS_COLORSPACE_YCBCR422601_PL, _evas_video_yuy2, EINA_FALSE }, | ||
163 | { "NV12", GST_VIDEO_FORMAT_NV12, GST_VIDEO_COLOR_MATRIX_BT601, | ||
164 | EVAS_COLORSPACE_YCBCR420NV12601_PL, _evas_video_nv12, EINA_TRUE }, | ||
165 | |||
166 | { "BGR", GST_VIDEO_FORMAT_BGR, GST_VIDEO_COLOR_MATRIX_UNKNOWN, | ||
167 | EVAS_COLORSPACE_ARGB8888, _evas_video_bgr, EINA_FALSE }, | ||
168 | { "BGRx", GST_VIDEO_FORMAT_BGRx, GST_VIDEO_COLOR_MATRIX_UNKNOWN, | ||
169 | EVAS_COLORSPACE_ARGB8888, _evas_video_bgrx, EINA_FALSE }, | ||
170 | { "BGRA", GST_VIDEO_FORMAT_BGRA, GST_VIDEO_COLOR_MATRIX_UNKNOWN, | ||
171 | EVAS_COLORSPACE_ARGB8888, _evas_video_bgra, EINA_FALSE }, | ||
172 | |||
173 | { NULL, 0, 0, 0, NULL, 0 } | ||
159 | }; | 174 | }; |
160 | 175 | ||
diff --git a/src/modules/emotion/gstreamer1/emotion_gstreamer.h b/src/modules/emotion/gstreamer1/emotion_gstreamer.h index ecc7f62322..a815590d38 100644 --- a/src/modules/emotion/gstreamer1/emotion_gstreamer.h +++ b/src/modules/emotion/gstreamer1/emotion_gstreamer.h | |||
@@ -220,6 +220,7 @@ struct _ColorSpace_Format_Convertion | |||
220 | { | 220 | { |
221 | const char *name; | 221 | const char *name; |
222 | GstVideoFormat format; | 222 | GstVideoFormat format; |
223 | GstVideoColorMatrix colormatrix; | ||
223 | Evas_Colorspace eformat; | 224 | Evas_Colorspace eformat; |
224 | Evas_Video_Convert_Cb func; | 225 | Evas_Video_Convert_Cb func; |
225 | Eina_Bool force_height; | 226 | Eina_Bool force_height; |
diff --git a/src/modules/emotion/gstreamer1/emotion_sink.c b/src/modules/emotion/gstreamer1/emotion_sink.c index eda2a6ab07..f897d3707d 100644 --- a/src/modules/emotion/gstreamer1/emotion_sink.c +++ b/src/modules/emotion/gstreamer1/emotion_sink.c | |||
@@ -181,17 +181,21 @@ gboolean emotion_video_sink_set_caps(GstBaseSink *bsink, GstCaps *caps) | |||
181 | priv->info = info; | 181 | priv->info = info; |
182 | priv->eheight = info.height; | 182 | priv->eheight = info.height; |
183 | 183 | ||
184 | for (i = 0; colorspace_format_convertion[i].name != NULL; ++i) | 184 | for (i = 0; colorspace_format_convertion[i].name; i++) |
185 | if (info.finfo->format == colorspace_format_convertion[i].format) | 185 | { |
186 | { | 186 | if ((info.finfo->format == colorspace_format_convertion[i].format) && |
187 | DBG("Found '%s'", colorspace_format_convertion[i].name); | 187 | ((colorspace_format_convertion[i].colormatrix == GST_VIDEO_COLOR_MATRIX_UNKNOWN) || |
188 | priv->eformat = colorspace_format_convertion[i].eformat; | 188 | (colorspace_format_convertion[i].colormatrix == info.colorimetry.matrix))) |
189 | priv->func = colorspace_format_convertion[i].func; | 189 | { |
190 | if (colorspace_format_convertion[i].force_height) | 190 | DBG("Found '%s'", colorspace_format_convertion[i].name); |
191 | { | 191 | priv->eformat = colorspace_format_convertion[i].eformat; |
192 | priv->eheight = (priv->eheight >> 1) << 1; | 192 | priv->func = colorspace_format_convertion[i].func; |
193 | } | 193 | if (colorspace_format_convertion[i].force_height) |
194 | return TRUE; | 194 | { |
195 | priv->eheight = (priv->eheight >> 1) << 1; | ||
196 | } | ||
197 | return TRUE; | ||
198 | } | ||
195 | } | 199 | } |
196 | 200 | ||
197 | ERR("unsupported : %s\n", gst_video_format_to_string(info.finfo->format)); | 201 | ERR("unsupported : %s\n", gst_video_format_to_string(info.finfo->format)); |