GstAudio.AudioSink

g GObject.InitiallyUnowned GObject.InitiallyUnowned Gst.Object Gst.Object GObject.InitiallyUnowned->Gst.Object GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned Gst.Element Gst.Element GstBase.BaseSink GstBase.BaseSink Gst.Element->GstBase.BaseSink Gst.Object->Gst.Element GstAudio.AudioBaseSink GstAudio.AudioBaseSink GstAudio.AudioSink GstAudio.AudioSink GstAudio.AudioBaseSink->GstAudio.AudioSink GstBase.BaseSink->GstAudio.AudioBaseSink

Subclasses:

None

Methods

Inherited:

GstAudio.AudioBaseSink (13), GstBase.BaseSink (31), Gst.Element (82), Gst.Object (27), GObject.Object (37)

Structs:

Gst.ElementClass (10), GObject.ObjectClass (5)

Virtual Methods

Inherited:

GstAudio.AudioBaseSink (2), GstBase.BaseSink (18), Gst.Element (16), Gst.Object (1), GObject.Object (7)

do_close ()

do_delay ()

do_open ()

do_pause ()

do_prepare (spec)

do_reset ()

do_resume ()

do_stop ()

do_unprepare ()

do_write (data)

Properties

Inherited:

GstAudio.AudioBaseSink (8), GstBase.BaseSink (13), Gst.Object (2)

Signals

Inherited:

Gst.Element (3), Gst.Object (1), GObject.Object (1)

Fields

Inherited:

Gst.Element (3), Gst.Object (1), GObject.Object (1)

Name

Type

Access

Description

element

GstAudio.AudioBaseSink

r

thread

GLib.Thread

r

Class Details

class GstAudio.AudioSink(**kwargs)
Bases:

GstAudio.AudioBaseSink

Abstract:

No

Structure:

GstAudio.AudioSinkClass

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

  • 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 GstAudio.AudioBaseSink using a default implementation of a GstAudio.AudioRingBuffer that uses threads.

do_close() virtual
Return type:

bool

Close the device.

do_delay() virtual
Return type:

int

Return how many frames are still in the device. Participates in computing the time for audio clocks and drives the synchronisation.

do_open() virtual
Return type:

bool

Open the device. No configuration needs to be done at this point. This function is also used to check if the device is available.

do_pause() virtual

Pause the device and unblock write as fast as possible. For retro compatibility, the audio sink will fallback to calling reset if this vmethod is not provided.

New in version 1.18.

do_prepare(spec) virtual
Parameters:

spec (GstAudio.AudioRingBufferSpec) –

Return type:

bool

Prepare the device to operate with the specified parameters.

do_reset() virtual

Returns as quickly as possible from a write and flush any pending samples from the device. This vmethod is deprecated. Please provide pause and stop instead.

do_resume() virtual

Resume the device.

New in version 1.18.

do_stop() virtual

Stop the device and unblock write as fast as possible. Pending samples are flushed from the device. For retro compatibility, the audio sink will fallback to calling reset if this vmethod is not provided.

New in version 1.18.

do_unprepare() virtual
Return type:

bool

Undo operations done in prepare.

do_write(data) virtual
Parameters:

data (bytes) – the sample data

Return type:

int

Write samples to the device.