Since we started depending on GLib 2.44, we can be sure this macro is
defined (it will be a no-op on compilers that don't support it). For
plugins we should just start using `G_DECLARE_FINAL_TYPE` which means we
no longer need the macro there, but for most types in base/gst-libs we
don't want to break ABI, which means it's better to just keep it like it
is (and use the `#ifdef` instead).
This allows us to output audio samples without discarding
any input frames, which is useful for some formats/codecs
(e.g. the MonkeysAudio decoder implementation in ffmpeg
which will might return e.g. 16 output buffers for an
input buffer for certain files).
In the past decoder implementations just concatenated
the returned audio buffers until a full frame had been
decoded, but that's no longer possible to do efficiently
when the decoder returns audio samples in non-interleaved
layout.
Allowing subframes to be output before the entire input
frame is decoded can also be useful to decrease startup
latency/delay.
https://gitlab.freedesktop.org/gstreamer/gst-libav/issues/49
This patch adds API in the audio decoder base class for setting the arbitrary
caps on the source pad. Previously only caps converted from audio info were
possible. This is particularly useful when subclass wants to set caps features
for audio decoder producing metadata.
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.
Since the allocation query caps contains memory size and the pad's caps
contains the display size, an audio encoder or decoder might need to allocate
a different buffer size than the size negotiated in the caps.
This patch splits this logic distinction for audiodecoder and audioencoder.
Thus the user, if needs a different allocation caps, should set it through
gst_audio_{encoder,decoder}_set_allocation_cap() before calling the negotiate()
vmethod. Otherwise the allocation_caps will be the same as the caps in the
src pad.
https://bugzilla.gnome.org/show_bug.cgi?id=764421
Apparently I forgot how gobject works, there is no need to expose
it directly as one can call it from the parent_class pointer
This reverts commit 8a64592481.
Add gst_audio_decoder_set_use_default_pad_acceptcaps() to allow
subclasses to make videodecoder use the default pad acceptcaps
handling instead of resorting to the caps query that is, usually,
less efficient and unecessary
API: gst_audio_decoder_set_use_default_pad_acceptcaps
Subclasses can use it to select what queries they want to handle
and forward the rest to the default handling function.
API: gst_audio_decoder_sink_query_default
https://bugzilla.gnome.org/show_bug.cgi?id=753623
Allows subclasses to do custom caps query replies.
Also exposes the standard caps query handler so subclasses can just
extend on top of it instead of reimplementing the caps query proxying.
Sometimes the decoder would use the allocator for something else than just
allocating output buffers, for example, querying different parameters.
This patch expose a getter accessor for the negotiated memory allocator.
... so subclass can also rely upon never being bothered with some NULL buffer
it can't do any interesting with, or with any data before it received
any format configuration (and setup properly).
Whereas the previous default 0 was backwards compatible in that it lead
to erroring out immediately upon any error, elements that are really
ported and using the base class error macro can be assumed to intend to
improve behaviour rather than maintaining the old one. So, make it easy
on those and any future one and tolerate some errors by default, as intended.
Fixes#666579.