Commit graph

198 commits

Author SHA1 Message Date
Matthew Waters
98249a57db gst: don't use volatile to mean atomic
volatile is not sufficient to provide atomic guarantees and real atomics
should be used instead.  GCC 11 has started warning about using volatile
with atomic operations.

https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1719

Discovered in https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/issues/868

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1073>
2021-03-19 04:20:19 +00:00
Stéphane Cerveau
5e728ee5b5 opus: allow per feature registration
Split plugin into features including
dynamic types which can be indiviually
registered during a static build.

More details here:

https://gitlab.freedesktop.org/gstreamer/gst-build/-/merge_requests/199
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/661

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1029>
2021-03-16 17:58:59 +00:00
Stéphane Cerveau
20d541368a opus: disable docs option in meson fallback
As the docs are not necessary, no need to keep it
enabled.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/943>
2020-11-26 17:37:01 +01:00
Tim-Philipp Müller
78ccc551d6 opus: add subproject fallback
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/924>
2020-11-13 15:11:03 +00:00
Mathieu Duponchelle
cc516695b0 plugins: uddate gst_type_mark_as_plugin_api() calls 2020-06-06 00:41:17 +02:00
Mathieu Duponchelle
e666c9ec04 plugins: Use gst_type_mark_as_plugin_api() for all non-element plugin types 2020-06-03 22:44:23 -04:00
Guillaume Desmottes
989bbe29d8 opusdec: add 'stats' property
Allow users to retrieve the number of samples, and their duration,
generated using PLC.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/641>
2020-04-24 14:49:05 +02:00
Ambareesh "Amby" Balaji
d7913a0d14 opusenc: Add low delay option
Fixes #681
2019-11-17 18:23:59 +00:00
Tim-Philipp Müller
289d8e53e2 Remove autotools build system 2019-10-13 14:15:43 +01:00
Thibault Saunier
27ba8d24ec doc: Port to hotdoc 2019-05-13 11:34:08 -04:00
Jordan Petridis
2229d53f60
Run gst-indent through the files
This is required before we enabled an indent test in the CI.

https://gitlab.freedesktop.org/gstreamer/gstreamer-project/issues/33
2018-11-28 05:51:53 +02:00
Marcos Kintschner
e05e8117e7 opusenc: fix segmentation fault at x86 version
The argument 0x0 is interpreted by the x86 compiler as a 32-bit int, but
it is consumed as a 64-bit uint causing a segmentation fault. We need to
explicit cast it to guint64 in order for the va_list to be built correctly.

https://bugzilla.gnome.org/show_bug.cgi?id=797092
2018-09-13 20:00:02 -04:00
Nicolas Dufresne
d2aff7b184 opusdec: Add property to control phase inversion
When enabled, phase-inversion slightly increase stereo quality, but
produce a stream that when downmixed to mono will present important
audio distortion. This patch disables this feature by default and
introduce a property that let user enable it if desired.

https://bugzilla.gnome.org/show_bug.cgi?id=791771
2018-08-01 09:45:07 -04:00
Nirbheek Chauhan
eadedc68f8 meson: Add feature options for all plugins
GL dependency detection is still automagic.

https://bugzilla.gnome.org/show_bug.cgi?id=795107
2018-07-27 18:42:11 +05:30
Xavier Claessens
201e7c7803 Meson: Generate pc file for all plugins in base
https://bugzilla.gnome.org/show_bug.cgi?id=794568
2018-04-25 11:05:56 +01:00
Tim-Philipp Müller
729b500208 opus: remove unused build variable and define 2017-12-19 12:01:32 +00:00
Mathieu Duponchelle
8598f08278 opusenc: Allow unpositioned channels.
The input will be treated as a set of mono channels,
and the channel-mapping-family will be set to 255
(no defined channel meaning)

https://bugzilla.gnome.org/show_bug.cgi?id=788720
2017-10-11 19:42:39 +02:00
Nicolas Dufresne
8e6c6266d7 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 13:42:07 -04:00
Thibault Saunier
099ac9faf2 docs: Convert gtkdoc comments to markdown
Modernizing the documentation, making it simpler to read an
modify and allowing us to possibly switch to hotdoc in the
future.
2017-03-10 18:19:17 -03:00
Vincent Penquerc'h
9121131f31 opusdec: fix 120 ms buffers being wrongly emitted
Using the max 120 ms buffer size to ensure we have enough space
for decoded data meant that Opus could actually return 120 ms'
worth of data.

