From 297d808acce41d2f20b281a2acd642285b5ba01a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 5 Mar 2015 09:46:17 +0100 Subject: [PATCH] rtspsrc: Push RTCP caps on the RTCP pads Otherwise we will get not-negotiated later from rtpbin, and will never be able to send RTCP packets back to the server. Note that error flow returns from the RTCP pads are ignored, that's why it didn't fail more visible before. --- gst/rtsp/gstrtspsrc.c | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/gst/rtsp/gstrtspsrc.c b/gst/rtsp/gstrtspsrc.c index 89ab84df34..0719b90cd7 100644 --- a/gst/rtsp/gstrtspsrc.c +++ b/gst/rtsp/gstrtspsrc.c @@ -4586,7 +4586,37 @@ gst_rtspsrc_handle_data (GstRTSPSrc * src, GstRTSPMessage * message) gst_rtspsrc_stream_push_event (src, ostream, event); if ((caps = stream_get_caps_for_pt (ostream, ostream->default_pt))) { - gst_rtspsrc_stream_push_event (src, ostream, gst_event_new_caps (caps)); + /* only streams that have a connection to the outside world */ + if (ostream->setup) { + if (ostream->udpsrc[0]) { + gst_element_send_event (ostream->udpsrc[0], + gst_event_new_caps (caps)); + } else if (ostream->channelpad[0]) { + if (GST_PAD_IS_SRC (ostream->channelpad[0])) + gst_pad_push_event (ostream->channelpad[0], + gst_event_new_caps (caps)); + else + gst_pad_send_event (ostream->channelpad[0], + gst_event_new_caps (caps)); + } + + gst_caps_unref (caps); + caps = gst_caps_new_empty_simple ("application/x-rtcp"); + + if (ostream->udpsrc[1]) { + gst_element_send_event (ostream->udpsrc[1], + gst_event_new_caps (caps)); + } else if (ostream->channelpad[1]) { + if (GST_PAD_IS_SRC (ostream->channelpad[1])) + gst_pad_push_event (ostream->channelpad[1], + gst_event_new_caps (caps)); + else + gst_pad_send_event (ostream->channelpad[1], + gst_event_new_caps (caps)); + } + } + + gst_caps_unref (caps); } /* Push a SEGMENT event if we don't have one pending, if we have one