summaryrefslogtreecommitdiffstats
path: root/gst/rtsp
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@gmail.com>2005-06-02 13:26:36 +0000
committerWim Taymans <wim.taymans@gmail.com>2005-06-02 13:26:36 +0000
commitca1f865eaa541789d704d0d90ec36001a17da3fd (patch)
tree1453ce61458debc628f6a3488140e0fe9a3c6094 /gst/rtsp
parent9cc325828029d5d746c1d13a0ea729900a7d3ef4 (diff)
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.
Diffstat (limited to 'gst/rtsp')
-rw-r--r--gst/rtsp/README2
-rw-r--r--gst/rtsp/gstrtspsrc.c21
-rw-r--r--gst/rtsp/rtsptransport.c10
3 files changed, 18 insertions, 15 deletions
diff --git a/gst/rtsp/README b/gst/rtsp/README
index 285f4f43..2f7fde89 100644
--- a/gst/rtsp/README
+++ b/gst/rtsp/README
@@ -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:
+---------------------------------------------+
| +------------+ |
diff --git a/gst/rtsp/gstrtspsrc.c b/gst/rtsp/gstrtspsrc.c
index ab2b36eb..5938608d 100644
--- a/gst/rtsp/gstrtspsrc.c
+++ b/gst/rtsp/gstrtspsrc.c
@@ -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;
+ }
}
diff --git a/gst/rtsp/rtsptransport.c b/gst/rtsp/rtsptransport.c
index addf354f..592778bf 100644
--- a/gst/rtsp/rtsptransport.c
+++ b/gst/rtsp/rtsptransport.c
@@ -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