rtspsrc: put caps on udpsrc instead of using the signals
authorWim Taymans <wtaymans@redhat.com>
Mon, 24 Mar 2014 15:58:25 +0000 (16:58 +0100)
committerWim Taymans <wtaymans@redhat.com>
Mon, 24 Mar 2014 16:07:06 +0000 (17:07 +0100)
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.

gst/rtsp/gstrtspsrc.c

index 83b0539..5dd9a08 100644 (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
    * allocated in the stream when we suggested a transport. */
   if (stream->udpsrc[0]) {
+    GstCaps *caps;
+
     gst_element_set_locked_state (stream->udpsrc[0], TRUE);
     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",
         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. */
     *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;
       GST_DEBUG_OBJECT (src, "stream %p, pt %d, caps %" GST_PTR_FORMAT, stream,
           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) {