media: Fix pt map caps

Since decryption is handled within rtpbin, all outcoming stream
caps will be application/x-rtp (i.e. regular rtp)

Fixes RECORD with SRTP streams
This commit is contained in:
Edward Hervey 2016-12-02 15:40:09 +01:00 committed by Edward Hervey
parent 8317139121
commit dea000f2e3

View 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);