Commit graph

1417 commits

Author SHA1 Message Date
Sebastian Dröge d3a35870a2 audio: const gpointer is not the same as gconstpointer/const void *
See https://bugzilla.gnome.org/show_bug.cgi?id=664491
2018-11-05 08:16:16 +00:00
Seungha Yang 3499d9ea64 meson: Replace empty configuration_data() with copy keyword
Use 'copy' keyword to avoid meson warning message.
Note that 'copy' keyword in configure_file() is available
since meson 0.47.0

https://bugzilla.gnome.org/show_bug.cgi?id=797298
2018-10-17 13:48:47 +01:00
Nirbheek Chauhan d002cd33d3 gstaudioutilsprivate: Fix warnings while setting thread priority
Also use G_OS_WIN32 instead of _WIN32 for clarity.
2018-09-24 19:44:28 +05:30
Tim-Philipp Müller dc29bc4e13 libs: fix API export/import and 'inconsistent linkage' on MSVC
For each lib we build export its own API in headers when we're
building it, otherwise import the API from the headers.

This fixes linker warnings on Windows when building with MSVC.

The problem was that we had defined all GST_*_API decorators
unconditionally to GST_EXPORT. This was intentional and only
supposed to be temporary, but caused linker warnings because
we tell the linker that we want to export all symbols even
those from externall DLLs, and when the linker notices that
they were in external DLLS and not present locally it warns.

What we need to do when building each library is: export
the library's own symbols and import all other symbols. To
this end we define e.g. BUILDING_GST_FOO and then we define
the GST_FOO_API decorator either to export or to import
symbols depending on whether BUILDING_GST_FOO is set or not.
That way external users of each library API automatically
get the import.

While we're at it, add new GST_API_EXPORT in config.h and use
that for GST_*_API decorators instead of GST_EXPORT.

The right export define depends on the toolchain and whether
we're using -fvisibility=hidden or not, so it's better to set it
to the right thing directly than hard-coding a compiler whitelist
in the public header.

We put the export define into config.h instead of passing it via the
command line to the compiler because it might contain spaces and brackets
and in the autotools scenario we'd have to pass that through multiple
layers of plumbing and Makefile/shell escaping and we're just not going
to be *that* lucky.

The export define is only used if we're compiling our lib, not by external
users of the lib headers, so it's not a problem to put it into config.h

Also, this means all .c files of libs need to include config.h
to get the export marker defined, so fix up a few that didn't
include config.h.

This commit depends on a common submodule commit that makes gst-glib-gen.mak
add an #include "config.h" to generated enum/marshal .c files for the
autotools build.

https://bugzilla.gnome.org/show_bug.cgi?id=797185
2018-09-24 08:45:34 +01:00
Nirbheek Chauhan 1733233060 gstaudiosrc/sink: Set audio ringbuffer thread priority
On Windows, the ringbuffer thread function must have the "Pro Audio"
priority set, otherwise it sometimes doesn't get scheduled for
200-300ms, which will immediately cause an underrun unless you set
a very high latency-time and buffer-time.

This has no compile-time deps since it tries to load avrt.dll at
runtime to set the thread priority.
2018-09-11 00:41:59 +05:30
Nirbheek Chauhan a9cab426d0 meson: Maintain macOS ABI through dylib versioning
Requires Meson 0.48, but the feature will be ignored on older versions
so it's safe to add it without bumping the requirement.

Documentation:
https://github.com/mesonbuild/meson/blob/master/docs/markdown/Reference-manual.md#shared_library
2018-08-31 14:40:43 +05:30
Tim-Philipp Müller 4906ec8c13 audio: use right export decorator 2018-08-26 11:16:10 +02:00
Sebastian Dröge 0bf207aa53 audioaggregator: Also run the audio-specific caps fixation for audio aggregator subclasses that can't convert 2018-08-16 18:03:37 +03:00
Sebastian Dröge 320243050b audioaggregator: Fixate to some meaningful values if no sinkpad is configured yet
The default caps fixation code would select a rate of 1 for example,
which is not really ideal.
2018-08-16 18:00:24 +03:00
Sebastian Dröge 1b6eed694c audioaggregator: Properly propagate caps negotiation failures
Otherwise we'll end up doing a division by zero when clipping buffers,
and might even accept buffers for which we don't know the caps.

https://bugzilla.gnome.org/show_bug.cgi?id=796951
2018-08-14 10:24:33 +03:00
Tim-Philipp Müller ca15315565 gst-libs: include config.h in all source files
This will be needed later when we get our export define from config.h
2018-08-13 09:23:34 +01:00
Bastian Köcher efa9bdccf9 meson: fix install dir for generated header files
Nixos installs into a non-standard includedir, so need
to take account of the 'includedir' option instead of
just hard-coding 'include' here.

