summaryrefslogtreecommitdiff
path: root/gst
diff options
context:
space:
mode:
authorJan Schmidt <jan@centricular.com>2016-05-10 03:32:59 +1000
committerJan Schmidt <jan@centricular.com>2016-06-24 22:55:18 +1000
commit92e7e3a3bf3844942be48aced8b6107b95f2f81e (patch)
treec4ce76efdd6f86d50cd9af24941b6f738631fc6c /gst
parentafc0136137d2bef087713fdf81fc216b0455047e (diff)
downloadgstreamer-plugins-bad-92e7e3a3bf3844942be48aced8b6107b95f2f81e.tar.gz
h264parse: When input alignment=AU, always drain each packet.
If the input alignment claims AU alignment, each received buffer should contain a complete video frame, so never hold over parts of buffers for later processing. Also reduces latency, as packets are parsed/converted and output immediately instead of 1 buffer later. Fixes a problem where an (arguably disallowed) padding byte on the end of a buffer is detected as an extra byte in the following start code, and messes up the timestamping that should apply to that start code.
Diffstat (limited to 'gst')
-rw-r--r--gst/videoparsers/gsth264parse.c8
-rw-r--r--gst/videoparsers/gsth264parse.h1
2 files changed, 8 insertions, 1 deletions
diff --git a/gst/videoparsers/gsth264parse.c b/gst/videoparsers/gsth264parse.c
index e9a9ef81f..c7098d08f 100644
--- a/gst/videoparsers/gsth264parse.c
+++ b/gst/videoparsers/gsth264parse.c
@@ -1086,7 +1086,9 @@ gst_h264_parse_handle_frame (GstBaseParse * parse,
GST_LOG_OBJECT (h264parse, "resuming frame parsing");
}
- drain = GST_BASE_PARSE_DRAINING (parse);
+ /* Always consume the entire input buffer when in_align == ALIGN_AU */
+ drain = GST_BASE_PARSE_DRAINING (parse)
+ || h264parse->in_align == GST_H264_PARSE_ALIGN_AU;
nonext = FALSE;
current_off = h264parse->current_off;
@@ -1918,6 +1920,8 @@ gst_h264_parse_get_timestamp (GstH264Parse * h264parse,
g_return_if_fail (out_ts != NULL);
upstream = *out_ts;
+ GST_LOG_OBJECT (h264parse, "Upstream ts %" GST_TIME_FORMAT,
+ GST_TIME_ARGS (upstream));
if (!frame) {
GST_LOG_OBJECT (h264parse, "no frame data -> 0 duration");
@@ -2611,6 +2615,8 @@ gst_h264_parse_set_caps (GstBaseParse * parse, GstCaps * caps)
h264parse->packetized = TRUE;
}
+ h264parse->in_align = align;
+
return TRUE;
/* ERRORS */
diff --git a/gst/videoparsers/gsth264parse.h b/gst/videoparsers/gsth264parse.h
index f3eb7a5cb..c71990b12 100644
--- a/gst/videoparsers/gsth264parse.h
+++ b/gst/videoparsers/gsth264parse.h
@@ -71,6 +71,7 @@ struct _GstH264Parse
/* state */
GstH264NalParser *nalparser;
guint state;
+ guint in_align;
guint align;
guint format;
gint current_off;