From 8075fe577c982b3bc2fc46b6f7135d1e4727cc20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Fri, 5 Mar 2021 21:50:22 +0200 Subject: [PATCH] Streamline VANC/geometry/standard configuration between source and sink This shouldn't have any effect but makes the configuration the same on both sides. --- gstajasink.cpp | 8 ++++---- gstajasrc.cpp | 23 ++++++++++++++++++++--- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/gstajasink.cpp b/gstajasink.cpp index 5483511cdd..84f786123b 100644 --- a/gstajasink.cpp +++ b/gstajasink.cpp @@ -811,14 +811,14 @@ static gboolean gst_aja_sink_set_caps(GstBaseSink *bsink, GstCaps *caps) { self->vanc_mode = ::HasVANCGeometries(geometry) ? vanc_mode : ::NTV2_VANCMODE_OFF; if (self->vanc_mode == ::NTV2_VANCMODE_OFF) { - self->device->device->SetVANCMode(self->vanc_mode, standard, geometry, - self->channel); + self->device->device->SetFrameGeometry(geometry, false, self->channel); + self->device->device->SetVANCMode(self->vanc_mode, self->channel); } else { const NTV2FrameGeometry vanc_geometry = ::GetVANCFrameGeometry(geometry, self->vanc_mode); - self->device->device->SetVANCMode(self->vanc_mode, standard, vanc_geometry, - self->channel); + self->device->device->SetFrameGeometry(vanc_geometry, false, self->channel); + self->device->device->SetVANCMode(self->vanc_mode, self->channel); } NTV2SmpteLineNumber smpte_line_num_info = ::GetSmpteLineNumber(standard); diff --git a/gstajasrc.cpp b/gstajasrc.cpp index 99031674f9..8021cc2a9c 100644 --- a/gstajasrc.cpp +++ b/gstajasrc.cpp @@ -587,9 +587,26 @@ static gboolean gst_aja_src_start(GstAjaSrc *self) { self->configured_input_source = input_source; self->vanc_mode = vanc_mode; - self->device->device->SetEnableVANCData(NTV2_IS_VANCMODE_TALL(vanc_mode), - NTV2_IS_VANCMODE_TALLER(vanc_mode), - self->channel); + + const NTV2Standard standard( + ::GetNTV2StandardFromVideoFormat(self->video_format)); + self->device->device->SetStandard(standard, self->channel); + const NTV2FrameGeometry geometry = + ::GetNTV2FrameGeometryFromVideoFormat(self->video_format); + + self->vanc_mode = + ::HasVANCGeometries(geometry) ? vanc_mode : ::NTV2_VANCMODE_OFF; + if (self->vanc_mode == ::NTV2_VANCMODE_OFF) { + self->device->device->SetFrameGeometry(geometry, false, self->channel); + self->device->device->SetVANCMode(self->vanc_mode, self->channel); + } else { + const NTV2FrameGeometry vanc_geometry = + ::GetVANCFrameGeometry(geometry, self->vanc_mode); + + self->device->device->SetFrameGeometry(vanc_geometry, false, + self->channel); + self->device->device->SetVANCMode(self->vanc_mode, self->channel); + } CNTV2SignalRouter router;