GstPlanarAudioAdapter
This class is similar to GstAdapter, but it is made to work with
non-interleaved (planar) audio buffers. Before using, an audio format
must be configured with gst_planar_audio_adapter_configure
gst_planar_audio_adapter_available
gsize
gst_planar_audio_adapter_available (GstPlanarAudioAdapter * adapter)
Gets the maximum amount of samples available, that is it returns the maximum
value that can be supplied to gst_planar_audio_adapter_get_buffer without
that function returning NULL.
Returns
–
number of samples available in adapter
GstBadAudio.PlanarAudioAdapter.prototype.available
function GstBadAudio.PlanarAudioAdapter.prototype.available(): {
}
Gets the maximum amount of samples available, that is it returns the maximum
value that can be supplied to GstBadAudio.PlanarAudioAdapter.prototype.get_buffer without
that function returning null.
number of samples available in adapter
GstBadAudio.PlanarAudioAdapter.available
def GstBadAudio.PlanarAudioAdapter.available (self):
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 returning None.
number of samples available in adapter
gst_planar_audio_adapter_configure (GstPlanarAudioAdapter * adapter,
const GstAudioInfo * info)
Sets up the adapter to handle audio data of the specified audio format.
Note that this will internally clear the adapter and re-initialize it.
Parameters:
info
–
a GstAudioInfo describing the format of the audio data
GstBadAudio.PlanarAudioAdapter.prototype.configure
function GstBadAudio.PlanarAudioAdapter.prototype.configure(info: GstAudio.AudioInfo): {
}
Sets up the adapter to handle audio data of the specified audio format.
Note that this will internally clear the adapter and re-initialize it.
GstBadAudio.PlanarAudioAdapter.configure
def GstBadAudio.PlanarAudioAdapter.configure (self, info):
Sets up the adapter to handle audio data of the specified audio format.
Note that this will internally clear the adapter and re-initialize it.
gst_planar_audio_adapter_dts_at_discont
GstClockTime
gst_planar_audio_adapter_dts_at_discont (GstPlanarAudioAdapter * adapter)
Get the DTS that was on the last buffer with the GST_BUFFER_FLAG_DISCONT
flag, or GST_CLOCK_TIME_NONE.
Returns
–
The DTS at the last discont or GST_CLOCK_TIME_NONE.
GstBadAudio.PlanarAudioAdapter.prototype.dts_at_discont
function GstBadAudio.PlanarAudioAdapter.prototype.dts_at_discont(): {
}
Get the DTS that was on the last buffer with the GST_BUFFER_FLAG_DISCONT
flag, or GST_CLOCK_TIME_NONE.
The DTS at the last discont or GST_CLOCK_TIME_NONE.
GstBadAudio.PlanarAudioAdapter.dts_at_discont
def GstBadAudio.PlanarAudioAdapter.dts_at_discont (self):
Get the DTS that was on the last buffer with the GST_BUFFER_FLAG_DISCONT
flag, or GST_CLOCK_TIME_NONE.
The DTS at the last discont or GST_CLOCK_TIME_NONE.
gst_planar_audio_adapter_flush
gst_planar_audio_adapter_flush (GstPlanarAudioAdapter * adapter,
gsize to_flush)
Flushes the first to_flush samples in the adapter. The caller must ensure
that at least this many samples are available.
Parameters:
to_flush
–
the number of samples to flush
GstBadAudio.PlanarAudioAdapter.prototype.flush
function GstBadAudio.PlanarAudioAdapter.prototype.flush(to_flush: Number): {
}
Flushes the first to_flush samples in the adapter. The caller must ensure
that at least this many samples are available.
Parameters:
the number of samples to flush
GstBadAudio.PlanarAudioAdapter.flush
def GstBadAudio.PlanarAudioAdapter.flush (self, to_flush):
Flushes the first to_flush samples in the adapter. The caller must ensure
that at least this many samples are available.
Parameters:
the number of samples to flush
gst_planar_audio_adapter_get_buffer
GstBuffer *
gst_planar_audio_adapter_get_buffer (GstPlanarAudioAdapter * adapter,
gsize nsamples,
GstMapFlags flags)
Returns a GstBuffer containing the first nsamples of the adapter, but
does not flush them from the adapter.
Use gst_planar_audio_adapter_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
Parameters:
nsamples
–
the number of samples to get
flags
–
hint the intended use of the returned buffer
Returns
(
[transfer: full][nullable])
–
a GstBuffer containing the first
nsamples of the adapter, or NULL if nsamples samples are not
available. gst_buffer_unref when no longer needed.
GstBadAudio.PlanarAudioAdapter.prototype.get_buffer
function GstBadAudio.PlanarAudioAdapter.prototype.get_buffer(nsamples: Number, flags: Gst.MapFlags): {
}
Returns a Gst.Buffer containing the first nsamples of the adapter, but
does not flush them from the adapter.
Use GstBadAudio.PlanarAudioAdapter.prototype.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 (not introspectable) after
usage.
Free-function: gst_buffer_unref
Parameters:
the number of samples to get
hint the intended use of the returned buffer
GstBadAudio.PlanarAudioAdapter.get_buffer
def GstBadAudio.PlanarAudioAdapter.get_buffer (self, nsamples, flags):
Returns a Gst.Buffer containing the first nsamples of the adapter, but
does not flush them from the adapter.
Use GstBadAudio.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 (not introspectable) after
usage.
Free-function: gst_buffer_unref
Parameters:
the number of samples to get
hint the intended use of the returned buffer
gst_planar_audio_adapter_offset_at_discont
guint64
gst_planar_audio_adapter_offset_at_discont (GstPlanarAudioAdapter * adapter)
Get the offset that was on the last buffer with the GST_BUFFER_FLAG_DISCONT
flag, or GST_BUFFER_OFFSET_NONE.
Returns
–
The offset at the last discont or GST_BUFFER_OFFSET_NONE.
GstBadAudio.PlanarAudioAdapter.prototype.offset_at_discont
function GstBadAudio.PlanarAudioAdapter.prototype.offset_at_discont(): {
}
Get the offset that was on the last buffer with the GST_BUFFER_FLAG_DISCONT
flag, or GST_BUFFER_OFFSET_NONE.
The offset at the last discont or GST_BUFFER_OFFSET_NONE.
GstBadAudio.PlanarAudioAdapter.offset_at_discont
def GstBadAudio.PlanarAudioAdapter.offset_at_discont (self):
Get the offset that was on the last buffer with the GST_BUFFER_FLAG_DISCONT
flag, or GST_BUFFER_OFFSET_NONE.
The offset at the last discont or GST_BUFFER_OFFSET_NONE.
gst_planar_audio_adapter_prev_dts
GstClockTime
gst_planar_audio_adapter_prev_dts (GstPlanarAudioAdapter * adapter,
guint64 * distance)
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 are GST_CLOCK_TIME_NONE and 0 respectively.
Parameters:
distance
(
[out][allow-none])
–
pointer to location for distance, or NULL
Returns
–
The previously seen dts.
GstBadAudio.PlanarAudioAdapter.prototype.prev_dts
function GstBadAudio.PlanarAudioAdapter.prototype.prev_dts(): {
}
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 are GST_CLOCK_TIME_NONE and 0 respectively.
GstBadAudio.PlanarAudioAdapter.prev_dts
def GstBadAudio.PlanarAudioAdapter.prev_dts (self):
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 are GST_CLOCK_TIME_NONE and 0 respectively.
gst_planar_audio_adapter_prev_offset
guint64
gst_planar_audio_adapter_prev_offset (GstPlanarAudioAdapter * adapter,
guint64 * distance)
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 are GST_BUFFER_OFFSET_NONE and 0 respectively.
Parameters:
distance
(
[out][allow-none])
–
pointer to a location for distance, or NULL
Returns
–
The previous seen offset.
GstBadAudio.PlanarAudioAdapter.prototype.prev_offset
function GstBadAudio.PlanarAudioAdapter.prototype.prev_offset(): {
}
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 are GST_BUFFER_OFFSET_NONE and 0 respectively.
Returns a tuple made of:
The previous seen offset.
The previous seen offset.
GstBadAudio.PlanarAudioAdapter.prev_offset
def GstBadAudio.PlanarAudioAdapter.prev_offset (self):
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 are GST_BUFFER_OFFSET_NONE and 0 respectively.
Returns a tuple made of:
The previous seen offset.
The previous seen offset.
gst_planar_audio_adapter_prev_pts
GstClockTime
gst_planar_audio_adapter_prev_pts (GstPlanarAudioAdapter * adapter,
guint64 * distance)
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 are GST_CLOCK_TIME_NONE and 0 respectively.
Parameters:
distance
(
[out][allow-none])
–
pointer to location for distance, or NULL
Returns
–
The previously seen pts.
GstBadAudio.PlanarAudioAdapter.prototype.prev_pts
function GstBadAudio.PlanarAudioAdapter.prototype.prev_pts(): {
}
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 are GST_CLOCK_TIME_NONE and 0 respectively.
GstBadAudio.PlanarAudioAdapter.prev_pts
def GstBadAudio.PlanarAudioAdapter.prev_pts (self):
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 are GST_CLOCK_TIME_NONE and 0 respectively.
gst_planar_audio_adapter_pts_at_discont
GstClockTime
gst_planar_audio_adapter_pts_at_discont (GstPlanarAudioAdapter * adapter)
Get the PTS that was on the last buffer with the GST_BUFFER_FLAG_DISCONT
flag, or GST_CLOCK_TIME_NONE.
Returns
–
The PTS at the last discont or GST_CLOCK_TIME_NONE.
GstBadAudio.PlanarAudioAdapter.prototype.pts_at_discont
function GstBadAudio.PlanarAudioAdapter.prototype.pts_at_discont(): {
}
Get the PTS that was on the last buffer with the GST_BUFFER_FLAG_DISCONT
flag, or GST_CLOCK_TIME_NONE.
The PTS at the last discont or GST_CLOCK_TIME_NONE.
GstBadAudio.PlanarAudioAdapter.pts_at_discont
def GstBadAudio.PlanarAudioAdapter.pts_at_discont (self):
Get the PTS that was on the last buffer with the GST_BUFFER_FLAG_DISCONT
flag, or GST_CLOCK_TIME_NONE.
The PTS at the last discont or GST_CLOCK_TIME_NONE.
gst_planar_audio_adapter_push
gst_planar_audio_adapter_push (GstPlanarAudioAdapter * adapter,
GstBuffer * buf)
Adds the data from buf to the data stored inside adapter and takes
ownership of the buffer.
Parameters:
buf
(
[transfer: full])
–
a GstBuffer to queue in the adapter
GstBadAudio.PlanarAudioAdapter.prototype.push
function GstBadAudio.PlanarAudioAdapter.prototype.push(buf: Gst.Buffer): {
}
Adds the data from buf to the data stored inside adapter and takes
ownership of the buffer.
GstBadAudio.PlanarAudioAdapter.push
def GstBadAudio.PlanarAudioAdapter.push (self, buf):
Adds the data from buf to the data stored inside adapter and takes
ownership of the buffer.
gst_planar_audio_adapter_take_buffer
GstBuffer *
gst_planar_audio_adapter_take_buffer (GstPlanarAudioAdapter * adapter,
gsize nsamples,
GstMapFlags flags)
Returns a GstBuffer containing the first nsamples bytes of the
adapter. The returned bytes will be flushed from the adapter.
See gst_planar_audio_adapter_get_buffer for more details.
Caller owns a reference to the returned buffer. gst_buffer_unref after
usage.
Free-function: gst_buffer_unref
Parameters:
nsamples
–
the number of samples to take
flags
–
hint the intended use of the returned buffer
Returns
(
[transfer: full][nullable])
–
a GstBuffer containing the first
nsamples of the adapter, or NULL if nsamples samples are not
available. gst_buffer_unref when no longer needed.
GstBadAudio.PlanarAudioAdapter.prototype.take_buffer
function GstBadAudio.PlanarAudioAdapter.prototype.take_buffer(nsamples: Number, flags: Gst.MapFlags): {
}
Returns a Gst.Buffer containing the first nsamples bytes of the
adapter. The returned bytes will be flushed from the adapter.
See GstBadAudio.PlanarAudioAdapter.prototype.get_buffer for more details.
Caller owns a reference to the returned buffer. gst_buffer_unref (not introspectable) after
usage.
Free-function: gst_buffer_unref
Parameters:
the number of samples to take
hint the intended use of the returned buffer
GstBadAudio.PlanarAudioAdapter.take_buffer
def GstBadAudio.PlanarAudioAdapter.take_buffer (self, nsamples, flags):
Returns a Gst.Buffer containing the first nsamples bytes of the
adapter. 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 (not introspectable) after
usage.
Free-function: gst_buffer_unref
Parameters:
the number of samples to take
hint the intended use of the returned buffer