Commit graph

410 commits

Author SHA1 Message Date
Jan Alexander Steffens (heftig)
e273e5f7a6 aacparse: When parsing raw input, accept frames of any size
Raw AAC streams might have very small frames, e.g. 6 byte frames
when encoding silence. These frames are then smaller than aacparse's
default min_frame_size of 10 bytes (ADTS_MAX_SIZE).

When passthrough is disabled or aacparse has to output ADTS, GstBaseParse
will concatenate these short frames to the following frame before
handling them to aacparse, which processes each input buffer as a single
frame, producing bad output.

To avoid this problem, set the min_frame_size to 1 when receiving a raw
stream.

https://bugzilla.gnome.org/show_bug.cgi?id=792644
2018-01-18 19:09:19 +00:00
Tim-Philipp Müller
d4c04cb079 Revert "flacparse: fix header rewriting being ignored"
This caused broken metadata and also looks a bit dodgy.
Revert until we can figure out a solution that works for
all cases and doesn't break anything.

This reverts commit adeee44b07.

https://bugzilla.gnome.org/show_bug.cgi?id=727802
https://bugzilla.gnome.org/show_bug.cgi?id=785558
2017-12-07 11:17:32 +00:00
Sebastian Dröge
b02350bd62 flacparse: Request at least the full header size when parsing headers
Otherwise baseparse will incrementally send us bigger buffers until the
full header size is reached, which is not only pointless but also means
that baseparse will reallocate and copy into a bigger buffer for every
input buffers. In pull mode that's done in 64kb increments, in push mode
usually in much smaller increments, causing a lot of overhead for
example when parsing high-quality coverart.
2017-11-29 17:28:25 +02:00
Edward Hervey
5bc5e07531 dcaparse: Really fix "usage before unmap"
Previous patch would try to unref a buffer that was pushed downstream.

Instead only unref when/if needed and keep usage of the cleanup: goto
block
2017-09-04 17:06:39 +02:00
Arun Raghavan
5cf368b36c dcaparse: Don't unmap buffer before accessing data from it
The previous patch added a check for a substream header after
gst_buffer_unmap(), which is incorrect.
2017-09-03 15:23:10 +05:30
Matej Knopp
f7854411fa dcaparse: preserve DTS HD substream 2017-09-03 15:05:08 +05:30
Sky Juan
bc290059a4 ac3parse: fix not-linked handling causing glitches when selecting stream
Fix chain function not handling not-linked from baseparse.

When an input data is separated into 2 buffers, the second buffer
would not be pushed into the adapter if baseparse returns not-linked
for first buffer.

This caused glitches when switching streams and selecting
a stream that was previously unselected.

https://bugzilla.gnome.org/show_bug.cgi?id=786268
2017-08-16 14:09:31 +01:00
vijay
810c0bb084 aacparse : Fix, Caps were not set while reusing aacparse
While reusing aacparse caps were not set.This fix enables aacparse to reuse in same pipeline.

https://bugzilla.gnome.org/show_bug.cgi?id=783027
2017-05-24 13:59:52 +02:00
Nicolas Dufresne
b68d936ae0 Remove plugin specific static build option
Static and dynamic plugins now have the same interface. The standard
--enable-static/--enable-shared toggle are sufficient.
2017-05-16 14:41:19 -04:00
Edward Hervey
9a066e548d aacparse: streamline and improve AudioSpecificConfig parsing
AudioSpecifigConfig is used in a variety of AAC streams but was
being parsed differently. Instead, make everyone use the same parsing.

* Remove unused 'bits' field (it was always set to 0 if present)
* Add proper GAConfig parsing (to know the  number of samples per frame
  if present).

Fixes wrong rate/channels configuration in streams coming from qtdemux

https://bugzilla.gnome.org/show_bug.cgi?id=780966
2017-04-06 12:04:46 +02:00
Edward Hervey
345c566552 aacparse: Handle Parametric Stereo with HE-AAC(v2)
According to ISO/IEC:14496-2:2009 , in the case of HE-AACv2 (audioObjecType
29) parametric stereo is used (a single mono track is used and then
transformations are applied to it to provide a stereo output).

We therefore report two channels in the case where there is one reported
in the audioChannelConfiguration.

Fixes the various issues where a demuxer would report two channels, but
then the parser would say there's only one channel, and then the decoder
would output two channels.
2017-04-04 18:16:39 +02:00
Tim-Philipp Müller
f26edcdf34 docs: update two references to the removed 'mad' plugin
https://bugzilla.gnome.org/show_bug.cgi?id=776140
2017-03-20 17:03:54 +00:00
Vincent Penquerc'h
f35238794c flacparse: fix playback if sample number does not start at 0
This reverts commit 29b807685d, while
fixing the original breaking tests/check/pipelines/flacdec.
2017-03-17 14:11:44 +00:00
Vincent Penquerc'h
29b807685d Revert "flacparse: fix playback if sample number does not start at 0"
This breaks gst-validate on the build server (though not locally),
and a unit test, and I can't run unit tests right now for some
unrelated reason.

This reverts commit 0747b56f8e.
2017-03-17 11:30:04 +00:00
Vincent Penquerc'h
0747b56f8e flacparse: fix playback if sample number does not start at 0
https://bugzilla.gnome.org/show_bug.cgi?id=777738
2017-03-16 14:21:20 +00:00
Michael Smith
f7b1eae3a2 sbcparse: Fix up values for allocation enumeration.
https://bugzilla.gnome.org/show_bug.cgi?id=779389
2017-03-02 11:29:25 -05:00
Sebastian Dröge
323dc466d0 mpegaudioparse: Fix compilation with gcc 7
gstmpegaudioparse.c: In function ‘gst_mpeg_audio_parse_reset’:
gstmpegaudioparse.c:209:3: error: ‘memset’ used with length equal to number of elements without multiplication by element size [-Werror=memset-elt-size]
   memset (mp3parse->xing_seek_table_inverse, 0, 256);
   ^~~~~~
