mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-31 03:29:50 +00:00
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>
This commit is contained in:
parent
ce50e13e28
commit
5f2989d5a1
3 changed files with 38 additions and 1 deletions
|
@ -174,6 +174,18 @@
|
||||||
"type": "gchararray",
|
"type": "gchararray",
|
||||||
"writable": true
|
"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": {
|
"retry": {
|
||||||
"blurb": "Max number of retries when allocating RTP ports.",
|
"blurb": "Max number of retries when allocating RTP ports.",
|
||||||
"conditionally-available": false,
|
"conditionally-available": false,
|
||||||
|
|
|
@ -304,6 +304,7 @@ gst_rtsp_client_sink_ntp_time_source_get_type (void)
|
||||||
#define DEFAULT_USER_AGENT "GStreamer/" PACKAGE_VERSION
|
#define DEFAULT_USER_AGENT "GStreamer/" PACKAGE_VERSION
|
||||||
#define DEFAULT_PROFILES GST_RTSP_PROFILE_AVP
|
#define DEFAULT_PROFILES GST_RTSP_PROFILE_AVP
|
||||||
#define DEFAULT_RTX_TIME_MS 500
|
#define DEFAULT_RTX_TIME_MS 500
|
||||||
|
#define DEFAULT_PUBLISH_CLOCK_MODE GST_RTSP_PUBLISH_CLOCK_MODE_CLOCK
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
|
@ -333,7 +334,8 @@ enum
|
||||||
PROP_TLS_INTERACTION,
|
PROP_TLS_INTERACTION,
|
||||||
PROP_NTP_TIME_SOURCE,
|
PROP_NTP_TIME_SOURCE,
|
||||||
PROP_USER_AGENT,
|
PROP_USER_AGENT,
|
||||||
PROP_PROFILES
|
PROP_PROFILES,
|
||||||
|
PROP_PUBLISH_CLOCK_MODE,
|
||||||
};
|
};
|
||||||
|
|
||||||
static void gst_rtsp_client_sink_finalize (GObject * object);
|
static void gst_rtsp_client_sink_finalize (GObject * object);
|
||||||
|
@ -732,6 +734,20 @@ gst_rtsp_client_sink_class_init (GstRTSPClientSinkClass * klass)
|
||||||
"The User-Agent string to send to the server",
|
"The User-Agent string to send to the server",
|
||||||
DEFAULT_USER_AGENT, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
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:
|
* GstRTSPClientSink::handle-request:
|
||||||
* @rtsp_client_sink: a #GstRTSPClientSink
|
* @rtsp_client_sink: a #GstRTSPClientSink
|
||||||
|
@ -880,6 +896,7 @@ gst_rtsp_client_sink_init (GstRTSPClientSink * sink)
|
||||||
sink->tls_interaction = DEFAULT_TLS_INTERACTION;
|
sink->tls_interaction = DEFAULT_TLS_INTERACTION;
|
||||||
sink->ntp_time_source = DEFAULT_NTP_TIME_SOURCE;
|
sink->ntp_time_source = DEFAULT_NTP_TIME_SOURCE;
|
||||||
sink->user_agent = g_strdup (DEFAULT_USER_AGENT);
|
sink->user_agent = g_strdup (DEFAULT_USER_AGENT);
|
||||||
|
sink->publish_clock_mode = DEFAULT_PUBLISH_CLOCK_MODE;
|
||||||
|
|
||||||
sink->profiles = DEFAULT_PROFILES;
|
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_pt (stream, ulpfec_pt);
|
||||||
gst_rtsp_stream_set_ulpfec_percentage (stream, context->ulpfec_percentage);
|
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 0
|
||||||
if (priv->pool)
|
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);
|
g_free (rtsp_client_sink->user_agent);
|
||||||
rtsp_client_sink->user_agent = g_value_dup_string (value);
|
rtsp_client_sink->user_agent = g_value_dup_string (value);
|
||||||
break;
|
break;
|
||||||
|
case PROP_PUBLISH_CLOCK_MODE:
|
||||||
|
rtsp_client_sink->publish_clock_mode = g_value_get_enum (value);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
break;
|
break;
|
||||||
|
@ -1816,6 +1837,9 @@ gst_rtsp_client_sink_get_property (GObject * object, guint prop_id,
|
||||||
case PROP_USER_AGENT:
|
case PROP_USER_AGENT:
|
||||||
g_value_set_string (value, rtsp_client_sink->user_agent);
|
g_value_set_string (value, rtsp_client_sink->user_agent);
|
||||||
break;
|
break;
|
||||||
|
case PROP_PUBLISH_CLOCK_MODE:
|
||||||
|
g_value_set_enum (value, rtsp_client_sink->publish_clock_mode);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -186,6 +186,7 @@ struct _GstRTSPClientSink {
|
||||||
GTlsInteraction *tls_interaction;
|
GTlsInteraction *tls_interaction;
|
||||||
gint ntp_time_source;
|
gint ntp_time_source;
|
||||||
gchar *user_agent;
|
gchar *user_agent;
|
||||||
|
GstRTSPPublishClockMode publish_clock_mode;
|
||||||
|
|
||||||
/* state */
|
/* state */
|
||||||
GstRTSPState state;
|
GstRTSPState state;
|
||||||
|
|
Loading…
Reference in a new issue