From 41285697ac549a21e924885db94e7e53e3813b63 Mon Sep 17 00:00:00 2001 From: George Kiagiadakis Date: Mon, 25 Nov 2013 15:00:45 +0100 Subject: [PATCH] rtprtxsend: Add an rtx-ssrc property to allow external control of the ssrc This is useful when one needs to know the SSRC beforehands, so that it can be used for SRTP for example. --- gst/rtpmanager/gstrtprtxsend.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/gst/rtpmanager/gstrtprtxsend.c b/gst/rtpmanager/gstrtprtxsend.c index a4a0290..bb4d92c 100644 --- a/gst/rtpmanager/gstrtprtxsend.c +++ b/gst/rtpmanager/gstrtprtxsend.c @@ -55,6 +55,7 @@ GST_DEBUG_CATEGORY_STATIC (gst_rtp_rtx_send_debug); enum { PROP_0, + PROP_RTX_SSRC, PROP_RTX_PAYLOAD_TYPE, PROP_MAX_SIZE_TIME, PROP_MAX_SIZE_PACKETS, @@ -120,6 +121,12 @@ gst_rtp_rtx_send_class_init (GstRtpRtxSendClass * klass) gobject_class->set_property = gst_rtp_rtx_send_set_property; gobject_class->finalize = gst_rtp_rtx_send_finalize; + g_object_class_install_property (gobject_class, PROP_RTX_SSRC, + g_param_spec_uint ("rtx-ssrc", "Retransmission SSRC", + "SSRC of the retransmission stream for SSRC-multiplexed mode " + "(default = random)", 0, G_MAXUINT, -1, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + g_object_class_install_property (gobject_class, PROP_RTX_PAYLOAD_TYPE, g_param_spec_uint ("rtx-payload-type", "RTX Payload Type", "Payload type of the retransmission stream (fmtp in SDP)", 0, @@ -565,6 +572,11 @@ gst_rtp_rtx_send_get_property (GObject * object, GstRtpRtxSend *rtx = GST_RTP_RTX_SEND (object); switch (prop_id) { + case PROP_RTX_SSRC: + g_mutex_lock (&rtx->lock); + g_value_set_uint (value, rtx->rtx_ssrc); + g_mutex_unlock (&rtx->lock); + break; case PROP_RTX_PAYLOAD_TYPE: g_mutex_lock (&rtx->lock); g_value_set_uint (value, rtx->rtx_payload_type_pending); @@ -603,6 +615,11 @@ gst_rtp_rtx_send_set_property (GObject * object, GstRtpRtxSend *rtx = GST_RTP_RTX_SEND (object); switch (prop_id) { + case PROP_RTX_SSRC: + g_mutex_lock (&rtx->lock); + rtx->rtx_ssrc = g_value_get_uint (value); + g_mutex_unlock (&rtx->lock); + break; case PROP_RTX_PAYLOAD_TYPE: g_mutex_lock (&rtx->lock); rtx->rtx_payload_type_pending = g_value_get_uint (value); -- 2.7.4