https://bugzilla.gnome.org/show_bug.cgi?id=771723
2016-11-04 16:59:26 +00:00
Vincent Penquerc'h
b0866b9cc1 opusdec: interpret zero duration as unknown
This fixes missing audio when we get buffers with zero
duration, denoting unknown duration. When several such
buffers are received in a row, they're all at the same
timestamp, with zero duration.

https://bugzilla.gnome.org/show_bug.cgi?id=771723
2016-11-01 19:58:42 +02:00
Vincent Penquerc'h
a6ced9cbc8 opusdec: fix "buffer too small" error
Always supply a buffer with max size to the decoder, as we
can't really decide how many samples will be in the lost packet
based on the timestamps we get.

https://bugzilla.gnome.org/show_bug.cgi?id=771723
2016-11-01 19:58:42 +02:00
Vincent Penquerc'h
9599c3416c opusenc: remove segment stop modification on eos
https://bugzilla.gnome.org/show_bug.cgi?id=768763
2016-10-05 14:49:52 +01:00
Nirbheek Chauhan
5c4f4ac1bd 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:09:51 +01:00
Vincent Penquerc'h
6bc6b6ebbf opusdec: handle missing buffers with no duration
If buffer duration is missing, it is parsed from the packet data.
This is not foolproof, since Opus can change durations on the
fly.

https://bugzilla.gnome.org/show_bug.cgi?id=767826
2016-06-21 10:48:40 +01:00
Guillaume Desmottes
afdb7d3f32 opusenc, subtitleoverlay: use MAY_BE_LEAKED flag
Flag caps that are cached locally and will never be freed.

https://bugzilla.gnome.org/show_bug.cgi?id=767155
2016-06-02 13:11:11 +01:00
Tim-Philipp Müller
108c7d6b3c opus: use default error messages in some more cases 2016-05-23 19:28:39 +01:00
Tim-Philipp Müller
c056b99f94 opusdec: use default error message strings in more cases
Details should go into the debug message. We should probably
make up new codes for encoder/decoder lib init failures too.
2016-05-23 15:36:47 +01:00
Olivier Crête
0bfed26f56 opus: Post error message on GST_FLOW_ERROR
https://bugzilla.gnome.org/show_bug.cgi?id=766265
2016-05-19 12:27:57 -04:00
Olivier Crête
1a700c3ae6 opusdec: Use GST_AUDIO_DECODER_ERROR
This way, the first invalid stream won't break all decoding.

https://bugzilla.gnome.org/show_bug.cgi?id=766265
2016-05-18 15:25:38 -04:00
Thiago Santos
60c765174f opusdec: intersect with the filter before returning on getcaps
So upstream gets a smaller set to decide upon as it is what it requested
with the filter

https://bugzilla.gnome.org/show_bug.cgi?id=765684
2016-05-02 14:29:25 -03:00
Thiago Santos
7a5797d3a6 opusdec: improve getcaps to return all possible rates
The library is capable of converting to different rates.

Includes tests.

https://bugzilla.gnome.org/show_bug.cgi?id=765684
2016-05-02 14:29:25 -03:00
Thiago Santos
823832e293 opusdec: remove artificial restriction on rate negotiation
Remove restrictions when rate is 48000, the underlying lib supports
converting any of the input to any of the output rates.

https://bugzilla.gnome.org/show_bug.cgi?id=765684
2016-05-02 14:29:25 -03:00
Thiago Santos
b1153e0f7d opusdec: refactor getcaps repeated code into a function
Easier to read and maintain
2016-05-02 14:23:54 -03:00
Guillaume Desmottes
8d6e315b01 opusdec: fix caps leaks
The caps returned by gst_pad_get_allowed_caps() was leaked.

