diff options
author | Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk> | 2011-01-10 17:07:38 +0100 |
---|---|---|
committer | Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk> | 2011-01-28 12:16:57 +0100 |
commit | 2c872ad91329862e65a4ce7b4fb48ecfacf369b3 (patch) | |
tree | 70a6540004c0da9f2ca6b984107f4bec80ec607c | |
parent | 6a45c4f65ecde09cfd995e3439203a76734561fc (diff) |
baseparse: provide some more initial frame metadata in parse_frame
... and document accordingly.
-rw-r--r-- | gst/audioparsers/gstbaseparse.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/gst/audioparsers/gstbaseparse.c b/gst/audioparsers/gstbaseparse.c index a4505c197..ac9d7f2e1 100644 --- a/gst/audioparsers/gstbaseparse.c +++ b/gst/audioparsers/gstbaseparse.c @@ -93,7 +93,10 @@ * frame contents and setting the caps, and buffer metadata (e.g. * buffer timestamp and duration, or keyframe if applicable). * (although the latter can also be done by GstBaseParse if it is - * appropriately configured, see below). + * appropriately configured, see below). Frame is provided with + * timestamp derived from upstream (as much as generally possible), + * duration obtained form configuration (see below), and offset + * if meaningful (in pull mode). * </para></listitem> * <listitem><para> * Finally the buffer can be pushed downstream and parsing loop starts @@ -1469,6 +1472,9 @@ gst_base_parse_handle_and_push_frame (GstBaseParse * parse, GST_BUFFER_OFFSET (buffer), GST_BUFFER_OFFSET (buffer), GST_BUFFER_SIZE (buffer)); + /* use default handler to provide initial (upstream) metadata */ + gst_base_parse_parse_frame (parse, frame); + /* store offset as it might get overwritten */ offset = GST_BUFFER_OFFSET (buffer); ret = klass->parse_frame (parse, frame); @@ -1504,7 +1510,8 @@ gst_base_parse_handle_and_push_frame (GstBaseParse * parse, } } - /* re-use default handler to add missing metadata as-much-as-possible */ + /* again use default handler to add missing metadata; + * we may have new information on frame properties */ gst_base_parse_parse_frame (parse, frame); if (GST_BUFFER_TIMESTAMP_IS_VALID (buffer) && GST_BUFFER_DURATION_IS_VALID (buffer)) { |