Commit graph

86 commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
b3abbe3f5e aacparse: Post 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
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
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
4bb52bbadf docs: gst-launch -> gst-launch-1.0 and ffmpegcolorspace -> videoconvert 2012-08-27 21:20:30 +01:00
Edward Hervey
538c131b37 aacparse: Reset parser when we have caps without codec_data
This ensures the detection (and proper downstream caps settings) will
actually happen when we have new incoming caps without codec_data.

This was easily triggered by streams from matroskademux which initially
provided caps with a constructed codec_data, but then pushed new caps
without the codec_data once it detected the stream was adts.
2012-07-24 12:24:43 +02:00
Mark Nauwelaerts
400bdee601 aacparse: perform additional sanity check before confirming ADTS format
... and tweak confusing debug message.
2012-07-06 15:29:37 +02:00
Mark Nauwelaerts
986286a8ea aacparse: remove unhelpful stray debug message 2012-07-06 15:29:28 +02:00
Sebastian Dröge
ca4b5d795b audioparsers: Fix GstBaseParse::get_sink_caps() implementations
They should take the filter caps into account and always return
the template caps appended to the actual caps. Otherwise the
parsers stop to accept unparsed streams where upstream does not
know about channels, rate, etc.

Fixes bug #677401.
2012-06-05 09:21:08 +02:00
Edward Hervey
ba7569028c audioparsers: Check return value of GstBitReader/GstByteReader 2012-04-12 15:47:24 +02:00
Tim-Philipp Müller
e09ae5736d Use new gst_element_class_set_static_metadata() 2012-04-10 00:51:41 +01:00
Mark Nauwelaerts
d6cc68a9f7 audioparsers: use sink pad template caps rather than src 2012-03-22 18:27:30 +01:00
Wim Taymans
756948262c fix template caps refcount 2012-03-10 10:52:01 +01:00
Wim Taymans
6b2998d5b7 aacparse: remove some unused declarations 2012-02-15 12:41:43 +01:00
Mark Nauwelaerts
1ae32656ae audioparsers: adjust to modified baseparse API 2012-02-13 18:27:53 +01:00
Mark Nauwelaerts
207f520bbd aacparse: correctly set ADIF src caps 2012-02-09 22:10:11 +01:00
Wim Taymans
3a095a26b2 aacparse: fix srcpad caps handling 2012-02-03 16:14:08 +01:00
Wim Taymans
583d39dd8d update for new memory API 2012-01-25 12:30:28 +01:00
Sebastian Dröge
93e3ed5a86 Merge branch 'master' into 0.11
Conflicts:
	ext/cairo/gsttextoverlay.c
	ext/pulse/pulseaudiosink.c
	gst/audioparsers/gstaacparse.c
	gst/avi/gstavimux.c
	gst/flv/gstflvmux.c
	gst/interleave/interleave.c
	gst/isomp4/gstqtmux.c
	gst/matroska/matroska-demux.c
	gst/matroska/matroska-mux.c
	gst/matroska/matroska-mux.h
	gst/matroska/matroska-read-common.c
	gst/multifile/gstmultifilesink.c
	gst/multipart/multipartmux.c
	gst/shapewipe/gstshapewipe.c
	gst/smpte/gstsmpte.c
	gst/udp/gstmultiudpsink.c
	gst/videobox/gstvideobox.c
	gst/videocrop/gstaspectratiocrop.c
	gst/videomixer/videomixer.c
	gst/videomixer/videomixer2.c
	gst/wavparse/gstwavparse.c
	po/ja.po
	po/lv.po
	po/sr.po
	tests/check/Makefile.am
	tests/check/elements/qtmux.c
	tests/check/elements/rgvolume.c
2012-01-10 14:32:32 +01:00
Oleksij Rempel (Alexey Fisher)
4f98b4ec85 ac3parse: remove unused variable
remove unused variable to fix compile error:
make -C audioparsers
make[3]: Betrete Verzeichnis '/home/lex/tmp/gst-plugins-good/gst/audioparsers'
  CC     libgstaudioparsers_la-gstaacparse.lo
gstaacparse.c: In function 'gst_aac_parse_read_loas_audio_specific_config':
gstaacparse.c:446:12: error: variable 'sbr' set but not used [-Werror=unused-but-set-variable]
cc1: all warnings being treated as errors

Signed-off-by: Oleksij Rempel (Alexey Fisher) <bug-track@fisher-privat.net>
2011-12-21 13:16:44 +00:00
Vincent Penquerc'h
16a4c596eb aacparse: parse LOAS variant
The LOAS variant seems to have three different subvariants itself,
only one of them is implemented as my two samples happen to be
using that one.
The sample rate is not always reported correctly, as the "main"
sample rate is apparently sometimes half what it should be (both
of my samples report 24000 Hz there), and there are two other
parts of the subvariant with different sampling rates. One of them
is parsed, but not the other, as it's located after some other
large amount of variable data that needs parsing first, and there
seems to be a LOT of it, which is useless for our needs here.
This ends up being rather inconsequential, as ffdec_aac_latm,
which is the only decoder that can decode such streams, does not
need the sample rate on the caps anyway.

https://bugzilla.gnome.org/show_bug.cgi?id=665394
2011-12-19 11:39:44 +00:00
Vincent Penquerc'h
c0e101e93f various: fix pad template leaks
https://bugzilla.gnome.org/show_bug.cgi?id=662664
2011-11-28 13:30:27 +00:00
Tim-Philipp Müller
be0d6baac5 Merge remote-tracking branch 'origin/master' into 0.11
Conflicts:
	ext/pulse/pulseaudiosink.c
	ext/pulse/pulsesrc.c
	gst/audioparsers/gstaacparse.c
	gst/audioparsers/gstamrparse.c
	gst/audioparsers/gstdcaparse.c
	gst/audioparsers/gstflacparse.c
	gst/effectv/gstradioac.c
	gst/effectv/gstradioac.h
	gst/effectv/gstripple.c

Some possible FIXMEs remaining in the audio parser getcaps functions.
2011-11-26 13:34:10 +00:00
Sebastian Dröge
6204464735 audioparse: Use the sinkpad template caps as fallback, not the srcpad ones 2011-11-24 10:25:02 +01:00