mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 04:01:08 +00:00
gst/rtsp/: RTSP cleanups.
Original commit message from CVS: * gst/rtsp/README: * gst/rtsp/gstrtspsrc.c: (gst_rtsp_proto_get_type), (gst_rtspsrc_class_init), (gst_rtspsrc_create_stream), (gst_rtspsrc_add_element), (gst_rtspsrc_set_state), (gst_rtspsrc_stream_setup_rtp), (gst_rtspsrc_stream_configure_transport), (find_stream), (gst_rtspsrc_loop), (gst_rtspsrc_open), (gst_rtspsrc_play), (gst_rtspsrc_change_state): * gst/rtsp/rtsptransport.c: (rtsp_transport_new), (rtsp_transport_init), (parse_mode), (parse_range), (rtsp_transport_parse), (rtsp_transport_free): RTSP cleanups.
This commit is contained in:
parent
9cc3258280
commit
ca1f865eaa
4 changed files with 33 additions and 15 deletions
15
ChangeLog
15
ChangeLog
|
@ -1,3 +1,18 @@
|
|||
2005-06-02 Wim Taymans <wim@fluendo.com>
|
||||
|
||||
* gst/rtsp/README:
|
||||
* gst/rtsp/gstrtspsrc.c: (gst_rtsp_proto_get_type),
|
||||
(gst_rtspsrc_class_init), (gst_rtspsrc_create_stream),
|
||||
(gst_rtspsrc_add_element), (gst_rtspsrc_set_state),
|
||||
(gst_rtspsrc_stream_setup_rtp),
|
||||
(gst_rtspsrc_stream_configure_transport), (find_stream),
|
||||
(gst_rtspsrc_loop), (gst_rtspsrc_open), (gst_rtspsrc_play),
|
||||
(gst_rtspsrc_change_state):
|
||||
* gst/rtsp/rtsptransport.c: (rtsp_transport_new),
|
||||
(rtsp_transport_init), (parse_mode), (parse_range),
|
||||
(rtsp_transport_parse), (rtsp_transport_free):
|
||||
RTSP cleanups.
|
||||
|
||||
2005-06-02 Wim Taymans <wim@fluendo.com>
|
||||
|
||||
* gst/effectv/gstquark.c: (gst_quarktv_chain):
|
||||
|
|
|
@ -132,7 +132,7 @@ An RTSP session is created as follows:
|
|||
the data will be received on the same connection as the RTSP connection.
|
||||
|
||||
At this point, we remove the UDP source elements as we don't need them anymore. We
|
||||
setup the rtpdec session manager element though as follows:
|
||||
set up the rtpsess session manager element though as follows:
|
||||
|
||||
+---------------------------------------------+
|
||||
| +------------+ |
|
||||
|
|
|
@ -256,6 +256,8 @@ gst_rtspsrc_set_state (GstRTSPSrc * src, GstElementState state)
|
|||
GstElementStateReturn ret;
|
||||
GList *streams;
|
||||
|
||||
ret = GST_STATE_SUCCESS;
|
||||
|
||||
/* for all streams */
|
||||
for (streams = src->streams; streams; streams = g_list_next (streams)) {
|
||||
GstRTSPStream *stream;
|
||||
|
@ -462,13 +464,14 @@ gst_rtspsrc_loop (GstRTSPSrc * src)
|
|||
outpad = stream->rtpdecrtcp;
|
||||
}
|
||||
|
||||
if ((chainfunc = GST_RPAD_CHAINFUNC (outpad))) {
|
||||
/* and chain buffer to internal element */
|
||||
{
|
||||
GstBuffer *buf;
|
||||
|
||||
buf = gst_buffer_new_and_alloc (size);
|
||||
memcpy (GST_BUFFER_DATA (buf), data, size);
|
||||
|
||||
if (chainfunc (outpad, buf) != GST_FLOW_OK)
|
||||
if (gst_pad_chain (outpad, buf) != GST_FLOW_OK)
|
||||
goto need_pause;
|
||||
}
|
||||
|
||||
|
@ -689,9 +692,9 @@ gst_rtspsrc_open (GstRTSPSrc * src)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
||||
/* ERRORS */
|
||||
invalid_url:
|
||||
{
|
||||
GST_ELEMENT_ERROR (src, RESOURCE, NOT_FOUND,
|
||||
|
@ -858,7 +861,8 @@ gst_rtspsrc_change_state (GstElement * element)
|
|||
break;
|
||||
case GST_STATE_READY_TO_PAUSED:
|
||||
rtspsrc->interleaved = FALSE;
|
||||
gst_rtspsrc_open (rtspsrc);
|
||||
if (!gst_rtspsrc_open (rtspsrc))
|
||||
goto open_failed;
|
||||
/* need to play now for the preroll, might delay that to
|
||||
* next state when we have NO_PREROLL as a return value */
|
||||
gst_rtspsrc_play (rtspsrc);
|
||||
|
@ -872,7 +876,7 @@ gst_rtspsrc_change_state (GstElement * element)
|
|||
|
||||
ret = gst_rtspsrc_set_state (rtspsrc, GST_STATE_PENDING (rtspsrc));
|
||||
if (ret != GST_STATE_SUCCESS)
|
||||
goto error;
|
||||
goto done;
|
||||
ret = GST_ELEMENT_CLASS (parent_class)->change_state (element);
|
||||
|
||||
switch (transition) {
|
||||
|
@ -887,6 +891,11 @@ gst_rtspsrc_change_state (GstElement * element)
|
|||
break;
|
||||
}
|
||||
|
||||
error:
|
||||
done:
|
||||
return ret;
|
||||
|
||||
open_failed:
|
||||
{
|
||||
return GST_STATE_FAILURE;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -55,14 +55,8 @@ rtsp_transport_init (RTSPTransport * transport)
|
|||
static void
|
||||
parse_mode (RTSPTransport * transport, gchar * str)
|
||||
{
|
||||
if (strstr (str, "\"PLAY\""))
|
||||
transport->mode_play = TRUE;
|
||||
else
|
||||
transport->mode_play = FALSE;
|
||||
if (strstr (str, "\"RECORD\""))
|
||||
transport->mode_record = TRUE;
|
||||
else
|
||||
transport->mode_record = FALSE;
|
||||
transport->mode_play = (strstr (str, "\"PLAY\"") != NULL);
|
||||
transport->mode_record = (strstr (str, "\"RECORD\"") != NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
Loading…
Reference in a new issue