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

GstPlanarAudioAdapter

GObject
    ╰──GstPlanarAudioAdapter

The opaque GstPlanarAudioAdapter data structure.


Class structure

GstPlanarAudioAdapterClass


Constructors

gst_planar_audio_adapter_new

GstPlanarAudioAdapter *
gst_planar_audio_adapter_new ()

Creates a new GstPlanarAudioAdapter. Free with g_object_unref.

Returns ( [transfer: full])

a new GstPlanarAudioAdapter


Methods

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.

Parameters:

adapter

a GstPlanarAudioAdapter

Returns

number of samples available in adapter


gst_planar_audio_adapter_clear

gst_planar_audio_adapter_clear (GstPlanarAudioAdapter * adapter)

Removes all buffers from adapter.

Parameters:

adapter

a GstPlanarAudioAdapter


gst_planar_audio_adapter_configure

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:

adapter

a GstPlanarAudioAdapter

info

a GstAudioInfo describing the format of the audio data


gst_planar_audio_adapter_distance_from_discont

guint64
gst_planar_audio_adapter_distance_from_discont (GstPlanarAudioAdapter * adapter)

Parameters:

adapter
No description available
Returns
No description available

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.

Parameters:

adapter

a GstPlanarAudioAdapter

Returns

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:

adapter

a GstPlanarAudioAdapter

to_flush

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:

adapter

a GstPlanarAudioAdapter

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.


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.

Parameters:

adapter

a GstPlanarAudioAdapter

Returns

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:

adapter

a GstPlanarAudioAdapter

distance ( [out][allow-none])

pointer to location for distance, or NULL

Returns

The previously seen dts.


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:

adapter

a GstPlanarAudioAdapter

distance ( [out][allow-none])

pointer to a location for distance, or NULL

Returns

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:

adapter

a GstPlanarAudioAdapter

distance ( [out][allow-none])

pointer to location for distance, or NULL

Returns

The previously seen pts.


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.

Parameters:

adapter

a GstPlanarAudioAdapter

Returns

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:

adapter

a GstPlanarAudioAdapter

buf ( [transfer: full])

a GstBuffer to queue in the adapter


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:

adapter

a GstPlanarAudioAdapter

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.


Constants

GST_TYPE_PLANAR_AUDIO_ADAPTER

#define GST_TYPE_PLANAR_AUDIO_ADAPTER \
  (gst_planar_audio_adapter_get_type())

The results of the search are