https://bugzilla.gnome.org/show_bug.cgi?id=765706
2016-04-28 09:18:53 +01:00
Vineeth TM
44b70ca3a1 base: use new gst_element_class_add_static_pad_template()
https://bugzilla.gnome.org/show_bug.cgi?id=763075
2016-03-24 14:25:41 +02:00
Havard Graff
461cdd8c26 opusdec: plug caps leak
https://bugzilla.gnome.org/show_bug.cgi?id=763059
2016-03-03 20:10:09 +00:00
Vincent Penquerc'h
625bd68da7 opus: fix mono<->stereo up/down-mixing
https://bugzilla.gnome.org/show_bug.cgi?id=761588
2016-02-26 16:15:20 +00:00
Tim-Philipp Müller
8b48fc1569 opusenc: remove deprecated "cbr", "audio", and "constrained-vbr" properties
They have been replaced by "audio-type" and "bitrate-type".

https://bugzilla.gnome.org/show_bug.cgi?id=756282
2016-02-26 06:51:17 +00:00
Tim-Philipp Müller
f331412a37 opus: move Opus audio decoder and encoder from -bad to -base
Hook into build system after moving history.

https://bugzilla.gnome.org/show_bug.cgi?id=756282
2016-02-26 00:20:10 +00:00
Vincent Penquerc'h
1ef601e7d3 opus: fix FEC
FEC may only be used when PLC is enabled on the audio decoder,
as it relies on empty buffers to generate audio from the next
buffer. Hooking to the gap events doesn't work as the audio
decoder does not like more buffers output than it sends.

The length of data to generate using FEC from the next packet
is determined by rounding the gap duration to nearest. This
ensures that duration imprecision does not cause quantization
to 2.5 milliseconds less than available. Doing so causes the
Opus API to fail decoding. Such duration imprecision is common
in live cases.

The buffer to consider when determining the length of audio
to be decoded is the previous buffer when using FEC, and the
new buffer otherwise. In the FEC case, this means we determine
the amount of audio from the previous buffer, whether it was
missing or not (and get the data either from this buffer, or
the current one if the previous one was missing).
2016-02-03 16:36:10 +00:00
Vincent Penquerc'h
8e9345ec86 opusdec: fix wrong buffer being checked for missing data
This caused a decoding error if the resulting (wrong) buffer size
was passed to the Opus decoding API.

https://bugzilla.gnome.org/show_bug.cgi?id=758158
2016-02-02 15:22:55 +00:00
Vineeth TM
95bf0ae2ae plugins-bad: Fix example pipelines
rename gst-launch --> gst-launch-1.0
replace old elements with new elements(ffmpegcolorspace -> videoconvert, ffenc_** -> avenc_**)
fix caps in examples

https://bugzilla.gnome.org/show_bug.cgi?id=759432
2015-12-15 10:30:49 +00:00
Reynaldo H. Verdejo Pinochet
71c2ddd07d Remove unnecessary NULL checks before g_free()
g_free() is NULL-safe
2015-11-18 16:05:42 -08:00
Luis de Bethencourt
6463ff198e opusenc: avoid potential overflow expression
The result of the two expressions will be promoted to guint64 anyway,
perform all the arithmetic in 64 bits to avoid potential overflows.

CID 1338690, CID 1338691
2015-11-12 12:29:33 +00:00
Sebastian Dröge
dd741e6412 opusdec: Update sink pad templates
We always require the channel-mapping-field. If it's 0 we require nothing
else, otherwise we need channels, stream-count and coupled count to be
available.
2015-11-05 12:11:19 +01:00
Sebastian Dröge
85984fa946 opusenc: Create an empty taglist if there is none
There always have to be 2 buffers in the streamheaders, even if
the comment buffer is basically empty.
2015-11-04 00:14:13 +02:00
Sebastian Dröge
4ca84a9b1a opus: Add proper support for multichannel audio
https://bugzilla.gnome.org/show_bug.cgi?id=757152
2015-11-03 20:35:41 +02:00
Sebastian Dröge
fc475ce01a opusdec: Handle GstAudioClippingMeta instead of the pre-skip field in the OpusHead
oggdemux is outputting the meta now, and only outputs if it should really
apply to the current buffer. Previously we would skip N samples also if we
started the decoder in the middle of the stream.

https://bugzilla.gnome.org/show_bug.cgi?id=757153
2015-11-03 20:35:41 +02:00
Sebastian Dröge
328f9088f3 opusenc: Add GstAudioClippingMeta to buffers that need to be clipped
https://bugzilla.gnome.org/show_bug.cgi?id=757153
2015-11-03 20:35:41 +02:00