GstAudio.AudioBaseSink

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 GstBase.BaseSink->GstAudio.AudioBaseSink

Subclasses:

GstAudio.AudioSink

Methods

Inherited:

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

Structs:

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

create_ringbuffer ()

get_alignment_threshold ()

get_discont_wait ()

get_drift_tolerance ()

get_provide_clock ()

get_slave_method ()

report_device_failure ()

set_alignment_threshold (alignment_threshold)

set_custom_slaving_callback (callback, *user_data)

set_discont_wait (discont_wait)

set_drift_tolerance (drift_tolerance)

set_provide_clock (provide)

set_slave_method (method)

Virtual Methods

Inherited:

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

do_create_ringbuffer ()

do_payload (buffer)

Properties

Inherited:

GstBase.BaseSink (13), Gst.Object (2)

Name

Type

Flags

Short Description

alignment-threshold

int

r/w

Timestamp alignment threshold in nanoseconds

buffer-time

int

r/w

Size of audio buffer in microseconds, this is the minimum latency that the sink reports

can-activate-pull

bool

r/w

Allow pull-based scheduling

discont-wait

int

r/w

Window of time in nanoseconds to wait before creating a discontinuity

drift-tolerance

int

r/w

Tolerance for clock drift in microseconds

latency-time

int

r/w

The minimum amount of data to write in each iteration in microseconds

provide-clock

bool

r/w

Provide a clock to be used as the global pipeline clock

slave-method

GstAudio.AudioBaseSinkSlaveMethod

r/w

Algorithm used to match the rate of the masterclock

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

buffer_time

int

r

element

GstBase.BaseSink

r

eos_rendering

bool

r

latency_time

int

r

next_sample

int

r

provided_clock

Gst.Clock

r

ringbuffer

GstAudio.AudioRingBuffer

r

Class Details

class GstAudio.AudioBaseSink(**kwargs)
Bases:

GstBase.BaseSink

Abstract:

No

Structure:

GstAudio.AudioBaseSinkClass

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.

create_ringbuffer()[source]
Returns:

The new ringbuffer of self.

Return type:

GstAudio.AudioRingBuffer or None

Create and return the GstAudio.AudioRingBuffer for self. This function will call the ::create_ringbuffer vmethod and will set self as the parent of the returned buffer (see Gst.Object.set_parent()).

get_alignment_threshold()[source]
Returns:

The current alignment threshold used by self.

Return type:

int

Get the current alignment threshold, in nanoseconds, used by self.

get_discont_wait()[source]
Returns:

The current discont wait used by self.

Return type:

int

Get the current discont wait, in nanoseconds, used by self.

get_drift_tolerance()[source]
Returns:

The current drift tolerance used by self.

Return type:

int

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

get_provide_clock()[source]
Returns:

True if self will provide a clock.

Return type:

bool

Queries whether self will provide a clock or not. See also GstAudio.AudioBaseSink.set_provide_clock.

get_slave_method()[source]
Returns:

The current slave method used by self.

Return type:

GstAudio.AudioBaseSinkSlaveMethod

Get the current slave method used by self.

report_device_failure()[source]

Informs this base class that the audio output device has failed for some reason, causing a discontinuity (for example, because the device recovered from the error, but lost all contents of its ring buffer). This function is typically called by derived classes, and is useful for the custom slave method.

New in version 1.6.

set_alignment_threshold(alignment_threshold)[source]
Parameters:

alignment_threshold (int) – the new alignment threshold in nanoseconds

Controls the sink’s alignment threshold.

set_custom_slaving_callback(callback, *user_data)[source]
Parameters:

Sets the custom slaving callback. This callback will be invoked if the slave-method property is set to GstAudio.AudioBaseSinkSlaveMethod.CUSTOM and the audio sink receives and plays samples.

Setting the callback to None causes the sink to behave as if the GstAudio.AudioBaseSinkSlaveMethod.NONE method were used.

New in version 1.6.

set_discont_wait(discont_wait)[source]
Parameters:

discont_wait (int) – the new discont wait in nanoseconds

Controls how long the sink will wait before creating a discontinuity.

set_drift_tolerance(drift_tolerance)[source]
Parameters:

drift_tolerance (int) – the new drift tolerance in microseconds

Controls the sink’s drift tolerance.

set_provide_clock(provide)[source]
Parameters:

provide (bool) – new state

Controls whether self will provide a clock or not. If provide is True, Gst.Element.provide_clock() will return a clock that reflects the datarate of self. If provide is False, Gst.Element.provide_clock() will return None.

set_slave_method(method)[source]
Parameters:

method (GstAudio.AudioBaseSinkSlaveMethod) – the new slave method

Controls how clock slaving will be performed in self.

do_create_ringbuffer() virtual
Returns:

The new ringbuffer of sink.

Return type:

GstAudio.AudioRingBuffer or None

Create and return the GstAudio.AudioRingBuffer 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()).

do_payload(buffer) virtual
Parameters:

buffer (Gst.Buffer) –

Return type:

Gst.Buffer

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.

Property Details

GstAudio.AudioBaseSink.props.alignment_threshold
Name:

alignment-threshold

Type:

int

Default Value:

40000000

Flags:

READABLE, WRITABLE

Timestamp alignment threshold in nanoseconds

GstAudio.AudioBaseSink.props.buffer_time
Name:

buffer-time

Type:

int

Default Value:

200000

Flags:

READABLE, WRITABLE

Size of audio buffer in microseconds, this is the minimum latency that the sink reports

GstAudio.AudioBaseSink.props.can_activate_pull
Name:

can-activate-pull

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE

Allow pull-based scheduling

GstAudio.AudioBaseSink.props.discont_wait
Name:

discont-wait

Type:

int

Default Value:

1000000000

Flags:

READABLE, WRITABLE

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

GstAudio.AudioBaseSink.props.drift_tolerance
Name:

drift-tolerance

Type:

int

Default Value:

40000

Flags:

READABLE, WRITABLE

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

GstAudio.AudioBaseSink.props.latency_time
Name:

latency-time

Type:

int

Default Value:

10000

Flags:

READABLE, WRITABLE

The minimum amount of data to write in each iteration in microseconds

GstAudio.AudioBaseSink.props.provide_clock
Name:

provide-clock

Type:

bool

Default Value:

True

Flags:

READABLE, WRITABLE

Provide a clock to be used as the global pipeline clock

GstAudio.AudioBaseSink.props.slave_method
Name:

slave-method

Type:

GstAudio.AudioBaseSinkSlaveMethod

Default Value:

GstAudio.AudioBaseSinkSlaveMethod.SKEW

Flags:

READABLE, WRITABLE

Algorithm used to match the rate of the masterclock