gstaudiosink

gstaudiosink — Simple base class for audio sinks

Synopsis


#include <gst/audio/gstaudiosink.h>


            GstAudioSink;
            GstAudioSinkClass;

Object Hierarchy


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

Description

This is the most simple base class for audio sinks that only requires subclasses to implement a set of simple functions:

open()open()open()

Open the device.

Open the device.

prepare()prepare()prepare()

Configure the device with the specified format.

Configure the device with the specified format.

write()write()write()

Write samples to the device.

Write samples to the device.

reset()reset()reset()

Unblock writes and flush the device.

Unblock writes and flush the device.

delay()delay()delay()

Get the number of samples written but not yet played by the device.

Get the number of samples written but not yet played by the device.

unprepare()unprepare()unprepare()

Undo operations done by prepare.

Undo operations done by prepare.

close()close()close()

Close the device.

Close the device.

open()

Open the device.

prepare()

Configure the device with the specified format.

write()

Write samples to the device.

reset()

Unblock writes and flush the device.

delay()

Get the number of samples written but not yet played by the device.

unprepare()

Undo operations done by prepare.

close()

Close the device.

All scheduling of samples and timestamps is done in this base class together with GstBaseAudioSink using a default implementation of a GstRingBuffer that uses threads.

Last reviewed on 2006-09-27 (0.10.12)

Details

GstAudioSink

typedef struct _GstAudioSink GstAudioSink;

Opaque GstAudioSink.


GstAudioSinkClass

typedef struct {
  GstBaseAudioSinkClass parent_class;

  /* vtable */

  /* open the device with given specs */
  gboolean (*open)      (GstAudioSink *sink);
  /* prepare resources and state to operate with the given specs */
  gboolean (*prepare)   (GstAudioSink *sink, GstRingBufferSpec *spec);
  /* undo anything that was done in prepare() */
  gboolean (*unprepare) (GstAudioSink *sink);
  /* close the device */
  gboolean (*close)     (GstAudioSink *sink);
  /* write samples to the device */
  guint    (*write)     (GstAudioSink *sink, gpointer data, guint length);
  /* get number of samples queued in the device */
  guint    (*delay)     (GstAudioSink *sink);
  /* reset the audio device, unblock from a write */
  void     (*reset)     (GstAudioSink *sink);
} GstAudioSinkClass;

GstAudioSink class. Override the vmethods to implement functionality.

GstBaseAudioSinkClass parent_class;GstBaseAudioSinkClassparent_class the parent class structure. the parent class structure. open ()open Open the device. No configuration needs to be done at this point. This function is also used to check if the device is available. Open the device. No configuration needs to be done at this point. This function is also used to check if the device is available. prepare ()prepare Prepare the device to operate with the specified parameters. Prepare the device to operate with the specified parameters. unprepare ()unprepare Undo operations done in prepare. Undo operations done in prepare. close ()close Close the device. Close the device. write ()write Write data to the device. Write data to the device. delay ()delay Return how many samples are still in the device. This is used to drive the synchronisation. Return how many samples are still in the device. This is used to drive the synchronisation. reset ()reset Returns as quickly as possible from a write and flush any pending samples from the device. Returns as quickly as possible from a write and flush any pending samples from the device.
GstBaseAudioSinkClass parent_class; the parent class structure.
open () Open the device. No configuration needs to be done at this point. This function is also used to check if the device is available.
prepare () Prepare the device to operate with the specified parameters.
unprepare () Undo operations done in prepare.
close () Close the device.
write () Write data to the device.
delay () Return how many samples are still in the device. This is used to drive the synchronisation.
reset () Returns as quickly as possible from a write and flush any pending samples from the device.

See Also

GstBaseAudioSink, GstRingBuffer, GstAudioSink.