Sebastian Dröge
c3678a5384
flacparse: Simplify frame header parsing by using lookup tables
...
Based on a patch by Felipe Contreras.
See bug #631200 .
2011-04-08 18:07:10 +01:00
Sebastian Dröge
572366e179
flacparse: Don't parse the complete FLAC frames but only look for valid frame headers
...
Thanks to Felipe Contreras for the suggestion. This is partially
based on his patches and makes flacparse more than 3.5 times faster.
Looking for valid frame headers is unlikely to give false positives
because every frame header is at least 9 bytes long, contains a
14 bit sync code and a 8 bit checksum over the first 8 bytes.
Fixes bug #631200 .
2011-04-08 18:07:10 +01:00
Sebastian Dröge
bfdc132ad0
flacparse: Really post tags only after the initial newsegment event
...
The first newsegment event will be send by the first call to
gst_base_parse_push_buffer() if necessary, posting the tags
before that is not a good idea. Instead do it from the
GstBaseParse::pre_push_buffer vfunc.
2011-04-08 18:07:09 +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
872b49efa7
flacparse: Fix uninitialized variable compiler warnings
...
These warnings are wrong, the variables are only used if they were
initialized by the bit reader.
2011-04-08 18:07:09 +01:00
Felipe Contreras
70d5346ee8
flacparse: fix picture parsing
...
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2011-04-08 18:07:09 +01:00
Sebastian Dröge
36f48450b1
flacparse: Push tags before the header buffers are pushed
2011-04-08 18:07:09 +01:00
Felipe Contreras
eaa6f789b2
flacparse: trivial caps fix
...
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
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
Sebastian Dröge
6f04047f0c
ac3parse: Use unchecked versions of the bitreader get functions
...
We didn't check the return values anyway...
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
fbbc09e47d
audioparsers: add flacparse unit test
...
... and tweak parser test helper in the process.
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
f8ec616d9d
audioparsers: add ac3parse and mpegaudioparse unit test
2011-04-08 18:07:08 +01:00
Mark Nauwelaerts
dd140c7b4d
mpegaudioparse: initial version
...
... adequately equivalent to mp3parse, so lets boldly set it
to higher rank.
2011-04-08 18:07:08 +01:00
Mark Nauwelaerts
2d482deabe
aacparse: set minimum frame size at _start
...
... rather than one time at _init.
2011-04-08 18:07:08 +01:00
Mark Nauwelaerts
edb495646d
audioparsers: refactor existing unit tests using common helper
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
10611c2826
ac3parse: remove redundant default is_seekable
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
Mark Nauwelaerts
952b27a140
audioparsers: increase ranks to enable auto-plugging
...
Because we can, and should, have some shakedown testing before having
these make it into -good later on ...
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
Edward Hervey
6bd1be78bf
check: Don't re-declare 'GList *buffers' in the tests
...
It's an external which lives in gstcheck.c. Redeclaring it makes some
compilers/architectures think the 'buffers' in the individual tests are
a different symbol... and therefore we end up comparing holodecks with
oranges.
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
00b0444618
flacparse: Optionally check the overall frame checksums too before accepting a frame as valid
...
This is optional because it's a quite expensive operation and it's very
unlikely that a non-frame is detected as frame after the header CRC check
and checking all bits for valid values. The overall frame checksums are
mainly useful to detect inconsistencies in the encoded payload.
2011-04-08 18:07:06 +01:00
Sebastian Dröge
7b10c2afce
flacparse: Check the CRC-8 of the headers before accepting a frame as valid
...
This makes false-positives during seeking much less likely and detection of
them much faster.
2011-04-08 18:07:06 +01:00