videoencoder: Proxy colorimetry and chroma-site from input to output caps
authorSebastian Dröge <sebastian@centricular.com>
Thu, 29 Sep 2016 11:57:02 +0000 (14:57 +0300)
committerSebastian Dröge <sebastian@centricular.com>
Tue, 1 Nov 2016 18:40:07 +0000 (20:40 +0200)
https://bugzilla.gnome.org/show_bug.cgi?id=771376

gst-libs/gst/video/gstvideoencoder.c

index 2d687a80d9d25668bf905d555a8f334591667167..3622b0a71ea5262269d7da2e7140cbdac6bcce11 100644 (file)
@@ -1571,6 +1571,7 @@ gst_video_encoder_negotiate_default (GstVideoEncoder * encoder)
   GstQuery *query = NULL;
   GstVideoCodecFrame *frame;
   GstCaps *prevcaps;
+  gchar *colorimetry;
 
   g_return_val_if_fail (state->caps != NULL, FALSE);
 
@@ -1603,6 +1604,16 @@ gst_video_encoder_negotiate_default (GstVideoEncoder * encoder)
           gst_video_field_order_to_string (GST_VIDEO_INFO_FIELD_ORDER (info)),
           NULL);
 
+    colorimetry = gst_video_colorimetry_to_string (&info->colorimetry);
+    if (colorimetry)
+      gst_caps_set_simple (state->caps, "colorimetry", G_TYPE_STRING,
+          colorimetry, NULL);
+    g_free (colorimetry);
+
+    if (info->chroma_site != GST_VIDEO_CHROMA_SITE_UNKNOWN)
+      gst_caps_set_simple (state->caps, "chroma-site", G_TYPE_STRING,
+          gst_video_chroma_to_string (info->chroma_site), NULL);
+
     if (GST_VIDEO_INFO_MULTIVIEW_MODE (info) != GST_VIDEO_MULTIVIEW_MODE_NONE) {
       const gchar *caps_mview_mode =
           gst_video_multiview_mode_to_caps_string (GST_VIDEO_INFO_MULTIVIEW_MODE