GstAudio.AudioClock

g GObject.InitiallyUnowned GObject.InitiallyUnowned Gst.Object Gst.Object GObject.InitiallyUnowned->Gst.Object GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned Gst.Clock Gst.Clock Gst.SystemClock Gst.SystemClock Gst.Clock->Gst.SystemClock Gst.Object->Gst.Clock GstAudio.AudioClock GstAudio.AudioClock Gst.SystemClock->GstAudio.AudioClock

Subclasses:

None

Methods

Inherited:

Gst.SystemClock (2), Gst.Clock (32), Gst.Object (27), GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new (name, func, *user_data)

adjust (time)

get_time ()

invalidate ()

reset (time)

Virtual Methods

Inherited:

Gst.Clock (6), Gst.Object (1), GObject.Object (7)

Properties

Inherited:

Gst.SystemClock (1), Gst.Clock (3), Gst.Object (2)

Signals

Inherited:

Gst.Clock (1), Gst.Object (1), GObject.Object (1)

Fields

Inherited:

Gst.Clock (1), Gst.Object (1), GObject.Object (1)

Name

Type

Access

Description

clock

Gst.SystemClock

r

destroy_notify

GLib.DestroyNotify

r

func

GstAudio.AudioClockGetTimeFunc

r

last_time

int

r

time_offset

int

r

user_data

object

r

Class Details

class GstAudio.AudioClock(**kwargs)
Bases:

Gst.SystemClock

Abstract:

No

Structure:

GstAudio.AudioClockClass

GstAudio.AudioClock makes it easy for elements to implement a Gst.Clock, they simply need to provide a function that returns the current clock time.

This object is internally used to implement the clock in GstAudio.AudioBaseSink.

classmethod new(name, func, *user_data)
Parameters:
Returns:

a new GstAudio.AudioClock casted to a Gst.Clock.

Return type:

Gst.Clock

Create a new GstAudio.AudioClock instance. Whenever the clock time should be calculated it will call func with user_data. When func returns Gst.CLOCK_TIME_NONE, the clock will return the last reported time.

adjust(time)
Parameters:

time (int) – a #GstClockTime

Returns:

time adjusted with the internal offset.

Return type:

int

Adjust time with the internal offset of the audio clock.

get_time()
Returns:

the time as reported by the time function of the audio clock

Return type:

int

Report the time as returned by the GstAudio.AudioClockGetTimeFunc without applying any offsets.

invalidate()

Invalidate the clock function. Call this function when the provided GstAudio.AudioClockGetTimeFunc cannot be called anymore, for example, when the user_data becomes invalid.

After calling this function, self will return the last returned time for the rest of its lifetime.

reset(time)
Parameters:

time (int) – a #GstClockTime

Inform self that future calls to GstAudio.AudioClockGetTimeFunc will return values starting from time. The clock will update an internal offset to make sure that future calls to internal_time will return an increasing result as required by the Gst.Clock object.