https://bugzilla.gnome.org/show_bug.cgi?id=794856
2018-08-10 12:43:38 +01:00
George Kiagiadakis ab2548d78d audio-buffer: fix typo in assignment that causes buggy behavior 2018-07-24 15:09:25 +03:00
George Kiagiadakis 0ce20cef4f gstaudiodecoder: take into account GstAudioMeta::samples on the output buffers
This is useful if the output buffers are planar and have extra padding
on each plane, in which case size/bpf does not represent the number of
valid samples.

https://bugzilla.gnome.org/show_bug.cgi?id=705977
2018-07-23 15:27:08 +03:00
George Kiagiadakis 2d38d2f1d3 gstaudiodecoder: do not aggregate output if buffers are planar
Aggregation will break the layout, as it concatenates buffers,
and fixing it here would be much more inefficient than configuring
the actual decoder implementation to output larger buffers.

https://bugzilla.gnome.org/show_bug.cgi?id=705977
2018-07-23 15:27:08 +03:00
George Kiagiadakis e1bc49923f libs: audio: implement planar buffer support in gst_audio_buffer_reorder_channels()
https://bugzilla.gnome.org/show_bug.cgi?id=796743
2018-07-12 13:38:27 +03:00
George Kiagiadakis b33d70e97f libs: audio: add a new gst_audio_buffer_truncate() function
Essentially this moves the truncation logic out of gst_audio_buffer_clip()
so that it can be used in other places, like in audiorate.

https://bugzilla.gnome.org/show_bug.cgi?id=796740
2018-07-12 12:08:10 +03:00
George Kiagiadakis 9cb09e7269 libs: audio: implement support for non-interleaved audio in gst_audio_buffer_clip()
https://bugzilla.gnome.org/show_bug.cgi?id=796740
2018-07-12 11:59:06 +03:00
George Kiagiadakis 060ecd16cd libs: audio-converter: complete code to support non-interleaved audio buffers
https://bugzilla.gnome.org/show_bug.cgi?id=705986
2018-07-11 16:26:13 +03:00
George Kiagiadakis eefdf32d96 libs: audio-resampler: add support for consuming non-interleaved input buffers
https://bugzilla.gnome.org/show_bug.cgi?id=705986
2018-07-11 16:26:13 +03:00
George Kiagiadakis 108a911610 libs: audio-channel-mixer: add support for non-interleaved audio buffers
https://bugzilla.gnome.org/show_bug.cgi?id=705986
2018-07-11 16:26:13 +03:00
George Kiagiadakis c946e323f6 libs: audio: Implement GstAudioBuffer & GstAudioMeta
Library bits to support non-interleaved audio

https://bugzilla.gnome.org/show_bug.cgi?id=751605
2018-07-03 14:06:43 +03:00
wangzq 9f51607723 audiobasesrc: Round down segsize to an integer number of samples
https://bugzilla.gnome.org/show_bug.cgi?id=796704
2018-06-29 07:38:20 +02:00
Tim-Philipp Müller fae8c24590 audio: Update for g_type_class_add_private() deprecation in recent GLib
https://gitlab.gnome.org/GNOME/glib/merge_requests/7
2018-06-23 21:49:48 +02:00
Thomas Bluemel 7d3c098a7c audiobasesink: Improve clock skew corrections.
The external time should be moved only as much as needed
to get back to the ideal center point, so that the clock
is still allowed to drift both directions after the correction.
This reduces excessive back and forth corrections that were
caused by the assumption of a linear drift.

https://bugzilla.gnome.org/show_bug.cgi?id=788006
2018-06-06 16:11:45 -04:00
Mark Nauwelaerts 751e9640f9 audio: fix some GIR array annotations 2018-05-21 09:18:35 +02:00
Antoine Jacoutot c765649505 libs: g-ir-scanner: do not hardcode libtool path
https://bugzilla.gnome.org/show_bug.cgi?id=726571
2018-05-18 13:41:25 +02:00
Olivier Crête 8583f17e62 audioaggregator: Remove custom get_next_time implementation
GstAggregator now offers  same thing in a common implementation.

https://bugzilla.gnome.org/show_bug.cgi?id=795486
2018-05-16 22:22:29 +02:00
Sebastian Dröge 5b736d2c7a audioaggregator: Update converters after updating with the new audioinfo/caps
Otherwise subclasses might accidentially use the old audioinfo/caps.
None of the subclasses currently uses the audioinfo/caps, but future
subclasses might.

https://bugzilla.gnome.org/show_bug.cgi?id=795827
2018-05-05 16:40:32 +02:00
Mark Nauwelaerts 9a360a47bf audio: fix some GIR annotations
Mostly related to out and array parameters
2018-04-23 19:33:19 +02:00
Mathieu Duponchelle 83939c81e7 audioaggregator: fix filtered getcaps
In the situation described in
https://bugzilla.gnome.org/show_bug.cgi?id=795397,

