avviddec: set output chroma-site
authorWim Taymans <wtaymans@redhat.com>
Mon, 13 Jan 2014 15:31:05 +0000 (16:31 +0100)
committerWim Taymans <wtaymans@redhat.com>
Mon, 13 Jan 2014 15:31:05 +0000 (16:31 +0100)
Use libav provided chroma-site and place it on the output caps.

ext/libav/gstavviddec.c

index 9f9fca5..fe9c54a 100644 (file)
@@ -963,6 +963,23 @@ gst_ffmpegviddec_negotiate (GstFFMpegVidDec * ffmpegdec,
   else
     out_info->interlace_mode = GST_VIDEO_INTERLACE_MODE_PROGRESSIVE;
 
+  switch (context->chroma_sample_location) {
+    case 1:
+      out_info->chroma_site = GST_VIDEO_CHROMA_SITE_MPEG2;
+      break;
+    case 2:
+      out_info->chroma_site = GST_VIDEO_CHROMA_SITE_JPEG;
+      break;
+    case 3:
+      out_info->chroma_site = GST_VIDEO_CHROMA_SITE_DV;
+      break;
+    case 4:
+      out_info->chroma_site = GST_VIDEO_CHROMA_SITE_V_COSITED;
+      break;
+    default:
+      break;
+  }
+
   /* try to find a good framerate */
   if ((in_info->fps_d && in_info->fps_n) ||
       GST_VIDEO_INFO_FLAG_IS_SET (in_info, GST_VIDEO_FLAG_VARIABLE_FPS)) {