|  |  |  | GStreamer Base Plugins 0.10 Library Reference Manual |  | 
|---|---|---|---|---|
| Top | Description | Object Hierarchy | ||||
GObject +----GstObject +----GstElement +----GstBaseSink +----GstBaseAudioSink +----GstAudioSink
This is the most simple base class for audio sinks that only requires subclasses to implement a set of simple functions:
| 
 | Open the device. | 
| 
 | Configure the device with the specified format. | 
| 
 | Write samples to the device. | 
| 
 | Unblock writes and flush the device. | 
| 
 | Get the number of samples written but not yet played by the device. | 
| 
 | Undo operations done by prepare. | 
| 
 | 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)
struct GstAudioSinkClass {
  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 */
  /* FIXME 0.11: change return value to gint, as most implementation use that
   * already anyway */
  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);
};
GstAudioSink class. Override the vmethods to implement functionality.
| GstBaseAudioSinkClass  | the parent class structure. | 
| 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 the device to operate with the specified parameters. | |
| Undo operations done in prepare. | |
| Close the device. | |
| Write data to the device. | |
| Return how many samples are still in the device. This is used to drive the synchronisation. | |
| Returns as quickly as possible from a write and flush any pending samples from the device. |