Commit graph

65 commits

Author SHA1 Message Date
Thiago Santos
244f747df2 audioparsers: baseparse: Be careful to not lose the event ref
Don't unref the event if it hasn't been handled, because the caller
assumes it is still valid and might reuse it.

I ran into this problem when transcoding an AVI (with mp3 inside)
to gpp.

https://bugzilla.gnome.org/show_bug.cgi?id=639555
2011-04-08 18:07:13 +01:00
Tim-Philipp Müller
a8c854374b docs: minor baseparse docs/comment fixes
Remove copy'n'paste leftovers.
2011-04-08 18:07:13 +01:00
Mark Nauwelaerts
0bb654ed66 baseparse: increase keyframe awareness
... which is not particular relevant for audio parsing, but more so
in video cases.  In particular, auto-determine if dealing with video (caps).
2011-04-08 18:07:13 +01:00
Mark Nauwelaerts
b8af812987 baseparse: avoid unexpected stray metadata 2011-04-08 18:07:12 +01:00
Mark Nauwelaerts
24cf864c91 baseparse: use proper _NONE output value when applicable 2011-04-08 18:07:12 +01:00
Edward Hervey
1e71d31e67 audioparsers: Remove dead assignments 2011-04-08 18:07:12 +01:00
Andoni Morales Alastruey
5bfc92714e audioparse: fix possible division-by-zero
https://bugzilla.gnome.org/show_bug.cgi?id=635786
2011-04-08 18:07:12 +01:00
Mark Nauwelaerts
a45019fdd6 baseparse: use correct offset when adding index entry
... bearing in mind that BUFFER_OFFSET is media specific and may not
reflect the basic offset after having been parsed.
2011-04-08 18:07:12 +01:00
Mark Nauwelaerts
76b322a429 baseparse: enhancements for timestamp marked framed formats
That is, as such formats allow subclass to extract position from frame,
it is possible to extract duration (if not otherwise provided)
from (near) last frame, and a seek can fairly accurately target the required
position.

Fixes #631389.
2011-04-08 18:07:12 +01:00
Mark Nauwelaerts
634d4de627 baseparse: refactor frame scanning peformed by _loop 2011-04-08 18:07:12 +01:00
Mark Nauwelaerts
563f1a136b baseparse: slightly optimize sending of pending newsegment events 2011-04-08 18:07:12 +01:00
Mark Nauwelaerts
5eeb1f2e1f baseparse: minor fixes and enhancements
Arrange for upstream as well as downstream flushing when seeking.
Also determine upstream size as well as seekability.  Adjust some comments
to reality and employ debug statement in proper order.
2011-04-08 18:07:12 +01:00
Mark Nauwelaerts
ba56999212 baseparse: use only upstream duration if it provides one 2011-04-08 18:07:11 +01:00
Mark Nauwelaerts
3d72afd924 baseparse: reflow update_bitrate code
... which makes local variables represent real state better, and avoids
triggering unneeded updates/actions.
2011-04-08 18:07:11 +01:00
Mark Nauwelaerts
5aafc17dec baseparse: add some debug statements 2011-04-08 18:07:11 +01:00
Mark Nauwelaerts
2c7c4fa9e4 baseparse: perform bitrate handling and posting after newsegment sending 2011-04-08 18:07:11 +01:00
Mark Nauwelaerts
0edaf8470e baseparse: immediately post subclass provided bitrate 2011-04-08 18:07:10 +01:00
Tim-Philipp Müller
6b71b65289 Revert "baseparse: add skip property"
This reverts commit b5a3d60363.

Reverting this for now, since no one really seems to remember why this
property exists or what it could possibly be good for. It seems to have
been in the original mp3parse since the beginning of time and was back-
ported from there.
2011-04-08 18:07:09 +01:00
Sebastian Dröge
4cc901ed96 audioparser: Let the format string agree with the parameters to fix compiler warning 2011-04-08 18:07:09 +01:00
Arun Raghavan
8ef15e6247 baseparse: Fix debug output
We lose the reference to the buffer after gst_pad_push(), so the debug
print should happen before.

