summaryrefslogtreecommitdiffstats
path: root/gst/rtsp
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@gmail.com>2007-07-27 16:56:45 +0000
committerWim Taymans <wim.taymans@gmail.com>2007-07-27 16:56:45 +0000
commit9ace67724c2826e4412a9f10e2fd2a14584010cd (patch)
treebbd8cc6b0013d24e95a52335324bcba33e6e7f00 /gst/rtsp
parenta8ee445da6ff59bbe89b67b5133f1e3aa574bae2 (diff)
gst/rtsp/gstrtspsrc.c: If we don't hav a session manager, set the caps on outgoing buffers ourselves.
Original commit message from CVS: * gst/rtsp/gstrtspsrc.c: (gst_rtspsrc_activate_streams), (gst_rtspsrc_loop_interleaved), (gst_rtspsrc_parse_methods), (gst_rtspsrc_create_transports_string), (gst_rtspsrc_prepare_transports): If we don't hav a session manager, set the caps on outgoing buffers ourselves. Force PAUSE/PLAY methods for now until the extensions can overwrite. Append final bit of the transport string even when it does not contain a placeholder.
Diffstat (limited to 'gst/rtsp')
-rw-r--r--gst/rtsp/gstrtspsrc.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/gst/rtsp/gstrtspsrc.c b/gst/rtsp/gstrtspsrc.c
index 619c1850..07323fd2 100644
--- a/gst/rtsp/gstrtspsrc.c
+++ b/gst/rtsp/gstrtspsrc.c
@@ -1936,9 +1936,18 @@ gst_rtspsrc_activate_streams (GstRTSPSrc * src)
g_object_set (G_OBJECT (stream->udpsrc[0]), "timeout", (guint64) 0, NULL);
}
if (stream->srcpad) {
+ /* if we don't have a session manager, set the caps now. If we have a
+ * session, we will get a notification of the pad and the caps. */
+ if (!src->session) {
+ GST_DEBUG_OBJECT (src, "setting pad caps for stream %p", stream);
+ gst_pad_set_caps (stream->srcpad, stream->caps);
+ }
+
+ GST_DEBUG_OBJECT (src, "activating stream pad %p", stream);
gst_pad_set_active (stream->srcpad, TRUE);
/* add the pad */
if (!stream->added) {
+ GST_DEBUG_OBJECT (src, "adding stream pad %p", stream);
gst_element_add_pad (GST_ELEMENT_CAST (src), stream->srcpad);
stream->added = TRUE;
}
@@ -1950,6 +1959,7 @@ gst_rtspsrc_activate_streams (GstRTSPSrc * src)
GstRTSPStream *stream = (GstRTSPStream *) walk->data;
if (stream->blockedpad) {
+ GST_DEBUG_OBJECT (src, "unblocking stream pad %p", stream);
gst_pad_set_blocked_async (stream->blockedpad, FALSE,
(GstPadBlockCallback) pad_unblocked, src);
stream->blockedpad = NULL;
@@ -2273,6 +2283,12 @@ gst_rtspsrc_loop_interleaved (GstRTSPSrc * src)
src->need_activate = FALSE;
}
+ if (!src->session) {
+ /* set stream caps on buffer when we don't have a session manager to do it
+ * for us */
+ gst_buffer_set_caps (buf, stream->caps);
+ }
+
/* chain to the peer pad */
if (GST_PAD_IS_SINK (outpad))
ret = gst_pad_chain (outpad, buf);
@@ -2916,8 +2932,9 @@ gst_rtspsrc_parse_methods (GstRTSPSrc * src, GstRTSPMessage * response)
gint indx = 0;
gint i;
- /* clear supported methods */
- src->methods = 0;
+ /* clear supported methods, FIXME, extensions should be able to configure
+ * this. */
+ src->methods = GST_RTSP_PLAY | GST_RTSP_PAUSE;
/* Try Allow Header first */
field = GST_RTSP_HDR_ALLOW;
@@ -3001,6 +3018,8 @@ gst_rtspsrc_create_transports_string (GstRTSPSrc * src,
if (res < 0)
goto failed;
+ GST_DEBUG_OBJECT (src, "got transports %s", GST_STR_NULL (*transports));
+
/* extension listed transports, use those */
if (*transports != NULL)
return GST_RTSP_OK;
@@ -3104,6 +3123,8 @@ gst_rtspsrc_prepare_transports (GstRTSPStream * stream, gchar ** transports)
p = next + 4;
}
+ /* append final part */
+ g_string_append (str, p);
g_free (*transports);
*transports = g_string_free (str, FALSE);