gstmpegaudioparse.c: In function ‘gst_mpeg_audio_parse_handle_first_frame’:
gstmpegaudioparse.c:951:7: error: ‘memset’ used with length equal to number of elements without multiplication by element size [-Werror=memset-elt-size]
       memset (mp3parse->xing_seek_table_inverse, 0, 256);
       ^~~~~~
2017-02-27 21:01:23 +02:00
Edgard Lima
8635258046 Update Edgard Lima's email
https://bugzilla.gnome.org/show_bug.cgi?id=779230
2017-02-27 00:34:19 +00:00
Sebastian Dröge
87a2c140ca aacparse: Make sure we have enough data in the codec_data to be able to parse it
Also error out cleanly if mapping the buffer failed.

https://bugzilla.gnome.org/show_bug.cgi?id=775450
2016-12-01 13:38:52 +02:00
Vinod Kesti
f1726c7088 aacparse: assertion while converting ADTS stream to RAW
aacparse resizes input buffer while converting ADTS stream to RAW,
During buffer resize buffer write permission is not checked.
This throws gst_buffer_is_writable assertion and leads to AV sync issue some times.
It is corrected by making buffer writeable using gst_buffer_make_writable

https://bugzilla.gnome.org/show_bug.cgi?id=774129
2016-11-15 14:57:22 +02:00
Vincent Penquerc'h
adeee44b07 flacparse: fix header rewriting being ignored
https://bugzilla.gnome.org/show_bug.cgi?id=727802
2016-11-10 12:51:08 +00:00
Vincent Penquerc'h
c974df1c06 aacparse: parse a bit more of the humongous LOAS data
https://bugzilla.gnome.org/show_bug.cgi?id=769278
2016-09-06 15:09:21 +01:00
Vincent Penquerc'h
e66ee5491c aacparse: make it clear when a potential LOAS frame is not one
https://bugzilla.gnome.org/show_bug.cgi?id=769278
2016-09-06 15:09:21 +01:00
Vincent Penquerc'h
b0f20bacfd aacparse: add a few comments to anchor parsing to the spec
https://bugzilla.gnome.org/show_bug.cgi?id=769278
2016-09-06 15:09:21 +01:00
Vincent Penquerc'h
559546dd3a aacparse: improve channel/rate handling
Keep track of the last parsed channels/rate fields so they can be
used even if the element was not yet configured.

https://bugzilla.gnome.org/show_bug.cgi?id=769278
2016-09-06 15:09:21 +01:00
Vincent Penquerc'h
740749ac55 aacparse: fix varlength number reading as per spec
https://bugzilla.gnome.org/show_bug.cgi?id=769278
2016-09-06 15:09:21 +01:00
Vincent Penquerc'h
991e46ce42 aacparse: strip uneeded static arrays slack
https://bugzilla.gnome.org/show_bug.cgi?id=769278
2016-09-06 15:09:21 +01:00
Nirbheek Chauhan
b09f478e80 Add support for Meson as alternative/parallel build system
https://github.com/mesonbuild/meson

With contributions from:

Tim-Philipp Müller <tim@centricular.com>
Jussi Pakkanen <jpakkane@gmail.com> (original port)

Highlights of the features provided are:
* Faster builds on Linux (~40-50% faster)
* The ability to build with MSVC on Windows
* Generate Visual Studio project files
* Generate XCode project files
* Much faster builds on Windows (on-par with Linux)
* Seriously fast configure and building on embedded

... and many more. For more details see:

http://blog.nirbheek.in/2016/05/gstreamer-and-meson-new-hope.html
http://blog.nirbheek.in/2016/07/building-and-developing-gstreamer-using.html

Building with Meson should work on both Linux and Windows, but may
need a few more tweaks on other operating systems.
2016-08-20 11:21:12 +01:00
Tim-Philipp Müller
0f41d0e75d Revert "flacparse: Add maximum bitrate tag"
This reverts commit c703ab69f5.

https://bugzilla.gnome.org/show_bug.cgi?id=769392
2016-08-18 12:02:01 +01:00
Carlos Rafael Giani
c703ab69f5 flacparse: Add maximum bitrate tag
https://bugzilla.gnome.org/show_bug.cgi?id=769392
2016-08-02 14:34:54 +03:00
Sebastian Dröge
fd261e1099 aacparse: Reject raw AAC if no codec_data is found in the caps
If necessary, a demuxer will have to invent something here but this is only a
problem with non-conformant files anyway.
2016-07-04 16:58:38 +02:00
Vineeth TM
1071309870 good: use new gst_element_class_add_static_pad_template()
https://bugzilla.gnome.org/show_bug.cgi?id=763076
2016-03-24 14:32:20 +02:00
Sebastian Dröge
66e9e4c202 Revert "flacparse: push tags in pre_push_frame"
This reverts commit 4065fcb80a.

flacparse should not push tags by itself, the base class is going to do that
while properly merging in upstream tags. It just didn't because of a bug in
the base class, which was hidden by this commit.

https://bugzilla.gnome.org/show_bug.cgi?id=763553
2016-03-13 10:33:13 +02:00
Luis de Bethencourt
4065fcb80a flacparse: push tags in pre_push_frame
Push a tag event before pre-roll if we have tags.

https://bugzilla.gnome.org/show_bug.cgi?id=762660
2016-03-01 19:23:02 +00:00
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