Commit graph

426 commits

Author SHA1 Message Date
Dave Craig
6cdbf40622 aacparse: Handle gst_pad_get_current_caps() returning NULL gracefully
This can happen when the pipeline is currently shutting down.

https://bugzilla.gnome.org/show_bug.cgi?id=759539
2016-02-23 18:11:42 +02:00
Tim Sheridan
205565ccd9 sbcparse: Fix frame length calculation
SBC frame length calculation wasn't being rounded up to the nearest byte
(as specified in the A2DP 1.0 specification, section 12.9). This could
cause 'stereo' and 'joint stereo' mode SBC streams to have incorrectly
calculated frame lengths.

Incorrect frame length calculation causes frame coalescing to fail, as
subsequent frames in the stream aren't found in the expected locations.

https://bugzilla.gnome.org/show_bug.cgi?id=742446
2016-01-12 21:52:12 +00:00
Reynaldo H. Verdejo Pinochet
0bb8000874 flacparse: demote warning on wrong reserved value to fixme
We are likely just parsing a backward-compatible stream we
don't fully support.
2016-01-10 22:54:12 -08:00
Tim-Philipp Müller
6dab3ece07 flacparse: don't map buffer multiple times when parsing 2016-01-07 16:24:09 +00:00
Reynaldo H. Verdejo Pinochet
ba094b50e1 flacparse: add debug msg on CRC mismatch while validating frame header 2015-12-31 16:04:15 -08:00
Reynaldo H. Verdejo Pinochet
6b7675e4a2 flacparse: drop unneeded braces at _parse_frame() exit
Additionally, drop redundant comment & line break
2015-12-31 16:04:15 -08:00
Reynaldo H. Verdejo Pinochet
b6ebad0997 flacparse: minor grammar correction 2015-12-31 16:04:15 -08:00
Reynaldo H. Verdejo Pinochet
5234c7c2bd flacparse: update URLs on pointers to online spec 2015-12-31 15:34:57 -08:00
Reynaldo H. Verdejo Pinochet
5f4317843c flacparse: make buffer DTS setting explicitly unconditional
We are setting it to PTS regardless of block_strategy
2015-12-31 14:40:15 -08:00
Reynaldo H. Verdejo Pinochet
2c14f2fff1 flacparse: add actual invalid block type to warning
For someone that read the spec is clear the only *invalid*
data block type is 127. For the rest, its useful information.

Additionally. values 7-126 are currently reserved by the
spec so the situation might change in the future.
2015-12-31 14:21:40 -08:00
Reynaldo H. Verdejo Pinochet
c43f84abf3 flacparse: use shift instead of mask & comp
We are only interested on the first bit of the first
byte of the metadata block header to figure out whether
is marked as the last one. The shift makes it quite
clearer.
2015-12-31 14:12:36 -08:00
Reynaldo H. Verdejo Pinochet
8a745837aa flacparse: warn on wishful parsing of weird headers
If we get anything from 7 to 126 as type when parsing
a metadata block header, we are likely dealing with a
FLAC stream version we don't fully understand. Issue
a warning if so.

Document function assumptions regarding the passed-on
type while at this.
2015-12-31 13:04:23 -08:00
Reynaldo H. Verdejo Pinochet
df6f0bc595 flacparse: show meaningful info on frame CRC check
As CRCs are calculated for the comparition already, we
might as well (cheaply) inform the user how the numbers
differ if a missmatched pair is found.

While at it:

