rtspsrc: put caps on udpsrc instead of using the signals

Try to avoid using the request-pt-map to get caps but set them directly
on the udpsrc element. That way, the caps get nicely transformed as they
pass through the different elements in the rtpbin, including the AUX and
decoder/encoder elements.
This commit is contained in:
Wim Taymans 2014-03-24 16:58:25 +01:00
parent 2b59828e0b
commit 5ec8c96966

View file

@ -3265,6 +3265,8 @@ gst_rtspsrc_stream_configure_udp (GstRTSPSrc * src, GstRTSPStream * stream,
/* we manage the UDP elements now. For unicast, the UDP sources where /* we manage the UDP elements now. For unicast, the UDP sources where
* allocated in the stream when we suggested a transport. */ * allocated in the stream when we suggested a transport. */
if (stream->udpsrc[0]) { if (stream->udpsrc[0]) {
GstCaps *caps;
gst_element_set_locked_state (stream->udpsrc[0], TRUE); gst_element_set_locked_state (stream->udpsrc[0], TRUE);
gst_bin_add (GST_BIN_CAST (src), stream->udpsrc[0]); gst_bin_add (GST_BIN_CAST (src), stream->udpsrc[0]);
@ -3276,6 +3278,9 @@ gst_rtspsrc_stream_configure_udp (GstRTSPSrc * src, GstRTSPStream * stream,
g_object_set (G_OBJECT (stream->udpsrc[0]), "timeout", g_object_set (G_OBJECT (stream->udpsrc[0]), "timeout",
src->udp_timeout * 1000, NULL); src->udp_timeout * 1000, NULL);
if ((caps = stream_get_caps_for_pt (stream, stream->default_pt)))
g_object_set (stream->udpsrc[0], "caps", caps, NULL);
/* get output pad of the UDP source. */ /* get output pad of the UDP source. */
*outpad = gst_element_get_static_pad (stream->udpsrc[0], "src"); *outpad = gst_element_get_static_pad (stream->udpsrc[0], "src");
@ -3728,6 +3733,10 @@ gst_rtspsrc_configure_caps (GstRTSPSrc * src, GstSegment * segment,
item->caps = caps; item->caps = caps;
GST_DEBUG_OBJECT (src, "stream %p, pt %d, caps %" GST_PTR_FORMAT, stream, GST_DEBUG_OBJECT (src, "stream %p, pt %d, caps %" GST_PTR_FORMAT, stream,
item->pt, caps); item->pt, caps);
if (item->pt == stream->default_pt && stream->udpsrc[0]) {
g_object_set (stream->udpsrc[0], "caps", caps, NULL);
}
} }
} }
if (reset_manager && src->manager) { if (reset_manager && src->manager) {