summaryrefslogtreecommitdiffstats
path: root/gst
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@gmail.com>2008-01-18 17:37:03 +0000
committerWim Taymans <wim.taymans@gmail.com>2008-01-18 17:37:03 +0000
commite7c9faaeaef756df31ec353d15d2525c9323d194 (patch)
tree99e0bddb859acfbc50178c6ad2689b8e1608cd9a /gst
parent19557fc2e6b8eb5b5160540e575d51cc681d2a3d (diff)
downloadgst-plugins-bad-e7c9faaeaef756df31ec353d15d2525c9323d194.tar.gz
gst-plugins-bad-e7c9faaeaef756df31ec353d15d2525c9323d194.tar.bz2
gst-plugins-bad-e7c9faaeaef756df31ec353d15d2525c9323d194.zip
gst/h264parse/gsth264parse.c: Set timestamps more correctly.
Original commit message from CVS: * gst/h264parse/gsth264parse.c: (gst_h264_parse_flush_decode), (gst_h264_parse_queue_buffer), (gst_h264_parse_chain_reverse): Set timestamps more correctly.
Diffstat (limited to 'gst')
-rw-r--r--gst/h264parse/gsth264parse.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/gst/h264parse/gsth264parse.c b/gst/h264parse/gsth264parse.c
index 832bb49f..1dc354ec 100644
--- a/gst/h264parse/gsth264parse.c
+++ b/gst/h264parse/gsth264parse.c
@@ -475,6 +475,11 @@ gst_h264_parse_flush_decode (GstH264Parse * h264parse)
GST_BUFFER_FLAG_UNSET (buf, GST_BUFFER_FLAG_DISCONT);
}
+ if (link->i_frame)
+ GST_BUFFER_FLAG_UNSET (buf, GST_BUFFER_FLAG_DELTA_UNIT);
+ else
+ GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_DELTA_UNIT);
+
GST_DEBUG_OBJECT (h264parse, "pushing buffer %p, ts %" GST_TIME_FORMAT,
buf, GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buf)));
@@ -500,6 +505,7 @@ gst_h264_parse_queue_buffer (GstH264Parse * parse, GstBuffer * buffer)
GstNalBs bs;
GstNalList *link;
GstFlowReturn res = GST_FLOW_OK;
+ GstClockTime timestamp;
/* create new NALU link */
link = gst_nal_list_new (buffer);
@@ -507,11 +513,14 @@ gst_h264_parse_queue_buffer (GstH264Parse * parse, GstBuffer * buffer)
/* first parse the buffer */
data = GST_BUFFER_DATA (buffer);
size = GST_BUFFER_SIZE (buffer);
+ timestamp = GST_BUFFER_TIMESTAMP (buffer);
link->slice = FALSE;
link->i_frame = FALSE;
- GST_DEBUG_OBJECT (parse, "analyse buffer of size %u", size);
+ GST_DEBUG_OBJECT (parse,
+ "analyse buffer of size %u, timestamp %" GST_TIME_FORMAT, size,
+ GST_TIME_ARGS (buffer));
/* now parse all the NAL units in this buffer, for bytestream we only have one
* NAL unit but for packetized streams we can have multiple ones */
@@ -620,6 +629,7 @@ gst_h264_parse_chain_reverse (GstH264Parse * h264parse, gboolean discont,
guint start, stop, last;
guint32 code;
GstBuffer *prev;
+ GstClockTime timestamp;
GST_DEBUG_OBJECT (h264parse,
"received discont, copy gathered buffers for decoding");
@@ -658,6 +668,11 @@ gst_h264_parse_chain_reverse (GstH264Parse * h264parse, gboolean discont,
last = GST_BUFFER_SIZE (gbuf);
data = GST_BUFFER_DATA (gbuf);
+ timestamp = GST_BUFFER_TIMESTAMP (gbuf);
+
+ GST_DEBUG_OBJECT (h264parse,
+ "buffer size: %u, timestamp %" GST_TIME_FORMAT, last,
+ GST_TIME_ARGS (timestamp));
while (last > 0) {
GST_DEBUG_OBJECT (h264parse, "scan from %u", last);
@@ -673,6 +688,8 @@ gst_h264_parse_chain_reverse (GstH264Parse * h264parse, gboolean discont,
* decode queue. */
decode = gst_buffer_create_sub (gbuf, start, last - start);
+ GST_BUFFER_TIMESTAMP (decode) = timestamp;
+
/* see what we have here */
res = gst_h264_parse_queue_buffer (h264parse, decode);