From f182f2017874eb9712776e45d754f6bf43d19df6 Mon Sep 17 00:00:00 2001 From: Eunhye Choi Date: Fri, 26 Aug 2022 20:20:12 +0900 Subject: [PATCH] srt: add recv and peer latency property Change-Id: I2b47605c206e1a00e28429d79c699f4d87beeb3b --- packaging/gstreamer.spec | 2 +- subprojects/gst-plugins-bad/ext/srt/gstsrtobject.c | 63 ++++++++++++++++++++++ subprojects/gst-plugins-bad/meson.build | 1 + 3 files changed, 65 insertions(+), 1 deletion(-) diff --git a/packaging/gstreamer.spec b/packaging/gstreamer.spec index 3231b19..ee6b2cb 100644 --- a/packaging/gstreamer.spec +++ b/packaging/gstreamer.spec @@ -62,7 +62,7 @@ Name: %{_name} Version: 1.20.0 -Release: 35 +Release: 36 Summary: Streaming-Media Framework Runtime License: LGPL-2.0+ Group: Multimedia/Framework diff --git a/subprojects/gst-plugins-bad/ext/srt/gstsrtobject.c b/subprojects/gst-plugins-bad/ext/srt/gstsrtobject.c index 6dc0b2a..b53f1ec 100644 --- a/subprojects/gst-plugins-bad/ext/srt/gstsrtobject.c +++ b/subprojects/gst-plugins-bad/ext/srt/gstsrtobject.c @@ -71,6 +71,10 @@ enum PROP_WAIT_FOR_CONNECTION, PROP_STREAMID, PROP_AUTHENTICATION, +#ifdef TIZEN_FEATURE_SRT_LATENCY + PROP_RECEIVE_LATENCY, + PROP_PEER_LATENCY, +#endif PROP_LAST }; @@ -437,6 +441,14 @@ gst_srt_object_set_property_helper (GstSRTObject * srtobject, case PROP_AUTHENTICATION: srtobject->authentication = g_value_get_boolean (value); break; +#ifdef TIZEN_FEATURE_SRT_LATENCY + case PROP_RECEIVE_LATENCY: + gst_structure_set_value (srtobject->parameters, "rcvlatency", value); + break; + case PROP_PEER_LATENCY: + gst_structure_set_value (srtobject->parameters, "peerlatency", value); + break; +#endif default: goto err; } @@ -544,6 +556,32 @@ gst_srt_object_get_property_helper (GstSRTObject * srtobject, case PROP_AUTHENTICATION: g_value_set_boolean (value, srtobject->authentication); break; +#ifdef TIZEN_FEATURE_SRT_LATENCY + case PROP_RECEIVE_LATENCY:{ + gint v; + + GST_OBJECT_LOCK (srtobject->element); + if (!gst_structure_get_int (srtobject->parameters, "rcvlatency", &v)) { + GST_WARNING_OBJECT (srtobject->element, "Failed to get 'rcvlatency'"); + v = GST_SRT_DEFAULT_LATENCY; + } + g_value_set_int (value, v); + GST_OBJECT_UNLOCK (srtobject->element); + break; + } + case PROP_PEER_LATENCY:{ + gint v; + + GST_OBJECT_LOCK (srtobject->element); + if (!gst_structure_get_int (srtobject->parameters, "peerlatency", &v)) { + GST_WARNING_OBJECT (srtobject->element, "Failed to get 'peerlatency'"); + v = GST_SRT_DEFAULT_LATENCY; + } + g_value_set_int (value, v); + GST_OBJECT_UNLOCK (srtobject->element); + break; + } +#endif default: return FALSE; } @@ -704,6 +742,31 @@ gst_srt_object_install_properties_helper (GObjectClass * gobject_class) "Authentication", "Authenticate a connection", FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + +#ifdef TIZEN_FEATURE_SRT_LATENCY + /** + * GstSRTSrc:rcvlatency: + * + * The receiver delay to absorb burst of missed packet retransmission + */ + g_object_class_install_property (gobject_class, PROP_RECEIVE_LATENCY, + g_param_spec_int ("rcvlatency", "receive latency", + "receiver delay (milliseconds)", 0, + G_MAXINT32, GST_SRT_DEFAULT_LATENCY, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * GstSRTSrc:peerlatency: + * + * The minimum receiver delay for the peer. + */ + g_object_class_install_property (gobject_class, PROP_PEER_LATENCY, + g_param_spec_int ("peerlatency", "peer latency", + "Minimum receiver delay for the peer (milliseconds)", 0, + G_MAXINT32, GST_SRT_DEFAULT_LATENCY, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); +#endif + } static void diff --git a/subprojects/gst-plugins-bad/meson.build b/subprojects/gst-plugins-bad/meson.build index 1502fb3..a8dd011 100644 --- a/subprojects/gst-plugins-bad/meson.build +++ b/subprojects/gst-plugins-bad/meson.build @@ -457,6 +457,7 @@ cdata.set('TIZEN_FEATURE_HLSDEMUX_DISCONT', true) cdata.set('TIZEN_FEATURE_WEBRTC_MODIFICATION', true) cdata.set('TIZEN_FEATURE_WEBRTC_IMPORT_NETSIM', true) cdata.set('TIZEN_FEATURE_PITCH_AUDIO_META', true) +cdata.set('TIZEN_FEATURE_SRT_LATENCY', true) if get_option('tv-profile') cdata.set('TIZEN_PROFILE_TV', true) cdata.set('TIZEN_FEATURE_TRUSTZONE', true) -- 2.7.4