rtspsrc: Handle TCP as lower transport with RTSP 2.0

Meaning that the interleave fields have to be updated as
if streams setup was working when using pipelined setup
request. Otherwise there is a mismatch between the server
channel count and our own.

This also makes RTSP 2.0 over HTTP working.

https://bugzilla.gnome.org/show_bug.cgi?id=781446
This commit is contained in:
Thibault Saunier 2017-07-13 14:46:55 -04:00
parent 8121752887
commit ffcd173c09

View file

@ -6082,10 +6082,14 @@ gst_rtspsrc_prepare_transports (GstRTSPStream * stream, gchar ** transports,
g_string_append_printf (str, "%d", src->free_channel); g_string_append_printf (str, "%d", src->free_channel);
else if (next[3] == '2') else if (next[3] == '2')
g_string_append_printf (str, "%d", src->free_channel + 1); g_string_append_printf (str, "%d", src->free_channel + 1);
} }
p = next + 4; p = next + 4;
} }
if (src->version >= GST_RTSP_VERSION_2_0)
src->free_channel += 2;
/* append final part */ /* append final part */
g_string_append (str, p); g_string_append (str, p);
@ -6202,10 +6206,12 @@ gst_rtsp_src_setup_stream_from_response (GstRTSPSrc * src,
if (protocols) if (protocols)
*protocols = GST_RTSP_LOWER_TRANS_TCP; *protocols = GST_RTSP_LOWER_TRANS_TCP;
src->interleaved = TRUE; src->interleaved = TRUE;
/* update free channels */ if (src->version < GST_RTSP_VERSION_2_0) {
src->free_channel = MAX (transport.interleaved.min, src->free_channel); /* update free channels */
src->free_channel = MAX (transport.interleaved.max, src->free_channel); src->free_channel = MAX (transport.interleaved.min, src->free_channel);
src->free_channel++; src->free_channel = MAX (transport.interleaved.max, src->free_channel);
src->free_channel++;
}
break; break;
case GST_RTSP_LOWER_TRANS_UDP_MCAST: case GST_RTSP_LOWER_TRANS_UDP_MCAST:
/* only allow multicast for other streams */ /* only allow multicast for other streams */
@ -6331,7 +6337,7 @@ gst_rtspsrc_setup_streams_end (GstRTSPSrc * src, gboolean async)
gst_rtsp_src_receive_response (src, conninfo, &response, NULL); gst_rtsp_src_receive_response (src, conninfo, &response, NULL);
gst_rtsp_src_setup_stream_from_response (src, stream, gst_rtsp_src_setup_stream_from_response (src, stream,
&response, NULL, 1, NULL, NULL); &response, NULL, 0, NULL, NULL);
} }
return GST_RTSP_OK; return GST_RTSP_OK;
@ -6505,7 +6511,6 @@ gst_rtspsrc_setup_streams_start (GstRTSPSrc * src, gboolean async)
} }
GST_DEBUG_OBJECT (src, "transport is now %s", GST_STR_NULL (transports)); GST_DEBUG_OBJECT (src, "transport is now %s", GST_STR_NULL (transports));
/* create SETUP request */ /* create SETUP request */
res = res =
gst_rtspsrc_init_request (src, &request, GST_RTSP_SETUP, gst_rtspsrc_init_request (src, &request, GST_RTSP_SETUP,