## gstbaseaudiosink

gstbaseaudiosink — Base class for audio sinks

## Synopsis

    #include <gst/audio/gstbaseaudiosink.h>

                        GstBaseAudioSink;
                        GstBaseAudioSinkClass;
    enum                GstBaseAudioSinkSlaveMethod;
    #define             GST_BASE_AUDIO_SINK_CLOCK           (obj)
    #define             GST_BASE_AUDIO_SINK_PAD             (obj)
    GstRingBuffer*      gst_base_audio_sink_create_ringbuffer
                                                            (GstBaseAudioSink *sink);

## Object Hierarchy

      GObject
       +----GstObject
             +----GstElement
                   +----GstBaseSink
                         +----GstBaseAudioSink
                               +----GstAudioSink

## Properties

      "buffer-time"              gint64                : Read / Write
      "latency-time"             gint64                : Read / Write
      "provide-clock"            gboolean              : Read / Write
      "slave-method"             GstBaseAudioSinkSlaveMethod  : Read / Write

## 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)

## Details

### GstBaseAudioSink

    typedef struct _GstBaseAudioSink GstBaseAudioSink;

Opaque GstBaseAudioSink.

### GstBaseAudioSinkClass

    typedef struct {
      GstBaseSinkClass parent_class;

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

GstBaseAudioSink class. Override the vmethod to implement functionality.

GstBaseSinkClass `parent_class`; | the parent class.
`create_ringbuffer` () | create and return a GstRingBuffer to write to.

### enum GstBaseAudioSinkSlaveMethod

    typedef enum
    {
      GST_BASE_AUDIO_SINK_SLAVE_RESAMPLE,
      GST_BASE_AUDIO_SINK_SLAVE_SKEW,
    } GstBaseAudioSinkSlaveMethod;

Different possible clock slaving algorithms

`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_CLOCK()

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

Get the GstClock of `obj`.

`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`.

`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()`).

`sink` : | a GstBaseAudioSink.
Returns : | The new ringbuffer of `sink`.

## Property Details

### The "`buffer-time`" property

      "buffer-time"              gint64                : Read / Write

Size of audio buffer in microseconds.

Allowed values: >= 1

Default value: 200000

### The "`latency-time`" property

      "latency-time"             gint64                : Read / Write

Audio latency in microseconds.

Allowed values: >= 1

Default value: 10000

### The "`provide-clock`" property

      "provide-clock"            gboolean              : Read / Write

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

Default value: TRUE

### The "`slave-method`" property

      "slave-method"             GstBaseAudioSinkSlaveMethod  : Read / Write

Algorithm to use to match the rate of the masterclock.

Default value: Skew slaving

## See Also

GstAudioSink, GstRingBuffer.