media: Fix pt map caps
authorEdward Hervey <edward@centricular.com>
Fri, 2 Dec 2016 14:40:09 +0000 (15:40 +0100)
committerEdward Hervey <bilboed@bilboed.com>
Fri, 2 Dec 2016 14:47:12 +0000 (15:47 +0100)
Since decryption is handled within rtpbin, all outcoming stream
caps will be application/x-rtp (i.e. regular rtp)

Fixes RECORD with SRTP streams

gst/rtsp-server/rtsp-media.c

index 4858b13..a7f3460 100644 (file)
@@ -3380,7 +3380,7 @@ default_handle_sdp (GstRTSPMedia * media, GstSDPMessage * sdp)
   }
 
   for (i = 0; i < medias_len; i++) {
-    const gchar *proto, *media_type;
+    const gchar *proto;
     const GstSDPMedia *sdp_media = gst_sdp_message_get_media (sdp, i);
     GstRTSPStream *stream;
     gint j, formats_len;
@@ -3399,16 +3399,12 @@ default_handle_sdp (GstRTSPMedia * media, GstSDPMessage * sdp)
     }
 
     if (g_str_equal (proto, "RTP/AVP")) {
-      media_type = "application/x-rtp";
       profile = GST_RTSP_PROFILE_AVP;
     } else if (g_str_equal (proto, "RTP/SAVP")) {
-      media_type = "application/x-srtp";
       profile = GST_RTSP_PROFILE_SAVP;
     } else if (g_str_equal (proto, "RTP/AVPF")) {
-      media_type = "application/x-rtp";
       profile = GST_RTSP_PROFILE_AVPF;
     } else if (g_str_equal (proto, "RTP/SAVPF")) {
-      media_type = "application/x-srtp";
       profile = GST_RTSP_PROFILE_SAVPF;
     } else {
       GST_ERROR ("%p: unsupported profile '%s' for stream %d", media, proto, i);
@@ -3445,7 +3441,7 @@ default_handle_sdp (GstRTSPMedia * media, GstSDPMessage * sdp)
       gst_sdp_media_attributes_to_caps (sdp_media, caps);
 
       s = gst_caps_get_structure (caps, 0);
-      gst_structure_set_name (s, media_type);
+      gst_structure_set_name (s, "application/x-rtp");
 
       gst_rtsp_stream_set_pt_map (stream, pt, caps);
       gst_caps_unref (caps);