decklinkvideosink: Always configure 10 bit YUV for VANC frames
authorSebastian Dröge <sebastian@centricular.com>
Wed, 8 Jan 2020 05:42:21 +0000 (07:42 +0200)
committerSebastian Dröge <sebastian@centricular.com>
Thu, 9 Jan 2020 10:54:04 +0000 (12:54 +0200)
If 8 bit are required by the device/mode then it will be converted internally
by the SDK, but the SDK won't automatically convert from 8 to 10 bit. As
such, always use 10 bit VANC.

Some devices require configuring also a 10 bit video format when using
10 bit VANC is required but those would fail regardless and the
application would have to configure the correct video format.

With newer versions of the SDK this information can be retrieved via the
BMDDeckLinkVANCRequires10BitYUVVideoFrames flag but we don't use a new
enough SDK version yet to extract this information.

sys/decklink/gstdecklinkvideosink.cpp

index 5ddbe0a..0061a2d 100644 (file)
@@ -916,8 +916,8 @@ write_vbi (GstDecklinkVideoSink * self, GstBuffer * buffer,
 
   if (self->vbiencoder == NULL) {
     self->vbiencoder =
-        gst_video_vbi_encoder_new (self->info.finfo->format, self->info.width);
-    self->anc_vformat = self->info.finfo->format;
+        gst_video_vbi_encoder_new (GST_VIDEO_FORMAT_v210, self->info.width);
+    self->anc_vformat = GST_VIDEO_FORMAT_v210;
   }
 
   /* Put any closed captions into the configured line */
@@ -1012,7 +1012,7 @@ write_vbi (GstDecklinkVideoSink * self, GstBuffer * buffer,
   }
 
   if ((got_captions || self->afd_bar_line != 0)
-      && self->output->output->CreateAncillaryData (format,
+      && self->output->output->CreateAncillaryData (bmdFormat10BitYUV,
           &vanc_frame) == S_OK) {
     GstVideoAFDMeta *afd_meta = NULL, *afd_meta2 = NULL;
     GstVideoBarMeta *bar_meta = NULL, *bar_meta2 = NULL;