GstBadAudio.PlanarAudioAdapter¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
None
Signals¶
- Inherited:
Fields¶
- Inherited:
Class Details¶
- class GstBadAudio.PlanarAudioAdapter(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
This class is similar to
GstBase.Adapter
, but it is made to work with non-interleaved (planar) audio buffers. Before using, an audio format must be configured withGstBadAudio.PlanarAudioAdapter.configure
()- classmethod new()¶
- Returns:
- Return type:
Creates a new
GstBadAudio.PlanarAudioAdapter
. Free withGObject.Object.unref
().
- available()¶
- Returns:
number of samples available in self
- Return type:
Gets the maximum amount of samples available, that is it returns the maximum value that can be supplied to
GstBadAudio.PlanarAudioAdapter.get_buffer
() without that function returningNone
.
- clear()¶
Removes all buffers from self.
- configure(info)¶
- Parameters:
info (
GstAudio.AudioInfo
) – aGstAudio.AudioInfo
describing the format of the audio data
Sets up the self to handle audio data of the specified audio format. Note that this will internally clear the adapter and re-initialize it.
- dts_at_discont()¶
- Returns:
The DTS at the last discont or
Gst.CLOCK_TIME_NONE
.- Return type:
Get the DTS that was on the last buffer with the
Gst.BufferFlags.DISCONT
flag, orGst.CLOCK_TIME_NONE
.
- flush(to_flush)¶
- Parameters:
to_flush (
int
) – the number of samples to flush
Flushes the first to_flush samples in the self. The caller must ensure that at least this many samples are available.
- get_buffer(nsamples, flags)¶
- Parameters:
nsamples (
int
) – the number of samples to getflags (
Gst.MapFlags
) – hint the intended use of the returned buffer
- Returns:
a
Gst.Buffer
containing the first nsamples of the adapter, orNone
if nsamples samples are not available. gst_buffer_unref() when no longer needed.- Return type:
Gst.Buffer
orNone
Returns a
Gst.Buffer
containing the first nsamples of the self, but does not flush them from the adapter. UseGstBadAudio.PlanarAudioAdapter.take_buffer
() for flushing at the same time.The map flags can be used to give an optimization hint to this function. When the requested buffer is meant to be mapped only for reading, it might be possible to avoid copying memory in some cases.
Caller owns a reference to the returned buffer. gst_buffer_unref() after usage.
Free-function: gst_buffer_unref
- offset_at_discont()¶
- Returns:
The offset at the last discont or
Gst.BUFFER_OFFSET_NONE
.- Return type:
Get the offset that was on the last buffer with the
Gst.BufferFlags.DISCONT
flag, orGst.BUFFER_OFFSET_NONE
.
- prev_dts()¶
- Returns:
The previously seen dts.
- distance:
pointer to location for distance, or
None
- Return type:
Get the dts that was before the current sample in the adapter. When distance is given, the amount of bytes between the dts and the current position is returned.
The dts is reset to
Gst.CLOCK_TIME_NONE
and the distance is set to 0 when the adapter is first created or when it is cleared. This also means that before the first sample with a dts is removed from the adapter, the dts and distance returned areGst.CLOCK_TIME_NONE
and 0 respectively.
- prev_offset()¶
- Returns:
The previous seen offset.
- distance:
pointer to a location for distance, or
None
- Return type:
Get the offset that was before the current sample in the adapter. When distance is given, the amount of samples between the offset and the current position is returned.
The offset is reset to
Gst.BUFFER_OFFSET_NONE
and the distance is set to 0 when the adapter is first created or when it is cleared. This also means that before the first sample with an offset is removed from the adapter, the offset and distance returned areGst.BUFFER_OFFSET_NONE
and 0 respectively.
- prev_pts()¶
- Returns:
The previously seen pts.
- distance:
pointer to location for distance, or
None
- Return type:
Get the pts that was before the current sample in the adapter. When distance is given, the amount of samples between the pts and the current position is returned.
The pts is reset to
Gst.CLOCK_TIME_NONE
and the distance is set to 0 when the adapter is first created or when it is cleared. This also means that before the first sample with a pts is removed from the adapter, the pts and distance returned areGst.CLOCK_TIME_NONE
and 0 respectively.
- pts_at_discont()¶
- Returns:
The PTS at the last discont or
Gst.CLOCK_TIME_NONE
.- Return type:
Get the PTS that was on the last buffer with the
Gst.BufferFlags.DISCONT
flag, orGst.CLOCK_TIME_NONE
.
- push(buf)¶
- Parameters:
buf (
Gst.Buffer
) – aGst.Buffer
to queue in the adapter
Adds the data from buf to the data stored inside self and takes ownership of the buffer.
- take_buffer(nsamples, flags)¶
- Parameters:
nsamples (
int
) – the number of samples to takeflags (
Gst.MapFlags
) – hint the intended use of the returned buffer
- Returns:
a
Gst.Buffer
containing the first nsamples of the adapter, orNone
if nsamples samples are not available. gst_buffer_unref() when no longer needed.- Return type:
Gst.Buffer
orNone
Returns a
Gst.Buffer
containing the first nsamples bytes of the self. The returned bytes will be flushed from the adapter.See
GstBadAudio.PlanarAudioAdapter.get_buffer
() for more details.Caller owns a reference to the returned buffer. gst_buffer_unref() after usage.
Free-function: gst_buffer_unref