Rework the audio caps similar to the video caps. Remove
width/depth/endianness/signed fields and replace with a simple string
format and media type audio/x-raw.
Create a GstAudioInfo and some helper methods to parse caps.
Remove duplicate code from the ringbuffer and replace with audio info.
Use AudioInfo in the base audio filter class.
Port elements to new API.
This allows subclasses to provide a "payload" function to prepare
buffers for consumption. The immediate use for this is for sinks that
can handle compressed formats - parsers are directly connected to the
sink, and for formats such as AC3, DTS, and MPEG, IEC 61937 patyloading
might be used.
API: GstBaseAudioSinkClass:payload()
https://bugzilla.gnome.org/show_bug.cgi?id=642730
Given a large enough drift-tolerance, one could end up in a situation
where one would keep aligning the written buffers behind the current
read-segment position. The result for the reader would be complete
silence, possible preceded by very choppy audio.
By checking the available headroom, one can determine if there is
room to do alignment, or if one should resort to a resync instead to get
the pointers back on track.
Also refactor the alignment-logic out of the render function for cleaner
code.
Commit ba2e500bd9 ensured to provide
a running clock when EOS had finished rendering. However,
other measures are needed (and were in place before) to ensure a
running clock when EOS still needs rendering (i.e. waiting).
So, specifically, re-introduce eos_rendering removed in aforementioned commit,
this time as a public variable so subclasses can be aware of the situation.
Fixes (part of) #645961.
API: GstBaseAudioSink:eos_rendering
Observed a case where the sink went to null-state during the query,
hence the ringbuffer-pointer was NULL, causing a crash.
Moving the ringbuffer-check code until after the query, and hold the
lock during the check and while using the spec-values. It should not matter
to the query wether the ringbuffer is present or not, and it actually
gets a time bit more time to get the ringbuffer set up in this case!
Fixes#635231
So run-time bindings can introspect the names correctly (we abuse this
field as description field only in elements, not for public API
(where the description belongs into the gtk-doc chunk).
https://bugzilla.gnome.org/show_bug.cgi?id=629746
Don't take an extra ref on the sink and source because that creates a reference
cycle. Instead, use the invalidate method of the clock when the sink and source
are freed. This way, we don't call into the time function anymore after the
objects are disposed.
This reverts commit cea2644ed8.
Many audio sink assume that they can create a clock in
the instance init function and it will be there forever
and not be cleared by the state change functions.
Increase default drift tolerance to 40ms to avoid glitches with decoders
or formats where there's a lot of timestamp jitter for some reason or
another (in this case: asf/wma), at least until we implement timestamp
smoothing.
Our calibration against the pipeline clock is done with the adjusted
ringbuffer time, so take the adjustement into account. Fixes some audio dropouts
when reusing audio sinks after switching clocks and slaving methods in a
pipeline.
When we are calibrating the internal clock against the external clock take into
account the time offset applied to our internal clock because we will subtract
that in the render_function again.
Add drift-tolerance property (defaulting to 20ms) to handle resync after clock
drift or timestamp drift instead of relying on the latency-time value for clock
drift and 500ms for timestamp drift.
Remove warning about discont timestamp and simply resync. The warning is in some
cases not correct and is triggered more frequently now that we lower the
tolerance value.
There's not much point in using GST_DEBUG_FUNCPTR with GObject
virtual functions such as get_property, set_propery, finalize and
dispose, since they'll never be used by anyone anyway. Saves a
few bytes and possibly a sixteenth of a polar bear.
Check for pulsesink < 0.10.17 because it includes code that is now included in
baseaudiosink. Disable that code in baseaudiosink to be compatible with the
older version.