downstream_caps consists of two structures, the first with
the preferred rate, if at all possible (44100), the second
containing the full range of allowed rates, as audioresample
correctly tries to negotiate passthrough caps.

As audioaggregator cannot perform rate conversion, it wants
to return a fixated rate in its getcaps implementation,
however it previously directly used the first structure in
the caps allowed downstream, without taking the filter into
consideration, to determine the rate to fixate to.

With this, we first intersect our downstream caps with the
filter, in order not to fixate to an unsupported rate.
2018-04-23 17:13:22 +02:00
Mathieu Duponchelle a59fbba141 audioaggregator: unref converted buffer after gst_buffer_replace 2018-04-13 01:07:21 +02:00
Nirbheek Chauhan b5698995f1 audiobasesrc: posting errors should be always be safe
Don't try to signal an error in the ringbuffer if it hasn't been
allocated yet.

https://bugzilla.gnome.org/show_bug.cgi?id=794611
2018-04-09 17:25:32 +05:30
Nirbheek Chauhan baadc3b302 audioringbuffer: Don't spam INFO for every buffer
This makes GST_DEBUG=4 outputs too spammy, and such frequent messages
are meant to go into DEBUG or TRACE anyway.
2018-04-07 11:09:58 +05:30
Edward Hervey 22c9e5f7c1 libs: Documentation cleanup
* Fix wrong naming, wrong types and typos
* Add missing sections
* Add missing documentation for entries
* Explicitely mark private structure entries
* Remove items that never existed
2018-04-02 08:53:28 +02:00
Edward Hervey a034018a75 audio-aggregator: Check return values
And copy over already-parsed information

CID #1427140
2018-03-23 14:25:21 +01:00
Alessandro Decina 345aa2cd9e meson: libs: use gnome.mkenums_simple() to generate enumtypes files
This way we no longer need custom wrapper scripts or template files.
2018-03-22 13:15:35 +00:00
Sebastian Dröge b058de9d90 audiostreamalign: Mark the whole type as new in 1.14 2018-03-15 09:58:11 +02:00
Tim-Philipp Müller 98a8d7eaf5 meson: install new audio-prelude.h 2018-03-13 13:49:57 +00:00
Tim-Philipp Müller 371e3e460a audio: GST_EXPORT -> GST_AUDIO_API
We need different export decorators for the different libs.
For now no actual change though, just rename before the release,
and add prelude headers to define the new decorator to GST_EXPORT.
2018-03-13 10:36:56 +00:00
Mathieu Duponchelle e9be107e4a audioaggregator: fix channel-mask negotiation
When outputting more than two channels, a channel-mask has to be
specified in the output caps.

We follow the same heuristic as other cases, when downstream
does not specify a channel-mask, we use that of the first
configured pad, and if there was none we generate a fallback
mask.

https://bugzilla.gnome.org/show_bug.cgi?id=794257
2018-03-12 17:35:53 +01:00
Thibault Saunier e916ef08fd audio: Add audioaggregator.h in audio.h 2018-03-11 12:13:32 -03:00
Mathieu Duponchelle 22981e8a42 Port to latest GstAggregator segment API
The aggregator segment is now exposed on the src pad

https://bugzilla.gnome.org/show_bug.cgi?id=793944
2018-03-01 15:33:25 +01:00
Mathieu Duponchelle 318eb61e23 audioaggregator: remove GstAudioAggregator->info
As we now require subclasses to use a subclass of
GstAudioAggregatorPad, we can reuse its info field

https://bugzilla.gnome.org/show_bug.cgi?id=793943
2018-03-01 15:33:25 +01:00
Mathieu Duponchelle 10835e9919 audioaggregator: refactor conversion API
For the rationale, see:

https://bugzilla.gnome.org/show_bug.cgi?id=793917

Also test audiomixer conversion of current output buffer
2018-03-01 00:40:24 +01:00
Sebastian Dröge fae7f790be audioaggregator: Document that the pad's audio info is read-only and needs the object lock
Also fix indentation in the header a bit.
2018-02-28 15:23:25 +02:00
Mathieu Duponchelle 06ae49f525 audio-converter: fix declaration-after-statement 2018-02-15 21:08:08 +01:00
Mathieu Duponchelle 9cf4293bde audio-converter: add a convenience conversion method
This is useful from python bindings

https://bugzilla.gnome.org/show_bug.cgi?id=793492
2018-02-15 20:51:30 +01:00
Mathieu Duponchelle 6a4a82f355 gst_audio_converter_new: update annotations
https://bugzilla.gnome.org/show_bug.cgi?id=793492
2018-02-15 20:51:30 +01:00
Mathieu Duponchelle 9046e6001b AudioConverter: register as boxed type
https://bugzilla.gnome.org/show_bug.cgi?id=793492
2018-02-15 20:51:30 +01:00