diff options
author | Sebastian Dröge <slomo@circular-chaos.org> | 2013-07-22 15:23:11 +0200 |
---|---|---|
committer | Sebastian Dröge <slomo@circular-chaos.org> | 2013-07-22 15:30:13 +0200 |
commit | 5a9f4a3cbc20d0b7c7e41930908a44e5f7c41fdb (patch) | |
tree | 725ba9fa92e088de1baa47814b4215745090d4ea /gst/rtpmanager/gstrtpsession.c | |
parent | 57dd1189d503470d4343a8dfb15e93452349433b (diff) |
rtpsession: Add support for group-id in the stream-start event
Diffstat (limited to 'gst/rtpmanager/gstrtpsession.c')
-rw-r--r-- | gst/rtpmanager/gstrtpsession.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/gst/rtpmanager/gstrtpsession.c b/gst/rtpmanager/gstrtpsession.c index 1bc2b5288..cf704263d 100644 --- a/gst/rtpmanager/gstrtpsession.c +++ b/gst/rtpmanager/gstrtpsession.c @@ -1108,12 +1108,37 @@ do_rtcp_events (GstRtpSession * rtpsession, GstPad * srcpad) GstSegment seg; GstEvent *event; gchar *stream_id; + gboolean have_group_id; + guint group_id; stream_id = g_strdup_printf ("%08x%08x%08x%08x", g_random_int (), g_random_int (), g_random_int (), g_random_int ()); + GST_RTP_SESSION_LOCK (rtpsession); + if (rtpsession->recv_rtp_sink) { + event = + gst_pad_get_sticky_event (rtpsession->recv_rtp_sink, + GST_EVENT_STREAM_START, 0); + if (event) { + if (gst_event_parse_group_id (event, &group_id)) + have_group_id = TRUE; + else + have_group_id = FALSE; + gst_event_unref (event); + } else { + have_group_id = TRUE; + group_id = gst_util_group_id_next (); + } + } else { + have_group_id = TRUE; + group_id = gst_util_group_id_next (); + } + GST_RTP_SESSION_UNLOCK (rtpsession); + event = gst_event_new_stream_start (stream_id); + if (have_group_id) + gst_event_set_group_id (event, group_id); gst_pad_push_event (srcpad, event); g_free (stream_id); |