From 27fb7d380a8ba57e8ec6fb9bcc66d4e5c0d55ef8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 5 Dec 2022 12:37:01 +0200 Subject: [PATCH] Add property for enabling/disabling of RP188 receival/transmission Enabling this can lead to frame drops in certain setups so enabling it always is not ideal. --- gstajasink.cpp | 17 ++++++++++++++++- gstajasink.h | 1 + gstajasrc.cpp | 22 +++++++++++++++++++--- gstajasrc.h | 1 + 4 files changed, 37 insertions(+), 4 deletions(-) diff --git a/gstajasink.cpp b/gstajasink.cpp index 57e7506886..c729938123 100644 --- a/gstajasink.cpp +++ b/gstajasink.cpp @@ -38,6 +38,7 @@ GST_DEBUG_CATEGORY_STATIC(gst_aja_sink_debug); #define DEFAULT_OUTPUT_DESTINATION (GST_AJA_OUTPUT_DESTINATION_AUTO) #define DEFAULT_SDI_MODE (GST_AJA_SDI_MODE_SINGLE_LINK) #define DEFAULT_TIMECODE_INDEX (GST_AJA_TIMECODE_INDEX_VITC) +#define DEFAULT_RP188 (TRUE) #define DEFAULT_REFERENCE_SOURCE (GST_AJA_REFERENCE_SOURCE_AUTO) #define DEFAULT_CEA608_LINE_NUMBER (12) #define DEFAULT_CEA708_LINE_NUMBER (12) @@ -54,6 +55,7 @@ enum { PROP_OUTPUT_DESTINATION, PROP_SDI_MODE, PROP_TIMECODE_INDEX, + PROP_RP188, PROP_REFERENCE_SOURCE, PROP_CEA608_LINE_NUMBER, PROP_CEA708_LINE_NUMBER, @@ -195,6 +197,13 @@ static void gst_aja_sink_class_init(GstAjaSinkClass *klass) { (GParamFlags)(G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT))); + g_object_class_install_property( + gobject_class, PROP_RP188, + g_param_spec_boolean( + "rp188", "RP188", "Enable RP188 timecode transmission", DEFAULT_RP188, + (GParamFlags)(G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | + G_PARAM_CONSTRUCT))); + g_object_class_install_property( gobject_class, PROP_REFERENCE_SOURCE, g_param_spec_enum( @@ -311,6 +320,9 @@ void gst_aja_sink_set_property(GObject *object, guint property_id, case PROP_TIMECODE_INDEX: self->timecode_index = (GstAjaTimecodeIndex)g_value_get_enum(value); break; + case PROP_RP188: + self->rp188 = g_value_get_boolean(value); + break; case PROP_REFERENCE_SOURCE: self->reference_source = (GstAjaReferenceSource)g_value_get_enum(value); break; @@ -361,6 +373,9 @@ void gst_aja_sink_get_property(GObject *object, guint property_id, case PROP_TIMECODE_INDEX: g_value_set_enum(value, self->timecode_index); break; + case PROP_RP188: + g_value_set_boolean(value, self->rp188); + break; case PROP_REFERENCE_SOURCE: g_value_set_enum(value, self->reference_source); break; @@ -1917,7 +1932,7 @@ restart: if (!self->device->device->AutoCirculateInitForOutput( self->channel, 0, self->audio_system, - AUTOCIRCULATE_WITH_RP188 | + (self->rp188 ? AUTOCIRCULATE_WITH_RP188 : 0) | (self->vanc_mode == ::NTV2_VANCMODE_OFF ? AUTOCIRCULATE_WITH_ANC : 0), 1, start_frame, end_frame)) { diff --git a/gstajasink.h b/gstajasink.h index ac7864d142..0e2aafc37a 100644 --- a/gstajasink.h +++ b/gstajasink.h @@ -76,6 +76,7 @@ struct _GstAjaSink { GstAjaOutputDestination output_destination; GstAjaSdiMode sdi_mode; GstAjaTimecodeIndex timecode_index; + gboolean rp188; GstAjaReferenceSource reference_source; gint cea608_line_number; diff --git a/gstajasrc.cpp b/gstajasrc.cpp index 5b11982439..0141d6893b 100644 --- a/gstajasrc.cpp +++ b/gstajasrc.cpp @@ -42,6 +42,7 @@ GST_DEBUG_CATEGORY_STATIC(gst_aja_src_debug); #define DEFAULT_AUDIO_SOURCE (GST_AJA_AUDIO_SOURCE_EMBEDDED) #define DEFAULT_EMBEDDED_AUDIO_INPUT (GST_AJA_EMBEDDED_AUDIO_INPUT_AUTO) #define DEFAULT_TIMECODE_INDEX (GST_AJA_TIMECODE_INDEX_VITC) +#define DEFAULT_RP188 (TRUE) #define DEFAULT_REFERENCE_SOURCE (GST_AJA_REFERENCE_SOURCE_FREERUN) #define DEFAULT_CLOSED_CAPTION_CAPTURE_MODE \ (GST_AJA_CLOSED_CAPTION_CAPTURE_MODE_CEA708_AND_CEA608) @@ -61,6 +62,7 @@ enum { PROP_AUDIO_SOURCE, PROP_EMBEDDED_AUDIO_INPUT, PROP_TIMECODE_INDEX, + PROP_RP188, PROP_REFERENCE_SOURCE, PROP_CLOSED_CAPTION_CAPTURE_MODE, PROP_START_FRAME, @@ -225,6 +227,13 @@ static void gst_aja_src_class_init(GstAjaSrcClass *klass) { (GParamFlags)(G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT))); + g_object_class_install_property( + gobject_class, PROP_RP188, + g_param_spec_boolean( + "rp188", "RP188", "Enable RP188 timecode retrieval", DEFAULT_RP188, + (GParamFlags)(G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | + G_PARAM_CONSTRUCT))); + g_object_class_install_property( gobject_class, PROP_REFERENCE_SOURCE, g_param_spec_enum( @@ -354,6 +363,9 @@ void gst_aja_src_set_property(GObject *object, guint property_id, case PROP_TIMECODE_INDEX: self->timecode_index = (GstAjaTimecodeIndex)g_value_get_enum(value); break; + case PROP_RP188: + self->rp188 = g_value_get_boolean(value); + break; case PROP_REFERENCE_SOURCE: self->reference_source = (GstAjaReferenceSource)g_value_get_enum(value); break; @@ -411,6 +423,9 @@ void gst_aja_src_get_property(GObject *object, guint property_id, GValue *value, case PROP_TIMECODE_INDEX: g_value_set_enum(value, self->timecode_index); break; + case PROP_RP188: + g_value_set_boolean(value, self->rp188); + break; case PROP_REFERENCE_SOURCE: g_value_set_enum(value, self->reference_source); break; @@ -2084,9 +2099,10 @@ restart: if (!self->device->device->AutoCirculateInitForInput( self->channel, 0, self->audio_system, - AUTOCIRCULATE_WITH_RP188 | (self->vanc_mode == ::NTV2_VANCMODE_OFF - ? AUTOCIRCULATE_WITH_ANC - : 0), + (self->rp188 ? AUTOCIRCULATE_WITH_RP188 : 0) | + (self->vanc_mode == ::NTV2_VANCMODE_OFF + ? AUTOCIRCULATE_WITH_ANC + : 0), 1, start_frame, end_frame)) { GST_ELEMENT_ERROR(self, STREAM, FAILED, (NULL), ("Failed to initialize autocirculate")); diff --git a/gstajasrc.h b/gstajasrc.h index 8bfcd3fd1d..0ed297165e 100644 --- a/gstajasrc.h +++ b/gstajasrc.h @@ -69,6 +69,7 @@ struct _GstAjaSrc { GstAjaAudioSource audio_source; GstAjaEmbeddedAudioInput embedded_audio_input; GstAjaTimecodeIndex timecode_index; + gboolean rp188; GstAjaReferenceSource reference_source; GstAjaClosedCaptionCaptureMode closed_caption_capture_mode; guint queue_size;