https://bugzilla.gnome.org/show_bug.cgi?id=622276
2011-04-08 18:07:09 +01:00
Mark Nauwelaerts
0f5f06d5fa baseparse: support reverse playback
... in pull mode or upstream driven.
2011-04-08 18:07:09 +01:00
Mark Nauwelaerts
304b3c78dd baseparse: remove done TODOs and update documentation 2011-04-08 18:07:09 +01:00
Mark Nauwelaerts
1a54736255 baseparse: use determined seekability in answering SEEKING query 2011-04-08 18:07:09 +01:00
Mark Nauwelaerts
3f02dbd3ab baseparse: add skip property 2011-04-08 18:07:08 +01:00
Mark Nauwelaerts
589c455ccb baseparse: use _set_frame_props to configure frame lead_in and lead_out
... provided a corresponding decoder with sufficient leading and following
frames to carry out full decoding for a particular segment.
2011-04-08 18:07:08 +01:00
Mark Nauwelaerts
f218b984cc baseparse: use _set_duration to configure duration update interval
... as it logically belongs there as one or the other; either subclass
can provide a duration, or an estimate must be made (reguarly updated).
2011-04-08 18:07:08 +01:00
Mark Nauwelaerts
1f7359d388 baseparse: localize use of provided fps information 2011-04-08 18:07:08 +01:00
Mark Nauwelaerts
5dd8a489d5 baseparse: seek table and accurate seek support 2011-04-08 18:07:08 +01:00
Mark Nauwelaerts
5a69aa4903 baseparse: proper and more extended segment and seek handling
That is, loop pause handling, segment seek support, newsegment for gaps, etc
2011-04-08 18:07:08 +01:00
Mark Nauwelaerts
f16146df62 baseparse: add index support 2011-04-08 18:07:08 +01:00
Mark Nauwelaerts
261b7ec15f baseparse: refactor state reset 2011-04-08 18:07:08 +01:00
Mark Nauwelaerts
2c81b3bf77 baseparse: prevent indefinite resyncing 2011-04-08 18:07:08 +01:00
Mark Nauwelaerts
de189e327f baseparse: specific EOS handling if no output so far 2011-04-08 18:07:08 +01:00
Mark Nauwelaerts
0707c189db baseparse: adjust _set_frame_prop documentation and set default as claimed 2011-04-08 18:07:07 +01:00
Mark Nauwelaerts
723059c688 baseparse: fix bitrate copy-and-paste and update heuristic 2011-04-08 18:07:07 +01:00
Mark Nauwelaerts
fea135b3de baseparse: post duration message if average bitrates is updated 2011-04-08 18:07:07 +01:00
Mark Nauwelaerts
0198d6320b baseparse: remove is_seekable vmethod and use a set_seek instead
Seekability, like duration, etc is unlikely to change (frequently), and
the default assumption covers most cases, so let subclass set when needed.
At the same time, allow subclass to indicate if it has seek-metadata (table)
available, and possibly have it provide an average bitrate.
2011-04-08 18:07:07 +01:00
Mark Nauwelaerts
30be03004e baseparse: add another hook for subclass prior to pushing buffer
... and allow subclass to perform custom segment clipping, or to
emit tags or messages at this time.
2011-04-08 18:07:07 +01:00
Mark Nauwelaerts
dc6bd085ed baseparse: 0 converts to 0 by default 2011-04-08 18:07:07 +01:00
Mark Nauwelaerts
0e60101a28 basepase: refactor conversion using helper function and export default convert 2011-04-08 18:07:07 +01:00
Mark Nauwelaerts
a84eee533f baseparse: streamline query handling 2011-04-08 18:07:07 +01:00
Mark Nauwelaerts
1c65b8287d baseparse: cleanup struct and remove unused member 2011-04-08 18:07:07 +01:00
Arun Raghavan
3448e83c73 baseparse: Allow chaining of subclass event handlers
This allows the child class to chain its event handler with
GstBaseParse, so that subclasses don't have to duplicate all the default
event handling logic.

https://bugzilla.gnome.org/show_bug.cgi?id=622276
2011-04-08 18:07:07 +01:00
Sebastian Dröge
8df3c8477a baseparse: Don't use GST_FLOW_IS_FATAL()
Also don't post an error message for UNEXPECTED and do it
for NOT_LINKED.
2011-04-08 18:07:06 +01:00
Mark Nauwelaerts
7831661c40 baseparse: non-TIME seek event is simply not handled 2011-04-08 18:07:06 +01:00
Mark Nauwelaerts
835473b792 baseparse: fix seek event ref handling 2011-04-08 18:07:06 +01:00
Mark Nauwelaerts
baefba9748 baseparse: prevent arithmetic overflows in pull mode buffer cache handling 2011-04-08 18:07:06 +01:00
Mark Nauwelaerts
a459494097 baseparse: fix seek handling
Allow a few more seek event type combinations, and really use the result
of gst_segment_set_seek to perform the seek.  Also add some debug.
2011-04-08 18:07:06 +01:00
Arun Raghavan
f7e228edb0 baseparse: Don't emit bitrate tags too early
We wait to parse a minimum number of frames (10, arbitrarily) before
emiting bitrate tags so that our early estimates are not wildly
inaccurate for streams that start with a silence. If the stream ends
before that, we just emit the tags anyway.

While it _would_ be nicer to be specify the threshold to start pushing
the tags in terms of duration, this would introduce more complexity than
this merits.

https://bugzilla.gnome.org/show_bug.cgi?id=614991
2011-04-08 18:07:06 +01:00
Sebastian Dröge
0cf1285980 baseparse: Set the last stop to the buffer starttime if the duration is invalid
...instead of not setting it at all.
2011-04-08 18:07:06 +01:00