summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@gmail.com>2007-09-26 20:12:52 +0000
committerWim Taymans <wim.taymans@gmail.com>2007-09-26 20:12:52 +0000
commit4683ff80d3a9535f92708a8966c3d2793294ee48 (patch)
treeebf14d9c24fa5f07b3886fd14db1a0062fa53b7e
parent285ec58919613ac151e2083d5977b619b6a069ae (diff)
gst/rtsp/gstrtspsrc.*: Set timestamps on RTP buffers in interleaved mode.
Original commit message from CVS: * gst/rtsp/gstrtspsrc.c: (gst_rtspsrc_create_stream), (gst_rtspsrc_handle_src_query), (gst_rtspsrc_loop_interleaved), (gst_rtspsrc_loop_udp), (gst_rtspsrc_close): * gst/rtsp/gstrtspsrc.h: Set timestamps on RTP buffers in interleaved mode. Mark first buffers with a DISCONT. Remove flush hack now that sync for live sources has been figured out.
-rw-r--r--ChangeLog10
-rw-r--r--gst/rtsp/gstrtspsrc.c27
-rw-r--r--gst/rtsp/gstrtspsrc.h1
3 files changed, 30 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 545855c5..4f485971 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
2007-09-26 Wim Taymans <wim.taymans@gmail.com>
+ * gst/rtsp/gstrtspsrc.c: (gst_rtspsrc_create_stream),
+ (gst_rtspsrc_handle_src_query), (gst_rtspsrc_loop_interleaved),
+ (gst_rtspsrc_loop_udp), (gst_rtspsrc_close):
+ * gst/rtsp/gstrtspsrc.h:
+ Set timestamps on RTP buffers in interleaved mode.
+ Mark first buffers with a DISCONT.
+ Remove flush hack now that sync for live sources has been figured out.
+
+2007-09-26 Wim Taymans <wim.taymans@gmail.com>
+
* gst/udp/gstudpsrc.c: (gst_udpsrc_create):
Update documentation.
diff --git a/gst/rtsp/gstrtspsrc.c b/gst/rtsp/gstrtspsrc.c
index 319f59d2..7a309303 100644
--- a/gst/rtsp/gstrtspsrc.c
+++ b/gst/rtsp/gstrtspsrc.c
@@ -556,6 +556,8 @@ gst_rtspsrc_create_stream (GstRTSPSrc * src, GstSDPMessage * sdp, gint idx)
stream->added = FALSE;
stream->disabled = FALSE;
stream->id = src->numstreams++;
+ stream->eos = FALSE;
+ stream->discont = TRUE;
/* we must have a payload. No payload means we cannot create caps */
/* FIXME, handle multiple formats. */
@@ -1358,7 +1360,7 @@ gst_rtspsrc_handle_src_query (GstPad * pad, GstQuery * query)
}
case GST_QUERY_LATENCY:
{
- /* we are live with a min latency of 0 and unlimted max latency */
+ /* we are live with a min latency of 0 and unlimited max latency */
gst_query_set_latency (query, TRUE, 0, -1);
break;
}
@@ -2448,6 +2450,15 @@ gst_rtspsrc_loop_interleaved (GstRTSPSrc * src)
/* don't need message anymore */
gst_rtsp_message_unset (&message);
+ /* set reception timestamp */
+ GST_OBJECT_LOCK (src);
+ if (GST_ELEMENT_CLOCK (src)) {
+ GstClockTime now = gst_clock_get_time (GST_ELEMENT_CLOCK (src));
+
+ GST_BUFFER_TIMESTAMP (buf) = now - GST_ELEMENT_CAST (src)->base_time;
+ }
+ GST_OBJECT_UNLOCK (src);
+
GST_DEBUG_OBJECT (src, "pushing data of size %d on channel %d", size,
channel);
@@ -2462,6 +2473,12 @@ gst_rtspsrc_loop_interleaved (GstRTSPSrc * src)
gst_buffer_set_caps (buf, stream->caps);
}
+ if (stream->discont && !is_rtcp) {
+ /* mark first RTP buffer as discont */
+ GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_DISCONT);
+ stream->discont = FALSE;
+ }
+
/* chain to the peer pad */
if (GST_PAD_IS_SINK (outpad))
ret = gst_pad_chain (outpad, buf);
@@ -2662,12 +2679,6 @@ gst_rtspsrc_loop_udp (GstRTSPSrc * src)
if (!gst_rtspsrc_open (src))
goto open_failed;
- /* flush previous state */
- gst_element_post_message (GST_ELEMENT_CAST (src),
- gst_message_new_async_start (GST_OBJECT_CAST (src), TRUE));
- gst_element_post_message (GST_ELEMENT_CAST (src),
- gst_message_new_async_done (GST_OBJECT_CAST (src)));
-
/* start playback */
if (!gst_rtspsrc_play (src))
goto play_failed;
@@ -3872,7 +3883,7 @@ gst_rtspsrc_close (GstRTSPSrc * src)
GST_RTSP_STREAM_LOCK (src);
GST_RTSP_STREAM_UNLOCK (src);
- /* no wait for the task to finish */
+ /* now wait for the task to finish */
gst_task_join (src->task);
/* and free the task */
diff --git a/gst/rtsp/gstrtspsrc.h b/gst/rtsp/gstrtspsrc.h
index 7a3b6e17..d956d7e1 100644
--- a/gst/rtsp/gstrtspsrc.h
+++ b/gst/rtsp/gstrtspsrc.h
@@ -95,6 +95,7 @@ struct _GstRTSPStream {
gboolean added;
gboolean disabled;
gboolean eos;
+ gboolean discont;
/* for interleaved mode */
guint8 channel[2];