Rephrase candidate-frame message to make more sense
2015-12-31 13:04:23 -08:00
Reynaldo H. Verdejo Pinochet
395afed566 flacparse: drop remaining trailing whitespace 2015-12-31 13:04:23 -08:00
Reynaldo H. Verdejo Pinochet
a086ee6192 flacparse: drop superflous else clauses 2015-12-31 13:04:23 -08:00
Reynaldo H. Verdejo Pinochet
7286aae6e5 flacparse: factor out buffer time and offset resetting
Avoids multiple occurrences of the same resetting pattern
2015-12-31 13:04:23 -08:00
Reynaldo H. Verdejo Pinochet
5bf1f1ec9c flacparse: move block handling by type out of _parse_frame() 2015-12-31 13:04:23 -08:00
Reynaldo H. Verdejo Pinochet
eb47176b7c flacparse: drop redundant return statement on _header_is_valid()
Fix the rather vague error message while at it.
2015-12-30 22:33:58 -08:00
Reynaldo H. Verdejo Pinochet
276fcc5916 flacparse: rework gst_flac_parse_frame_is_valid()
drop unnecessary nesting looking for end of frame
2015-12-30 21:43:55 -08:00
Reynaldo H. Verdejo Pinochet
90b62be301 flacparse: factor out context clearing routine 2015-12-30 21:43:45 -08:00
Dave Craig
328346ad21 audioparsers: Check for NULL return value of gst_pad_get_current_caps()
https://bugzilla.gnome.org/show_bug.cgi?id=759503
2015-12-16 10:12:44 +01:00
Edward Hervey
6888871d2a aacparse: Avoid over-skipping when checking LOAS config
There might be multiple LOAS config in a row in a full frame. The first
one might be a multi-layer config (which we can't properly parse yet)...
but then followed by a valid (single-layer) one.

The code was previously skipping whole frames (instead of just the LOAS
config we failed to read) resulting in multiple frames (seen up to 6s in
some situation) being dropped before finally getting the configuration.

https://bugzilla.gnome.org/show_bug.cgi?id=758826
2015-12-02 14:12:55 +01:00
Vineeth TM
fb7783f8b0 mpegaudioparse: Fix buffer memory leak during failures
mapped buffer is not being unmapped during failures

https://bugzilla.gnome.org/show_bug.cgi?id=756231
2015-10-12 16:56:30 +03:00
Guillaume Marquebielle
35139ee8b7 aacparse: fix uninitialized variables in LOAS config reading
On reading LOAS config, flag v=1 and vA=1 combination can occur, leading to warning
"Spec says "TBD"...". Returning TRUE on this case while parameters 'sample_rate' and
'channels' are pointing to uninitialized values can end on setting random values as
rate and channels on src caps.

https://bugzilla.gnome.org/show_bug.cgi?id=755611
2015-09-26 22:18:26 +10:00
Jan Schmidt
c919548e2c aacparse: Skip LOAS AAC until a valid config is seen.
It's normal when dropping into the middle of a stream to
not always have the config available immediately, so skip LOAS
until a valid config is seen without either setting invalid
caps or erroring out.

https://bugzilla.gnome.org/show_bug.cgi?id=751386
2015-09-16 20:51:44 +10:00
Tim-Philipp Müller
fcdb79ef7b wavpackparse: set both pts and dts so baseparse doesn't make up wrong dts after seeks
https://bugzilla.gnome.org/show_bug.cgi?id=752106
2015-09-06 16:36:47 +01:00
Tim-Philipp Müller
0d88f27108 flacparse: set both pts and dts so baseparse doesn't make up wrong dts after a seek
flac contains the sample offset in the frame header, so after a seek
without index flacparse will know the exact position we landed on and
timestamp buffers accordingly. It only set the pts though, which means
the baseparse-set dts which was set to the seek position prevails, and
since the seek was based on an estimate, there's likely a discrepancy
between where we wanted to land and where we did land, so from here on
that dts/pts difference will be maintained, with dts possibly multiple
seconds ahead of pts, which is just wrong. The easiest way to fix this
is to just set both pts and dts based on the sample offset, but perhaps
parsed audio should just not have dts set at all.

https://bugzilla.gnome.org/show_bug.cgi?id=752106
2015-09-06 16:36:44 +01:00
Tim-Philipp Müller
a39bebb5fe mpegaudioparse: use new baseparse API to fix tag handling
https://bugzilla.gnome.org/show_bug.cgi?id=679768
2015-08-16 17:21:24 +01:00
Olivier Crête
b1dfe209c2 audioparsers: use new base parse API to fix tag handling
https://bugzilla.gnome.org/show_bug.cgi?id=679768
2015-08-16 17:02:19 +01:00
Tim-Philipp Müller
a042a98159 flacparse: use new baseparse API and fix tag handling
https://bugzilla.gnome.org/show_bug.cgi?id=679768
2015-08-16 16:33:55 +01:00
Sebastian Dröge
64b06d1829 dcaparse: Don't look for a second syncword
There are streams out there that consistently contain garbage between
every frame so we never ever find a second consecutive syncword.

See https://bugzilla.gnome.org/show_bug.cgi?id=738237
2015-08-15 13:00:06 +02:00
Thiago Santos
9523fb23ed audioparsers: enable accept-template flag
Do a quick check with the pad template caps as it is enough. Users
should have figured the appropriate full caps on a previous caps query

https://bugzilla.gnome.org/show_bug.cgi?id=753623
2015-08-14 13:42:27 -03:00
Stefan Sauer
093e8f8a75 docs: remove outdated doc strings 2015-07-07 17:12:02 +02:00
Vineeth TM
e44ce40455 flacparse: fix possible memory leak
when buffer is stored to seektable, and stop gets called due to
corrupt flac file, then the seektable is not being released

https://bugzilla.gnome.org/show_bug.cgi?id=751364
2015-06-23 10:17:53 +02:00
Vineeth TM
78fcd03ca3 dcaparse: initialize size variable
size can be used in cleanup without being initialized. Hence
setting it to 0 when declaring

https://bugzilla.gnome.org/show_bug.cgi?id=751306
2015-06-22 10:58:35 +01:00
Vineeth TM
331fca4dfb mpegaudioparse: initialze bpf variable
bpf variable might be used in cleanup without being intialized.

https://bugzilla.gnome.org/show_bug.cgi?id=751306
2015-06-22 10:57:35 +01:00
Sebastian Dröge
ec82eba96b aacparse: Add support for channel configurations 11, 12 and 14 and 7 actually has 8 channels
ISO/IEC 14496-3:2009/PDAM 4 added 11, 12 and 14.
2015-06-04 16:09:41 +02:00
Guillaume Desmottes
2bd3685d04 flacparse: fix buffer leak when stored to seektable
Fix a leak with the
validate.file.playback.change_state_intensive.samples_multimedia_cx_flac_Yesterday_flac
scenario.

https://bugzilla.gnome.org/show_bug.cgi?id=749072
2015-05-08 11:11:40 +01:00
Vincent Penquerc'h
6e3835594c ac3parse: fix memory leak 2015-04-17 13:33:09 +01:00
Nicolas Huet
5ead23a14a aacparse: fix LOAS parsing issue
Fix missing index in syncword searching

https://bugzilla.gnome.org/show_bug.cgi?id=745585
2015-03-06 14:34:08 -03:00
Matej Knopp
ff5b235c32 ac3parse: request at least 8 bytes to properly parse header
https://bugzilla.gnome.org/show_bug.cgi?id=742325
2015-01-08 14:45:23 +01:00
Sebastian Dröge
f5d26af3c9 aacparse: Also only unref caps if they're not NULL 2014-12-10 11:35:29 +01:00
Sebastian Dröge
6d6c6aac13 aacparse: gst_pad_get_allowed_caps() will return NULL if there is no peer 2014-12-10 11:35:02 +01:00
Sebastian Dröge
4aac09e708 aacparse: Always set profile/level on the caps
We have the information already, so why not use it?
2014-10-26 11:47:25 +01:00
Matej Knopp
e1d275cfec aacparse: fix memory leak when prepending ADTS headers
https://bugzilla.gnome.org/show_bug.cgi?id=737761
2014-10-02 10:41:28 +03:00
Sanjay NM
323683db96 audioparsers: Added index check before using the index
https://bugzilla.gnome.org/show_bug.cgi?id=736878
2014-09-24 10:21:35 +03:00
Sebastian Dröge
91a3d044f0 flacparse: Only calculate with durations != -1 2014-09-23 22:56:21 +03:00
Ognyan Tonchev
7cd335e9b9 flacparse: do not leak uid after parsing TOC event
https://bugzilla.gnome.org/show_bug.cgi?id=736739
2014-09-17 09:51:15 +03:00
Nicolas Huet
15894c1853 aacparse: Fix parsing issue when the buffer does not have a complete ADTS/LOAS frame
https://bugzilla.gnome.org/show_bug.cgi?id=735520
2014-09-02 09:43:14 +03:00
Sebastian Dröge
638a700463 aacparse: Properly report in the CAPS query that we can convert ADTS<->RAW
https://bugzilla.gnome.org/show_bug.cgi?id=733190
2014-07-16 17:27:57 +02:00
Tim-Philipp Müller
615f6e55c1 flacparse: skip PICTURE headers without any image data
Fixes warning if the image length is 0.
2014-05-07 00:58:15 +01:00
Vincent Penquerc'h
0253db6d36 mpegaudioparse: remove dead code
A stricer check is already done earlier, and integer overflows
do not seem possible here.

Coverity 1139675
2014-04-30 17:48:53 +01:00
Vincent Penquerc'h
937269d02e flacparse: remove dead code
The block_size == 0 was shortcut earlier, and the variable is not
modified in the meantime.

Coverity 206097
2014-04-16 17:44:50 +01:00
Thiago Santos
0443c2593a Revert "aacparse: put codec data on caps for loas format"
This reverts commit e459cf3e01.

This was pushed by accident, the bug should likely be fixed in
libav https://bugzilla.libav.org/show_bug.cgi?id=644
2014-02-27 23:15:04 -03:00
Thiago Santos
e459cf3e01 aacparse: put codec data on caps for loas format
gst-libav audio decoder also needs codec data for LOAS format, otherwise
it will complain about not having a decoder config and skip all packets

https://bugzilla.gnome.org/show_bug.cgi?id=596772
2014-02-27 17:10:03 -03:00
Reynaldo H. Verdejo Pinochet
0898de65c8 aacparse: be more strict at ADTS header parsing
Adds two extra checks:

- Sampling frequency on header can't be 15.
- Frame size should be at least 9 or 7, depending
  on whether CRC protection is present.

https://bugzilla.gnome.org/show_bug.cgi?id=724638
2014-02-21 15:04:11 -03:00
Reynaldo H. Verdejo Pinochet
c3a4bb1657 aacparse: make sure we have enough ADTS data
We need at least 6 bytes to pass over to _get_frame_len()
but we were just checking for a minimum of 2 bytes for the
syncword.

https://bugzilla.gnome.org/show_bug.cgi?id=724638
2014-02-21 15:04:11 -03:00
Mark Nauwelaerts
d25a183ccc ac3parse: custom get_sink_caps handling for private stream caps
... now that those are transformed rather than parsed, some transforming
of caps is required as well to make auto-plugging succeed.
2014-01-27 20:07:41 +01:00
Vincent Penquerc'h
2ad1f20e7b Revert "aacparse: relax the detection of ADTS"
This was pushed by mistake along with the V4L2 fix.

This reverts commit 8eb4b032be.
2014-01-14 09:43:56 +00:00
Akihiro Tsukada
8eb4b032be aacparse: relax the detection of ADTS
According to ISO/IEC 13818-7, "channel_config" field in ADTS header
may have value of 0, as in the case of frame with PCE.
gst_aac_parse_detect_streams() returned FALSE for those frames
and discarded them.
2014-01-13 09:08:50 +00:00
Sebastian Dröge
2927805749 wavpackparse: Post AUDIO_CODEC tag 2013-12-16 10:03:06 +01:00
Sebastian Dröge
753d3c23a2 sbcparse: Post AUDIO_CODEC tag 2013-12-16 10:03:06 +01:00
Sebastian Dröge
05e196cbb6 flacparse: Post AUDIO_CODEC tag
https://bugzilla.gnome.org/show_bug.cgi?id=720512
2013-12-16 10:03:06 +01:00
Sebastian Dröge
29f2cae129 dcaparse: Post AUDIO_CODEC tag 2013-12-16 10:03:05 +01:00
Sebastian Dröge
d2ab5199bc amrparse: Post AUDIO_CODEC tag 2013-12-16 10:03:05 +01:00
Sebastian Dröge
6f89b430ea ac3parse: Post AUDIO_CODEC tag 2013-12-16 10:03:05 +01:00
Sebastian Dröge
b3abbe3f5e aacparse: Post AUDIO_CODEC tag 2013-12-16 10:03:05 +01:00
Sebastian Dröge
c07424a534 mpegaudioparse: Use pbutils functionality to create the AUDIO_CODEC tag 2013-12-16 10:03:05 +01:00
Wim Taymans
0d55724a2b audioparsers: don't leak template caps 2013-12-04 09:12:07 +01:00
Wim Taymans
e0a5c07e8d audioparsers: use ACCEPT_INTERSECT flag
The parser can accept input that is not completely specified. Use the
ACCEPT_INTERSECT flag on the sinkpad to tweak the acceptcaps function to
check for intersection only. This allows us to proxy downstream
constraints while still allowing non-subset caps as input.
We can then also remove the appended template caps workaround.
Make a unit-test to check the new feature.

This reverts commit 26040ee38c

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=705024
2013-12-03 22:26:44 +01:00
Wim Taymans
e3f393f7e6 audioparsers: remove fields from filter
We need to remove the fields from the filter when we can convert
between them.
2013-12-03 21:39:57 +01:00
Wim Taymans
e8313a1e70 audioparsers: refactor code to remove caps fields 2013-12-03 21:29:13 +01:00
Mark Nauwelaerts
49d52a64d6 ac3parse: correctly handle timestamps when parsing x-private1-ac3
... the way it has always worked fine in a52dec.
2013-11-11 13:35:29 +01:00
Sebastian Dröge
b95ddd55cd flacparse: Make sure we have enough data to read image tags
Thanks to iputinei for reporting this on IRC.
2013-09-12 15:39:51 +02:00
Matej Knopp
349afc633a flacparse: cleanup on error after state change
https://bugzilla.gnome.org/show_bug.cgi?id=707229
2013-09-03 18:06:18 +02:00
Matej Knopp
73751dbbe7 flacparse: Free GstBaseParseFrame if pushing a header failed 2013-09-03 10:10:49 +02:00
Sebastian Dröge
1971c43279 flacparse: Properly propagate downstream flow returns upstream
https://bugzilla.gnome.org/show_bug.cgi?id=707229
2013-09-02 11:56:33 +02:00
Chris Bass
b40bf67526 aacparse: allow conversion from raw AAC to ADTS
This patch will prepend ADTS headers to raw AAC audio frames, allowing
upstream elements to link to decoders that only support AAC in ADTS format.

Note that no error correction bits are added to ADTS frames in this code.

https://bugzilla.gnome.org/show_bug.cgi?id=615740
2013-08-13 15:58:23 +02:00
Vincent Penquerc'h
91d4abceaa aacparse: allow conversion from ADTS to raw AAC
Some muxers (eg, qtmux) only support raw AAC, so this allows linking
an encoder that outputs ADTS only to those muxers.

The conversion is simple (omit the first 7 or 9 bytes of the frame),
but has to be done in pre_push instead of handle_frame as 1.0 does
not seem to allow skipping bytes there as 0.10 used to.

Other conversions are not supported (yet).
2013-07-26 09:44:11 +01:00
Vincent Penquerc'h
55e9338846 aacparse: fix object_type parsing off-by-one in ADTS frame
According to http://wiki.multimedia.cx/index.php?title=ADTS,
the value stored in ADTS headers is one less than the object
type of the AAC stream.

A look at ffmpeg shows it also adds 1 to the value read off
the ADTS header.

Note that this might break other things that happen to have
an inverse off by one to match the existing code.
2013-07-26 09:44:10 +01:00
Matej Knopp
ae92ea21a1 aacparse: be less verbose when parsing LOAS streams
https://bugzilla.gnome.org/show_bug.cgi?id=704162
2013-07-15 07:55:08 +02:00
Tim-Philipp Müller
68ac392e8f ac3parse, dcaparse: check buffer size before trimming
and unref old buffer as soon as possible.
2013-05-04 10:08:47 +01:00
Andoni Morales Alastruey
3462282b83 dcaparse: add support for "audio/x-private1-dts" 2013-05-03 13:44:23 +02:00
Andoni Morales Alastruey
4531381541 ac3parse: add support for "audio/x-private1-ac3" 2013-05-03 13:44:23 +02:00
Sebastian Dröge
b0b0557c48 gst: Add better support for static plugins 2013-04-15 15:54:11 +02:00
Anton Belka
0f97b6f978 flacparse: add support for the toc-select event
Select tracks from the CUE sheet by sending a toc-select
event based on the uid in the TOC.

https://bugzilla.gnome.org/show_bug.cgi?id=540891
2013-03-21 00:38:48 +00:00
Tim-Philipp Müller
5240b7453c sbcparse: pack multiple frames into one output buffer
Don't output a single buffer for every tiny SBC frame
2013-03-20 00:35:17 +00:00
Sebastian Dröge
1810786083 flacparse: Fix (wrong) use of uninitialized variable compiler warning 2013-03-03 11:53:04 +01:00
Rico Tzschichholz
682e49a752 audioparsers: fix typo in noinst_headers 2013-02-04 18:38:41 +00:00
Tim-Philipp Müller
721dd1ab26 sbcparse: init some variables to avoid bogus compiler warnings 2013-01-28 11:58:50 +00:00
Mark Nauwelaerts
0777a600e3 audioparsers: sbc: fix bogus compiler warning
gst-plugins-good/gst/audioparsers/gstsbcparse.c: In function 'gst_sbc_parse_handle_frame':
gst-plugins-good/gst/audioparsers/gstsbcparse.c:210:32: error: 'ch_mode' may be used uninitialized i
2013-01-22 19:26:09 +01:00
Thijs Vermeir
16128f0234 autoparsers: use appropriate printf format for gsize 2013-01-16 14:32:56 +01:00
Tim-Philipp Müller
9f7a949773 audioparsers: add SBC audio parser
From-scratch rewrite, the bluez one was useless and broken.

https://bugzilla.gnome.org/show_bug.cgi?id=690582
2013-01-15 17:45:30 +00:00
Sebastian Dröge
c49dede772 audioparsers: Make sure the caps are actually writable before changing them 2012-12-17 15:17:12 +01:00
Sebastian Dröge
26040ee38c audioparsers: Use the peer caps for restrictions instead of the srcpad allowed caps
Otherwise we will intersect with the srcpad template caps and add all the caps fields
that the parser will ever set, no matter if downstream restricts this field or not.
This requires upstream to set this field on the caps to successfully negotiate.

https://bugzilla.gnome.org/show_bug.cgi?id=690184
2012-12-17 15:01:02 +01:00
Tim-Philipp Müller
230cf41cc9 Fix FSF address
https://bugzilla.gnome.org/show_bug.cgi?id=687520
2012-11-04 00:07:18 +00:00
Tim-Philipp Müller
7275860bdd flacparse: fix coverart extraction if vorbis comments come after picture header
See sample file for bug #684701.
2012-10-23 16:02:05 +01:00
Tim-Philipp Müller
7c41f42eec flacparse: ignore bad headers if we have a valid STREAMINFO header
If we run into any header parsing issues and we have a valid
STREAMINFO header already, don't error out, but just stop
header parsing and try to find some audio frames.

https://bugzilla.gnome.org/show_bug.cgi?id=684701
2012-10-23 13:56:54 +01:00
Tim-Philipp Müller
49cc719809 flacparse: post proper error message and fix buffer leak on header parsing error
https://bugzilla.gnome.org/show_bug.cgi?id=684701
2012-10-23 13:56:54 +01:00
Mark Nauwelaerts
a2475a40a5 flacparse: fixup 0.11 port of suspect frame checking
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=682959
2012-08-30 11:30:01 +02:00