From 6210cbe1e2cdd2bc36f51e69a97c60c6133b09db Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 3 Apr 2014 17:40:01 +0200 Subject: [PATCH] rtspsrc: send sender SSRC in the MIKEY message Allocate a new SSRC for our RTCP messages back to the server and set this in the MIKEY message. --- gst/rtsp/gstrtspsrc.c | 5 ++++- gst/rtsp/gstrtspsrc.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/gst/rtsp/gstrtspsrc.c b/gst/rtsp/gstrtspsrc.c index 5d1cc358d2..7a378aacdd 100644 --- a/gst/rtsp/gstrtspsrc.c +++ b/gst/rtsp/gstrtspsrc.c @@ -3155,6 +3155,8 @@ gst_rtspsrc_stream_configure_manager (GstRTSPSrc * src, GstRTSPStream * stream, g_object_set (rtpsession, "probation", src->probation, NULL); + g_object_set (rtpsession, "internal-ssrc", stream->send_ssrc, NULL); + g_signal_connect (rtpsession, "on-bye-ssrc", (GCallback) on_bye_ssrc, stream); g_signal_connect (rtpsession, "on-bye-timeout", (GCallback) on_timeout, @@ -5829,7 +5831,8 @@ gst_rtspsrc_stream_make_keymgmt (GstRTSPSrc * src, GstRTSPStream * stream) gst_mikey_message_set_info (msg, GST_MIKEY_VERSION, GST_MIKEY_TYPE_PSK_INIT, FALSE, GST_MIKEY_PRF_MIKEY_1, g_random_int (), GST_MIKEY_MAP_TYPE_SRTP); /* add policy '0' for our SSRC */ - gst_mikey_message_add_cs_srtp (msg, 0, stream->ssrc, 0); + stream->send_ssrc = g_random_int (); + gst_mikey_message_add_cs_srtp (msg, 0, stream->send_ssrc, 0); /* timestamp is now */ gst_mikey_message_add_t_now_ntp_utc (msg); /* add some random data */ diff --git a/gst/rtsp/gstrtspsrc.h b/gst/rtsp/gstrtspsrc.h index 67df852c9c..f38f6fcee6 100644 --- a/gst/rtsp/gstrtspsrc.h +++ b/gst/rtsp/gstrtspsrc.h @@ -139,6 +139,7 @@ struct _GstRTSPStream { GstElement *srtpdec; GstBuffer *key; GstElement *srtpenc; + guint32 send_ssrc; /* per stream connection */ GstRTSPConnInfo conninfo;