raster pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=2b8d54c35769934101989c9ab14ecb11cf740e75

commit 2b8d54c35769934101989c9ab14ecb11cf740e75
Author: Carsten Haitzler (Rasterman) <ras...@rasterman.com>
Date:   Wed May 27 23:31:28 2015 +0900

    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
---
 src/modules/emotion/gstreamer1/emotion_convert.c   | 31 ++++++++++++++++------
 src/modules/emotion/gstreamer1/emotion_gstreamer.h |  1 +
 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 2a3aaa5..db83477 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
 }
 
 const ColorSpace_Format_Convertion colorspace_format_convertion[] = {
-  { "I420", GST_VIDEO_FORMAT_I420, EVAS_COLORSPACE_YCBCR422P601_PL, 
_evas_video_i420, EINA_TRUE },
-  { "YV12", GST_VIDEO_FORMAT_YV12, EVAS_COLORSPACE_YCBCR422P601_PL, 
_evas_video_yv12, EINA_TRUE },
-  { "YUY2", GST_VIDEO_FORMAT_YUY2, EVAS_COLORSPACE_YCBCR422601_PL, 
_evas_video_yuy2, EINA_FALSE },
-  { "NV12", GST_VIDEO_FORMAT_NV12, EVAS_COLORSPACE_YCBCR420NV12601_PL, 
_evas_video_nv12, EINA_TRUE },
-  { "BGR", GST_VIDEO_FORMAT_BGR, EVAS_COLORSPACE_ARGB8888, _evas_video_bgr, 
EINA_FALSE },
-  { "BGRx", GST_VIDEO_FORMAT_BGRx, EVAS_COLORSPACE_ARGB8888, _evas_video_bgrx, 
EINA_FALSE },
-  { "BGRA", GST_VIDEO_FORMAT_BGRA, EVAS_COLORSPACE_ARGB8888, _evas_video_bgra, 
EINA_FALSE },
-  { NULL, 0, 0, NULL, 0 }
+  { "I420-709", GST_VIDEO_FORMAT_I420, GST_VIDEO_COLOR_MATRIX_BT709,
+     EVAS_COLORSPACE_YCBCR422P709_PL, _evas_video_i420, EINA_TRUE },
+  { "I420", GST_VIDEO_FORMAT_I420, GST_VIDEO_COLOR_MATRIX_BT601,
+     EVAS_COLORSPACE_YCBCR422P601_PL, _evas_video_i420, EINA_TRUE },
+
+  { "YV12-709", GST_VIDEO_FORMAT_YV12, GST_VIDEO_COLOR_MATRIX_BT709,
+     EVAS_COLORSPACE_YCBCR422P709_PL, _evas_video_yv12, EINA_TRUE },
+  { "YV12", GST_VIDEO_FORMAT_YV12, GST_VIDEO_COLOR_MATRIX_BT601,
+     EVAS_COLORSPACE_YCBCR422P601_PL, _evas_video_yv12, EINA_TRUE },
+
+  { "YUY2", GST_VIDEO_FORMAT_YUY2, GST_VIDEO_COLOR_MATRIX_BT601,
+     EVAS_COLORSPACE_YCBCR422601_PL, _evas_video_yuy2, EINA_FALSE },
+  { "NV12", GST_VIDEO_FORMAT_NV12, GST_VIDEO_COLOR_MATRIX_BT601,
+     EVAS_COLORSPACE_YCBCR420NV12601_PL, _evas_video_nv12, EINA_TRUE },
+
+  { "BGR", GST_VIDEO_FORMAT_BGR, GST_VIDEO_COLOR_MATRIX_UNKNOWN,
+     EVAS_COLORSPACE_ARGB8888, _evas_video_bgr, EINA_FALSE },
+  { "BGRx", GST_VIDEO_FORMAT_BGRx, GST_VIDEO_COLOR_MATRIX_UNKNOWN,
+     EVAS_COLORSPACE_ARGB8888, _evas_video_bgrx, EINA_FALSE },
+  { "BGRA", GST_VIDEO_FORMAT_BGRA, GST_VIDEO_COLOR_MATRIX_UNKNOWN,
+     EVAS_COLORSPACE_ARGB8888, _evas_video_bgra, EINA_FALSE },
+
+  { NULL, 0, 0, 0, NULL, 0 }
 };
 
diff --git a/src/modules/emotion/gstreamer1/emotion_gstreamer.h 
b/src/modules/emotion/gstreamer1/emotion_gstreamer.h
index ecc7f62..a815590 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
 {
    const char *name;
    GstVideoFormat format;
+   GstVideoColorMatrix colormatrix;
    Evas_Colorspace eformat;
    Evas_Video_Convert_Cb func;
    Eina_Bool force_height;
diff --git a/src/modules/emotion/gstreamer1/emotion_sink.c 
b/src/modules/emotion/gstreamer1/emotion_sink.c
index eda2a6a..f897d37 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)
    priv->info = info;
    priv->eheight = info.height;
 
-   for (i = 0; colorspace_format_convertion[i].name != NULL; ++i)
-     if (info.finfo->format == colorspace_format_convertion[i].format)
-       {
-          DBG("Found '%s'", colorspace_format_convertion[i].name);
-          priv->eformat = colorspace_format_convertion[i].eformat;
-          priv->func = colorspace_format_convertion[i].func;
-          if (colorspace_format_convertion[i].force_height)
-            {
-               priv->eheight = (priv->eheight >> 1) << 1;
-            }
-          return TRUE;
+   for (i = 0; colorspace_format_convertion[i].name; i++)
+     {
+        if ((info.finfo->format == colorspace_format_convertion[i].format) &&
+            ((colorspace_format_convertion[i].colormatrix == 
GST_VIDEO_COLOR_MATRIX_UNKNOWN) ||
+             (colorspace_format_convertion[i].colormatrix == 
info.colorimetry.matrix)))
+          {
+             DBG("Found '%s'", colorspace_format_convertion[i].name);
+             priv->eformat = colorspace_format_convertion[i].eformat;
+             priv->func = colorspace_format_convertion[i].func;
+             if (colorspace_format_convertion[i].force_height)
+               {
+                  priv->eheight = (priv->eheight >> 1) << 1;
+               }
+             return TRUE;
+          }
        }
 
    ERR("unsupported : %s\n", gst_video_format_to_string(info.finfo->format));

-- 


Reply via email to