Class: GstAudio::AudioClock

Inherits:
Gst::SystemClock show all
Defined in:
(unknown)

Instance Method Summary collapse

Methods inherited from Gst::SystemClock

#clock_type, #clock_type=, default=, obtain

Methods inherited from Gst::Clock

#add_observation, #add_observation_unapplied, #adjust_unlocked, #adjust_with_calibration, #get_calibration, id_compare_func, id_get_clock, id_get_time, id_ref, id_unref, id_unschedule, id_uses_clock, id_wait, id_wait_async, #internal_time, #is_synced, #master, #master=, #new_periodic_id, #new_single_shot_id, #periodic_id_reinit, #resolution, #resolution=, #set_calibration, #single_shot_id_reinit, #synced=, #timeout, #timeout=, #unadjust_unlocked, #unadjust_with_calibration, #wait_for_sync, #window_size, #window_size=, #window_threshold, #window_threshold=

Methods inherited from Gst::Object

#add_control_binding, check_uniqueness, #control_bindings_disabled=, #control_rate, #control_rate=, default_deep_notify, #default_error, #get_control_binding, #get_g_value_array, #get_value, #get_value_array, #has_active_control_bindings, #has_ancestor, #has_as_ancestor, #has_as_parent, #name, #name=, #parent, #parent=, #path_string, #ref, ref_sink, #remove_control_binding, replace, #set_control_binding_disabled, #suggest_next_sync, #sync_values, #unparent, #unref

Constructor Details

#initialize(name, func, user_data, destroy_notify) ⇒ Gst::Clock

Create a new Gst::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.

Parameters:

  • name (String)

    the name of the clock

  • func (GstAudio::AudioClockGetTimeFunc)

    a function

  • user_data (GObject)

    user data

  • destroy_notify (GLib::DestroyNotify)

    GDestroy::Notify for user_data

Instance Method Details

#adjust(time) ⇒ Gst::ClockTime

Adjust time with the internal offset of the audio clock.

Parameters:

  • time (Gst::ClockTime)

    a Gst::ClockTime

Returns:

  • (Gst::ClockTime)

    time adjusted with the internal offset.

#invalidatenil

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

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

Returns:

  • (nil)

#reset(time) ⇒ nil

Inform clock that future calls to Gst::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.

Parameters:

  • time (Gst::ClockTime)

    a Gst::ClockTime

Returns:

  • (nil)

#timeGst::ClockTime

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

Returns:

  • (Gst::ClockTime)

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