gstbaseaudiosink

gstbaseaudiosink — Base class for audio sinks

Functions

Properties

guint64 alignment-threshold Read / Write
gint64 buffer-time Read / Write
gboolean can-activate-pull Read / Write
guint64 discont-wait Read / Write
gint64 drift-tolerance Read / Write
gint64 latency-time Read / Write
gboolean provide-clock Read / Write
GstBaseAudioSinkSlaveMethod slave-method Read / Write

Types and Values

Object Hierarchy

    GObject
    ╰── GstObject
        ╰── GstElement
            ╰── GstBaseSink
                ╰── GstBaseAudioSink
                    ╰── GstAudioSink

Includes

#include <gst/audio/gstbaseaudiosink.h>

Description

This is the base class for audio sinks. Subclasses need to implement the ::create_ringbuffer vmethod. This base class will then take care of writing samples to the ringbuffer, synchronisation, clipping and flushing.

Last reviewed on 2006-09-27 (0.10.12)

Functions

GST_BASE_AUDIO_SINK_CLOCK()

#define GST_BASE_AUDIO_SINK_CLOCK(obj)   (GST_BASE_AUDIO_SINK (obj)->clock)

Get the GstClock of obj .

Parameters

obj

a GstBaseAudioSink

 

GST_BASE_AUDIO_SINK_PAD()

#define GST_BASE_AUDIO_SINK_PAD(obj)     (GST_BASE_SINK (obj)->sinkpad)

Get the sink GstPad of obj .

Parameters

obj

a GstBaseAudioSink

 

gst_base_audio_sink_create_ringbuffer ()

GstRingBuffer *
gst_base_audio_sink_create_ringbuffer (GstBaseAudioSink *sink);

Create and return the GstRingBuffer for sink . This function will call the ::create_ringbuffer vmethod and will set sink as the parent of the returned buffer (see gst_object_set_parent()).

Parameters

sink

a GstBaseAudioSink.

 

Returns

The new ringbuffer of sink .


gst_base_audio_sink_set_provide_clock ()

void
gst_base_audio_sink_set_provide_clock (GstBaseAudioSink *sink,
                                       gboolean provide);

Controls whether sink will provide a clock or not. If provide is TRUE, gst_element_provide_clock() will return a clock that reflects the datarate of sink . If provide is FALSE, gst_element_provide_clock() will return NULL.

Parameters

sink

a GstBaseAudioSink

 

provide

new state

 

Since 0.10.16


gst_base_audio_sink_get_provide_clock ()

gboolean
gst_base_audio_sink_get_provide_clock (GstBaseAudioSink *sink);

Queries whether sink will provide a clock or not. See also gst_base_audio_sink_set_provide_clock.

Parameters

sink

a GstBaseAudioSink

 

Returns

TRUE if sink will provide a clock.

Since 0.10.16


gst_base_audio_sink_set_slave_method ()

void
gst_base_audio_sink_set_slave_method (GstBaseAudioSink *sink,
                                      GstBaseAudioSinkSlaveMethod method);

Controls how clock slaving will be performed in sink .

Parameters

sink

a GstBaseAudioSink

 

method

the new slave method

 

Since 0.10.16


gst_base_audio_sink_get_slave_method ()

GstBaseAudioSinkSlaveMethod
gst_base_audio_sink_get_slave_method (GstBaseAudioSink *sink);

Get the current slave method used by sink .

Parameters

sink

a GstBaseAudioSink

 

Returns

The current slave method used by sink .

Since 0.10.16


gst_base_audio_sink_get_drift_tolerance ()

gint64
gst_base_audio_sink_get_drift_tolerance
                               (GstBaseAudioSink *sink);

Get the current drift tolerance, in microseconds, used by sink .

Parameters

sink

a GstBaseAudioSink

 

Returns

The current drift tolerance used by sink .

Since 0.10.31


gst_base_audio_sink_set_drift_tolerance ()

void
gst_base_audio_sink_set_drift_tolerance
                               (GstBaseAudioSink *sink,
                                gint64 drift_tolerance);

Controls the sink's drift tolerance.

Parameters

sink

a GstBaseAudioSink

 

drift_tolerance

the new drift tolerance in microseconds

 

Since 0.10.31

Types and Values

struct GstBaseAudioSink

struct GstBaseAudioSink;

Opaque GstBaseAudioSink.


struct GstBaseAudioSinkClass

struct GstBaseAudioSinkClass {
  GstBaseSinkClass parent_class;

  /* subclass ringbuffer allocation */
  GstRingBuffer* (*create_ringbuffer)  (GstBaseAudioSink *sink);

  /* subclass payloader */
  GstBuffer*     (*payload)            (GstBaseAudioSink *sink,
                                        GstBuffer        *buffer);
};

GstBaseAudioSink class. Override the vmethod to implement functionality.

Members

GstBaseSinkClass parent_class;

the parent class.

 

create_ringbuffer ()

create and return a GstRingBuffer to write to.

 

payload ()

payload data in a format suitable to write to the sink. If no payloading is required, returns a reffed copy of the original buffer, else returns the payloaded buffer with all other metadata copied. (Since: 0.10.36)

 

enum GstBaseAudioSinkSlaveMethod

Different possible clock slaving algorithms used when the internal audio clock is not selected as the pipeline master clock.

Members

GST_BASE_AUDIO_SINK_SLAVE_RESAMPLE

Resample to match the master clock

 

GST_BASE_AUDIO_SINK_SLAVE_SKEW

Adjust playout pointer when master clock drifts too much.

 

GST_BASE_AUDIO_SINK_SLAVE_NONE

No adjustment is done.

 

Property Details

The “alignment-threshold” property

  “alignment-threshold”      guint64

Timestamp alignment threshold in nanoseconds.

Flags: Read / Write

Allowed values: [1,18446744073709551614]

Default value: 40000000


The “buffer-time” property

  “buffer-time”              gint64

Size of audio buffer in microseconds.

Flags: Read / Write

Allowed values: >= 1

Default value: 200000


The “can-activate-pull” property

  “can-activate-pull”        gboolean

Allow pull-based scheduling.

Flags: Read / Write

Default value: FALSE


The “discont-wait” property

  “discont-wait”             guint64

A window of time in nanoseconds to wait before creating a discontinuity as a result of breaching the drift-tolerance.

Flags: Read / Write

Allowed values: <= 18446744073709551614

Default value: 1000000000

Since 0.10.36


The “drift-tolerance” property

  “drift-tolerance”          gint64

Controls the amount of time in microseconds that clocks are allowed to drift before resynchronisation happens.

Flags: Read / Write

Allowed values: >= 1

Default value: 40000

Since 0.10.26


The “latency-time” property

  “latency-time”             gint64

Audio latency in microseconds.

Flags: Read / Write

Allowed values: >= 1

Default value: 10000


The “provide-clock” property

  “provide-clock”            gboolean

Provide a clock to be used as the global pipeline clock.

Flags: Read / Write

Default value: TRUE


The “slave-method” property

  “slave-method”             GstBaseAudioSinkSlaveMethod

Algorithm to use to match the rate of the masterclock.

Flags: Read / Write

Default value: GST_BASE_AUDIO_SINK_SLAVE_SKEW

See Also

GstAudioSink, GstRingBuffer.