diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2022-12-16 11:16:52 +0200 |
---|---|---|
committer | GStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org> | 2023-01-07 00:40:44 +0000 |
commit | 5f2989d5a12323edef6c6938f7c8aa15df115920 (patch) | |
tree | d794254be05a23934fe253890ff111f31dd57ec5 /subprojects/gst-rtsp-server | |
parent | ce50e13e288a22c1b8b2d627423e5358852d5c1c (diff) | |
download | gstreamer-5f2989d5a12323edef6c6938f7c8aa15df115920.tar.gz |
rtspclientsink: Add `publish-clock-mode` property
This allows modifying the behaviour how/if the pipeline clock is
published according to RFC7273, similar to the same API on
`GstRTSPMedia`.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3581>
Diffstat (limited to 'subprojects/gst-rtsp-server')
3 files changed, 38 insertions, 1 deletions
diff --git a/subprojects/gst-rtsp-server/docs/plugins/gst_plugins_cache.json b/subprojects/gst-rtsp-server/docs/plugins/gst_plugins_cache.json index 4737577363..490b10f914 100644 --- a/subprojects/gst-rtsp-server/docs/plugins/gst_plugins_cache.json +++ b/subprojects/gst-rtsp-server/docs/plugins/gst_plugins_cache.json @@ -174,6 +174,18 @@ "type": "gchararray", "writable": true }, + "publish-clock-mode": { + "blurb": "Clock publishing mode according to RFC7273", + "conditionally-available": false, + "construct": false, + "construct-only": false, + "controllable": false, + "default": "clock (1)", + "mutable": "null", + "readable": true, + "type": "GstRTSPPublishClockMode", + "writable": true + }, "retry": { "blurb": "Max number of retries when allocating RTP ports.", "conditionally-available": false, diff --git a/subprojects/gst-rtsp-server/gst/rtsp-sink/gstrtspclientsink.c b/subprojects/gst-rtsp-server/gst/rtsp-sink/gstrtspclientsink.c index 666f388750..d7c8fe9c53 100644 --- a/subprojects/gst-rtsp-server/gst/rtsp-sink/gstrtspclientsink.c +++ b/subprojects/gst-rtsp-server/gst/rtsp-sink/gstrtspclientsink.c @@ -304,6 +304,7 @@ gst_rtsp_client_sink_ntp_time_source_get_type (void) #define DEFAULT_USER_AGENT "GStreamer/" PACKAGE_VERSION #define DEFAULT_PROFILES GST_RTSP_PROFILE_AVP #define DEFAULT_RTX_TIME_MS 500 +#define DEFAULT_PUBLISH_CLOCK_MODE GST_RTSP_PUBLISH_CLOCK_MODE_CLOCK enum { @@ -333,7 +334,8 @@ enum PROP_TLS_INTERACTION, PROP_NTP_TIME_SOURCE, PROP_USER_AGENT, - PROP_PROFILES + PROP_PROFILES, + PROP_PUBLISH_CLOCK_MODE, }; static void gst_rtsp_client_sink_finalize (GObject * object); @@ -733,6 +735,20 @@ gst_rtsp_client_sink_class_init (GstRTSPClientSinkClass * klass) DEFAULT_USER_AGENT, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); /** + * GstRTSPClientSink:publish-clock-mode: + * + * Sets if and how the media clock should be published according to RFC7273. + * + * Since: 1.22 + * + */ + g_object_class_install_property (gobject_class, PROP_PUBLISH_CLOCK_MODE, + g_param_spec_enum ("publish-clock-mode", "Publish Clock Mode", + "Clock publishing mode according to RFC7273", + GST_TYPE_RTSP_PUBLISH_CLOCK_MODE, DEFAULT_PUBLISH_CLOCK_MODE, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** * GstRTSPClientSink::handle-request: * @rtsp_client_sink: a #GstRTSPClientSink * @request: a #GstRTSPMessage @@ -880,6 +896,7 @@ gst_rtsp_client_sink_init (GstRTSPClientSink * sink) sink->tls_interaction = DEFAULT_TLS_INTERACTION; sink->ntp_time_source = DEFAULT_NTP_TIME_SOURCE; sink->user_agent = g_strdup (DEFAULT_USER_AGENT); + sink->publish_clock_mode = DEFAULT_PUBLISH_CLOCK_MODE; sink->profiles = DEFAULT_PROFILES; @@ -1202,6 +1219,7 @@ gst_rtsp_client_sink_create_stream (GstRTSPClientSink * sink, gst_rtsp_stream_set_ulpfec_pt (stream, ulpfec_pt); gst_rtsp_stream_set_ulpfec_percentage (stream, context->ulpfec_percentage); + gst_rtsp_stream_set_publish_clock_mode (stream, sink->publish_clock_mode); #if 0 if (priv->pool) @@ -1702,6 +1720,9 @@ gst_rtsp_client_sink_set_property (GObject * object, guint prop_id, g_free (rtsp_client_sink->user_agent); rtsp_client_sink->user_agent = g_value_dup_string (value); break; + case PROP_PUBLISH_CLOCK_MODE: + rtsp_client_sink->publish_clock_mode = g_value_get_enum (value); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -1816,6 +1837,9 @@ gst_rtsp_client_sink_get_property (GObject * object, guint prop_id, case PROP_USER_AGENT: g_value_set_string (value, rtsp_client_sink->user_agent); break; + case PROP_PUBLISH_CLOCK_MODE: + g_value_set_enum (value, rtsp_client_sink->publish_clock_mode); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; diff --git a/subprojects/gst-rtsp-server/gst/rtsp-sink/gstrtspclientsink.h b/subprojects/gst-rtsp-server/gst/rtsp-sink/gstrtspclientsink.h index e736b68f46..9ecccbd43f 100644 --- a/subprojects/gst-rtsp-server/gst/rtsp-sink/gstrtspclientsink.h +++ b/subprojects/gst-rtsp-server/gst/rtsp-sink/gstrtspclientsink.h @@ -186,6 +186,7 @@ struct _GstRTSPClientSink { GTlsInteraction *tls_interaction; gint ntp_time_source; gchar *user_agent; + GstRTSPPublishClockMode publish_clock_mode; /* state */ GstRTSPState state; |