When the client does not provide us with channels in TCP mode, allocate channels
ourselves.
if (media == NULL)
goto not_found;
+ /* fix the transports */
+ if (ct->lower_transport & GST_RTSP_LOWER_TRANS_TCP) {
+ /* check if the client selected channels for TCP */
+ if (ct->interleaved.min == -1 || ct->interleaved.max == -1) {
+ gst_rtsp_session_media_alloc_channels (media, &ct->interleaved);
+ }
+ }
+
/* get a handle to the stream in the media */
if (!(stream = gst_rtsp_session_media_get_stream (media, streamid)))
goto no_stream;
static GstRTSPResult
message_sent (GstRTSPWatch * watch, guint cseq, gpointer user_data)
{
- GstRTSPClient *client = GST_RTSP_CLIENT (user_data);
+ GstRTSPClient *client;
+
+ client = GST_RTSP_CLIENT (user_data);
- g_message ("client %p: sent a message with cseq %d", client, cseq);
+ /* g_message ("client %p: sent a message with cseq %d", client, cseq); */
return GST_RTSP_OK;
}
}
}
+gboolean
+gst_rtsp_session_media_alloc_channels (GstRTSPSessionMedia *media, GstRTSPRange *range)
+{
+ range->min = media->counter++;
+ range->max = media->counter++;
+
+ return TRUE;
+}
+
/**
* gst_rtsp_session_new:
*
st->lower_transport = ct->lower_transport;
st->client_port = ct->client_port;
st->interleaved = ct->interleaved;
- st->server_port.min = stream->media_stream->server_port.min;
- st->server_port.max = stream->media_stream->server_port.max;
+ st->server_port = stream->media_stream->server_port;
/* keep track of the transports in the stream. */
if (stream->trans.transport)
/* the server state */
GstRTSPState state;
+ /* counter for channels */
+ guint counter;
+
/* configuration for the different streams */
GArray *streams;
};
GstRTSPSessionStream * gst_rtsp_session_media_get_stream (GstRTSPSessionMedia *media,
guint idx);
+gboolean gst_rtsp_session_media_alloc_channels (GstRTSPSessionMedia *media,
+ GstRTSPRange *range);
+
/* configure transport */
GstRTSPTransport * gst_rtsp_session_stream_set_transport (GstRTSPSessionStream *stream,
GstRTSPTransport *ct);