rtspsrc: use profile to set rtcp caps
authorWim Taymans <wtaymans@redhat.com>
Mon, 24 Mar 2014 14:35:09 +0000 (15:35 +0100)
committerWim Taymans <wtaymans@redhat.com>
Mon, 24 Mar 2014 14:35:09 +0000 (15:35 +0100)
Use the negotiated profile to set x-rtcp or x-srtcp caps

gst/rtsp/gstrtspsrc.c

index ed158550bf0e1acfea51c44c42e369c950e9f27c..83b0539e1678c29b041166f5a2756cb5587a670f 100644 (file)
@@ -3220,7 +3220,11 @@ gst_rtspsrc_stream_configure_mcast (GstRTSPSrc * src, GstRTSPStream * stream,
     if (stream->udpsrc[1] == NULL)
       goto no_element;
 
-    caps = gst_caps_new_empty_simple ("application/x-rtcp");
+    if (stream->profile == GST_RTSP_PROFILE_SAVP ||
+        stream->profile == GST_RTSP_PROFILE_SAVPF)
+      caps = gst_caps_new_empty_simple ("application/x-srtcp");
+    else
+      caps = gst_caps_new_empty_simple ("application/x-rtcp");
     g_object_set (stream->udpsrc[1], "caps", caps, NULL);
     gst_caps_unref (caps);
 
@@ -3306,7 +3310,11 @@ gst_rtspsrc_stream_configure_udp (GstRTSPSrc * src, GstRTSPStream * stream,
     gst_element_set_locked_state (stream->udpsrc[1], TRUE);
     gst_bin_add (GST_BIN_CAST (src), stream->udpsrc[1]);
 
-    caps = gst_caps_new_empty_simple ("application/x-rtcp");
+    if (stream->profile == GST_RTSP_PROFILE_SAVP ||
+        stream->profile == GST_RTSP_PROFILE_SAVPF)
+      caps = gst_caps_new_empty_simple ("application/x-srtcp");
+    else
+      caps = gst_caps_new_empty_simple ("application/x-rtcp");
     g_object_set (stream->udpsrc[1], "caps", caps, NULL);
     gst_caps_unref (caps);