mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-10-05 02:02:26 +00:00
client: do configuration of transport in one place
Move the configuration of the transport destination address to where we also configure the other bits.
This commit is contained in:
parent
8749b1e08f
commit
b0e22d6861
1 changed files with 15 additions and 15 deletions
|
@ -857,7 +857,6 @@ handle_setup_request (GstRTSPClient * client, GstRTSPClientState * state)
|
||||||
gchar *trans_str, *pos;
|
gchar *trans_str, *pos;
|
||||||
guint streamid;
|
guint streamid;
|
||||||
GstRTSPSessionMedia *media;
|
GstRTSPSessionMedia *media;
|
||||||
GstRTSPUrl *url;
|
|
||||||
|
|
||||||
uri = state->uri;
|
uri = state->uri;
|
||||||
|
|
||||||
|
@ -932,15 +931,6 @@ handle_setup_request (GstRTSPClient * client, GstRTSPClientState * state)
|
||||||
if (client->session_pool == NULL)
|
if (client->session_pool == NULL)
|
||||||
goto no_pool;
|
goto no_pool;
|
||||||
|
|
||||||
/* we have a valid transport now, set the destination of the client. */
|
|
||||||
g_free (ct->destination);
|
|
||||||
if (ct->lower_transport == GST_RTSP_LOWER_TRANS_UDP_MCAST) {
|
|
||||||
ct->destination = g_strdup (MCAST_ADDRESS);
|
|
||||||
} else {
|
|
||||||
url = gst_rtsp_connection_get_url (client->connection);
|
|
||||||
ct->destination = g_strdup (url->host);
|
|
||||||
}
|
|
||||||
|
|
||||||
session = state->session;
|
session = state->session;
|
||||||
|
|
||||||
if (session) {
|
if (session) {
|
||||||
|
@ -977,13 +967,23 @@ handle_setup_request (GstRTSPClient * client, GstRTSPClientState * state)
|
||||||
|
|
||||||
state->sessmedia = media;
|
state->sessmedia = media;
|
||||||
|
|
||||||
/* fix the transports */
|
/* we have a valid transport now, set the destination of the client. */
|
||||||
|
g_free (ct->destination);
|
||||||
|
if (ct->lower_transport == GST_RTSP_LOWER_TRANS_UDP_MCAST) {
|
||||||
|
ct->destination = g_strdup (MCAST_ADDRESS);
|
||||||
|
} else {
|
||||||
|
GstRTSPUrl *url;
|
||||||
|
|
||||||
|
url = gst_rtsp_connection_get_url (client->connection);
|
||||||
|
ct->destination = g_strdup (url->host);
|
||||||
|
|
||||||
if (ct->lower_transport & GST_RTSP_LOWER_TRANS_TCP) {
|
if (ct->lower_transport & GST_RTSP_LOWER_TRANS_TCP) {
|
||||||
/* check if the client selected channels for TCP */
|
/* check if the client selected channels for TCP */
|
||||||
if (ct->interleaved.min == -1 || ct->interleaved.max == -1) {
|
if (ct->interleaved.min == -1 || ct->interleaved.max == -1) {
|
||||||
gst_rtsp_session_media_alloc_channels (media, &ct->interleaved);
|
gst_rtsp_session_media_alloc_channels (media, &ct->interleaved);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* get a handle to the stream in the media */
|
/* get a handle to the stream in the media */
|
||||||
if (!(stream = gst_rtsp_session_media_get_stream (media, streamid)))
|
if (!(stream = gst_rtsp_session_media_get_stream (media, streamid)))
|
||||||
|
|
Loading…
Reference in a new issue