Gst::NetClientClock Class Reference

Special clock that synchronizes to a remote time provider. More...

`#include <gstreamermm/netclientclock.h>`

Inheritance diagram for Gst::NetClientClock:
[legend]

## Public Member Functions

| NetClientClock (NetClientClock&& src) noexcept
NetClientClock& | operator= (NetClientClock&& src) noexcept
| ~NetClientClock () noexcept override
GstNetClientClock* | gobj ()
| Provides access to the underlying C GObject. More...
const GstNetClientClock* | gobj () const
| Provides access to the underlying C GObject. More...
GstNetClientClock* | gobj_copy ()
| Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. More...
Glib::PropertyProxy< Glib::ustring > | property_address ()
| The IP address of the machine providing a time server. More...
Glib::PropertyProxy_ReadOnly< Glib::ustring > | property_address () const
| The IP address of the machine providing a time server. More...
Glib::PropertyProxy_ReadOnly< guint64 > | property_base_time () const
| Initial time that is reported before synchronization. More...
Glib::PropertyProxy< Glib::RefPtr< Gst::Bus > > | property_bus ()
| A GstBus on which to send clock status information. More...
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< Gst::Bus > > | property_bus () const
| A GstBus on which to send clock status information. More...
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< Gst::Clock > > | property_internal_clock () const
| Internal clock that directly slaved to the remote clock. More...
Glib::PropertyProxy< guint64 > | property_minimum_update_interval ()
| Minimum polling interval for packets, in nanoseconds(0 = no limit). More...
Glib::PropertyProxy_ReadOnly< guint64 > | property_minimum_update_interval () const
| Minimum polling interval for packets, in nanoseconds(0 = no limit). More...
Glib::PropertyProxy< int > | property_port ()
| The port on which the remote server is listening. More...
Glib::PropertyProxy_ReadOnly< int > | property_port () const
| The port on which the remote server is listening. More...
Glib::PropertyProxy< guint64 > | property_round_trip_limit ()
| Maximum tolerable round-trip interval for packets, in nanoseconds (0 = no limit). More...
Glib::PropertyProxy_ReadOnly< guint64 > | property_round_trip_limit () const
| Maximum tolerable round-trip interval for packets, in nanoseconds (0 = no limit). More...
Public Member Functions inherited from Gst::SystemClock
| SystemClock (SystemClock&& src) noexcept
SystemClock& | operator= (SystemClock&& src) noexcept
| ~SystemClock () noexcept override
GstSystemClock* | gobj ()
| Provides access to the underlying C GObject. More...
const GstSystemClock* | gobj () const
| Provides access to the underlying C GObject. More...
GstSystemClock* | gobj_copy ()
| Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. More...
Public Member Functions inherited from Gst::Clock
| Clock (Clock&& src) noexcept
Clock& | operator= (Clock&& src) noexcept
| ~Clock () noexcept override
GstClock* | gobj ()
| Provides access to the underlying C GObject. More...
const GstClock* | gobj () const
| Provides access to the underlying C GObject. More...
GstClock* | gobj_copy ()
| Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. More...
bool | add_observation (Gst::ClockTime slave_time, Gst::ClockTime master_time, gdouble& result)
| The time master_time of the master clock and the time slave_time of the slave clock are added to the list of observations. More...
bool | add_observation (Gst::ClockTime slave_time, Gst::ClockTime master_time, gdouble& result, Gst::ClockTime&internal, Gst::ClockTime& external, Gst::ClockTime& rate_num, Gst::ClockTime& rate_denom)
| Add a clock observation to the internal slaving algorithm the same as add_observation(), and return the result of the master clock estimation, without updating the internal calibration. More...
bool | set_master (const Clock& master_clock)
| Set master_clock as the master clock for clock. More...
Glib::RefPtr< Gst::Clock > | get_master ()
| Get the master clock that clock is slaved to or `nullptr` when the clock is not slaved to any master clock. More...
Glib::RefPtr< const Gst::Clock > | get_master () const
| Get the master clock that clock is slaved to or `nullptr` when the clock is not slaved to any master clock. More...
Gst::ClockTime | set_resolution (Gst::ClockTime resolution)
| Set the accuracy of the clock. More...
Gst::ClockTime | get_resolution () const
| Get the accuracy of the clock. More...
Gst::ClockTime | get_time () const
| Gets the current time of the given clock. More...
Glib::RefPtr< Gst::ClockID > | create_single_shot_id (Gst::ClockTime time)
| Get a Gst::ClockID from clock to trigger a single shot notification at the requested time. More...
Glib::RefPtr< Gst::ClockID > | create_periodic_id (Gst::ClockTime start_time, Gst::ClockTime intervals)
| Get an ID from clock to trigger a periodic notification. More...
bool | single_shot_id_reinit (const Glib::RefPtr< Gst::ClockID >& id, Gst::ClockTime time)
| Reinitializes the provided single shot id to the provided time. More...
bool | periodic_id_reinit (const Glib::RefPtr< Gst::ClockID >& id, Gst::ClockTime start_time, Gst::ClockTime interval)
| Reinitializes the provided periodic id to the provided start time and interval. More...
Gst::ClockTime | get_internal_time () const
| Gets the current internal time of the given clock. More...
Gst::ClockTime | adjust_unlocked (Gst::ClockTime internal_time)
| Converts the given internal_time clock time to the external time, adjusting for the rate and reference time set with set_calibration() and making sure that the returned time is increasing. More...
Gst::ClockTime | unadjust_unlocked (Gst::ClockTime external_time)
| Converts the given external_time clock time to the internal time of clock, using the rate and reference time set with set_calibration(). More...
Gst::ClockTime | adjust_with_calibration (Gst::ClockTime internal_target, Gst::ClockTime cinternal, Gst::ClockTime cexternal, Gst::ClockTime cnum, Gst::ClockTime cdenom)
| Converts the given internal_target clock time to the external time, using the passed calibration parameters. More...
Gst::ClockTime | unadjust_with_calibration (Gst::ClockTime external_target, Gst::ClockTime cinternal, Gst::ClockTime cexternal, Gst::ClockTime cnum, Gst::ClockTime cdenom)
| Converts the given external_target clock time to the internal time, using the passed calibration parameters. More...
void | get_calibration (Gst::ClockTime&internal, Gst::ClockTime& external, Gst::ClockTime& rate_num, Gst::ClockTime& rate_denom) const
| Gets the internal rate and reference time of clock. More...
void | set_calibration (Gst::ClockTime internal, Gst::ClockTime external, Gst::ClockTime rate_num, Gst::ClockTime rate_denom)
| Adjusts the rate and time of clock. More...
bool | wait_for_sync (Gst::ClockTime timeout)
| Waits until clock is synced for reporting the current time. More...
bool | is_synced () const
| Checks if the clock is currently synced. More...
void | set_synced (bool synced)
| Sets clock to synced and emits the GstClock::synced signal, and wakes up any thread waiting in wait_for_sync(). More...
Glib::PropertyProxy< guint64 > | property_timeout ()
| get/set timeout can be achieved through 'timeout' property, so wrapping gst_clock_{get|set|_timeout is unnecessary. More...
Glib::PropertyProxy_ReadOnly< guint64 > | property_timeout () const
| The amount of time, in nanoseconds, to sample master and slave clocks. More...
Glib::PropertyProxy< int > | property_window_size ()
| The size of the window used to calculate rate and offset. More...
Glib::PropertyProxy_ReadOnly< int > | property_window_size () const
| The size of the window used to calculate rate and offset. More...
Glib::PropertyProxy< int > | property_window_threshold ()
| The threshold to start calculating rate and offset. More...
Glib::PropertyProxy_ReadOnly< int > | property_window_threshold () const
| The threshold to start calculating rate and offset. More...
virtual Gst::ClockTime | change_resolution_vfunc (Gst::ClockTime old_resolution, Gst::ClockTime new_resolution)
| Change the resolution of the clock. More...
virtual Gst::ClockTime | get_resolution_vfunc () const
| Get the resolution of the clock. More...
virtual Gst::ClockTime | get_internal_time_vfunc () const
| Get the internal unadjusted time of the clock. More...
virtual ClockReturn | wait_vfunc (const Glib::RefPtr< Gst::ClockID >& id, Gst::ClockTimeDiff& jitter)
| Perform a blocking wait for the given Gst::ClockID. More...
virtual ClockReturn | wait_async_vfunc (const Glib::RefPtr< Gst::ClockID >& id)
| Perform an asynchronous wait for the given Gst::ClockID. More...
virtual void | unschedule_vfunc (const Glib::RefPtr< Gst::ClockID >& id)
| Unblock a blocking or async wait operation. More...
Glib::SignalProxy< void, bool > | signal_synced ()
Public Member Functions inherited from Gst::Object
| Object (Object&& src) noexcept
Object& | operator= (Object&& src) noexcept
| ~Object () noexcept override
GstObject* | gobj ()
| Provides access to the underlying C GObject. More...
const GstObject* | gobj () const
| Provides access to the underlying C GObject. More...
GstObject* | gobj_copy ()
| Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. More...
bool | is_element () const
bool | is_element_factory () const
bool | is_pad () const
bool | is_pad_template () const
bool | is_bin () const
guint32 | get_flags () const
| Returns the entire set of flags for the object. More...
bool | set_name (const Glib::ustring& name)
| Sets the name of object, or gives object a guaranteed unique name (if name is `nullptr`). More...
Glib::ustring | get_name () const
| Returns a copy of the name of object. More...
bool | set_parent (const Glib::RefPtr< Gst::Object >& parent)
| Sets the parent of object to parent. More...
Glib::RefPtr< Gst::Object > | get_parent ()
| Returns the parent of object. More...
Glib::RefPtr< const Gst::Object > | get_parent () const
| Returns the parent of object. More...
void | unparent ()
| Clear the parent of object, removing the associated reference. More...
void | set_control_rate (Gst::ClockTime control_rate)
| Change the control-rate for this object. More...
Gst::ClockTime | get_control_rate () const
| Obtain the control-rate for this object. More...
Gst::ClockTime | suggest_next_sync () const
| Returns a suggestion for timestamps where buffers should be split to get best controller results. More...
bool | sync_values (Gst::ClockTime timestamp)
| Sets the properties of the object, according to the Gst::ControlSources that (maybe) handle them and for the given timestamp. More...
void | set_control_bindings_disabled (bool disabled)
| This function is used to disable all controlled properties of the object for some time, i.e. sync_values() will do nothing. More...
bool | has_asctive_control_bindings () const
| Check if the object has an active controlled properties. More...
bool | has_ancestor (const Glib::RefPtr< const Gst::Object >& ancestor) const
| Check if object has an ancestor ancestor somewhere up in the hierarchy. More...
bool | has_as_ancestor (const Glib::RefPtr< Gst::Object >& ancestor) const
| Check if object has an ancestor ancestor somewhere up in the hierarchy. More...
bool | has_as_parent (const Glib::RefPtr< Gst::Object >& parent) const
| Check if parent is the parent of object. More...
Glib::ustring | get_path_string ()
| Generates a string describing the path of object in the object hierarchy. More...
Glib::PropertyProxy< Glib::ustring > | property_name ()
| The name of the object. More...
Glib::PropertyProxy_ReadOnly< Glib::ustring > | property_name () const
| The name of the object. More...
Glib::PropertyProxy< Glib::RefPtr< Gst::Object > > | property_parent ()
| The parent of the object. More...
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< Gst::Object > > | property_parent () const
| The parent of the object. More...
Glib::SignalProxy< void, const Glib::RefPtr< Gst::Object >&, GParamSpec*> | signal_deep_notify ()
int | get_refcount () const

## Static Public Member Functions

static GType | get_type ()
| Get the GType for this class, for use with the underlying GObject type system. More...
static Glib::RefPtr< NetClientClock > | create (const Glib::ustring& name, const Glib::ustring& remote_address, int remote_port, Gst::ClockTime base_time)
Static Public Member Functions inherited from Gst::SystemClock
static GType | get_type ()
| Get the GType for this class, for use with the underlying GObject type system. More...
static Glib::RefPtr< Gst::Clock > | obtain ()
| Get a handle to the default system clock. More...
Static Public Member Functions inherited from Gst::Clock
static GType | get_type ()
| Get the GType for this class, for use with the underlying GObject type system. More...
Static Public Member Functions inherited from Gst::Object
static GType | get_type ()
| Get the GType for this class, for use with the underlying GObject type system. More...
static bool | check_uniqueness (const Glib::ListHandle< const Gst::Object >& list, const Glib::ustring& name)
| Checks to see if there is any object named name in list. More...

## Protected Member Functions

| NetClientClock (const Glib::ustring& name, const Glib::ustring& address, int remote_port, Gst::ClockTime base_time)
Protected Member Functions inherited from Gst::SystemClock
| SystemClock ()
Protected Member Functions inherited from Gst::Object
virtual void | on_deep_notify (const Glib::RefPtr< Gst::Object >& prop_object, GParamSpec* prop)
| This is a default handler for the signal signal_deep_notify(). More...

## Related Functions

(Note that these are not member functions.)
Glib::RefPtr< Gst::NetClientClock > | wrap (GstNetClientClock* object, bool take_copy=false)
| A Glib::wrap() method for this object. More...
Related Functions inherited from Gst::SystemClock
Glib::RefPtr< Gst::SystemClock > | wrap (GstSystemClock* object, bool take_copy=false)
| A Glib::wrap() method for this object. More...
Related Functions inherited from Gst::Clock
Glib::RefPtr< Gst::Clock > | wrap (GstClock* object, bool take_copy=false)
| A Glib::wrap() method for this object. More...
Related Functions inherited from Gst::Object
Glib::RefPtr< Gst::Object > | wrap (GstObject* object, bool take_copy=false)
| A Glib::wrap() method for this object. More...

## Detailed Description

Special clock that synchronizes to a remote time provider.

Gst::NetClientClock implements a custom Gst::Clock that synchronizes its time to a remote time provider such as Gst::NetTimeProvider. Gst::NtpClock implements a Gst::Clock that synchronizes its time to a remote NTPv4 server.

A new clock is created with create() or gst_ntp_clock_new(), which takes the address and port of the remote time provider along with a name and an initial time.

This clock will poll the time provider and will update its calibration parameters based on the local and remote observations.

The "round-trip" property limits the maximum round trip packets can take.

Various parameters of the clock can be configured with the parent Gst::Clock "timeout", "window-size" and "window-threshold" object properties.

A Gst::NetClientClock and Gst::NtpClock is typically set on a Gst::Pipeline with Gst::Pipeline::use_clock().

If you set a Gst::Bus on the clock via the "bus" object property, it will send Gst::MESSAGE_ELEMENT messages with an attached Gst::Structure containing statistics about clock accuracy and network traffic.

Last reviewed on 2016-12-02 (1.8.1)

## Constructor & Destructor Documentation

## NetClientClock() [1/2]

Gst::NetClientClock::NetClientClock | ( | NetClientClock&& | src | ) |

noexcept

## ~NetClientClock()

Gst::NetClientClock::~NetClientClock | ( |  | ) |

override noexcept

## NetClientClock() [2/2]

Gst::NetClientClock::NetClientClock | ( | const Glib::ustring & | name,
|  | const Glib::ustring & | address,
|  | int | remote_port,
|  | Gst::ClockTime | base_time
| ) |  |

protected

## Member Function Documentation

## create()

static Glib::RefPtr<NetClientClock> Gst::NetClientClock::create | ( | const Glib::ustring & | name,
|  | const Glib::ustring & | remote_address,
|  | int | remote_port,
|  | Gst::ClockTime | base_time
| ) |  |

static

## get_type()

static GType Gst::NetClientClock::get_type | ( |  | ) |

static

Get the GType for this class, for use with the underlying GObject type system.

## gobj() [1/2]

GstNetClientClock* Gst::NetClientClock::gobj | ( |  | ) |

inline

Provides access to the underlying C GObject.

## gobj() [2/2]

const GstNetClientClock* Gst::NetClientClock::gobj | ( |  | ) | const

inline

Provides access to the underlying C GObject.

## gobj_copy()

GstNetClientClock* Gst::NetClientClock::gobj_copy | ( |  | ) |

Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.

## operator=()

NetClientClock& Gst::NetClientClock::operator= | ( | NetClientClock&& | src | ) |

noexcept

## property_address() [1/2]

Glib::PropertyProxy< Glib::ustring > Gst::NetClientClock::property_address | ( |  | ) |

The IP address of the machine providing a time server.

Returns
  A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

## property_address() [2/2]

Glib::PropertyProxy_ReadOnly< Glib::ustring > Gst::NetClientClock::property_address | ( |  | ) | const

The IP address of the machine providing a time server.

Returns
  A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

## property_base_time()

Glib::PropertyProxy_ReadOnly< guint64 > Gst::NetClientClock::property_base_time | ( |  | ) | const

Initial time that is reported before synchronization.

Returns
  A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

## property_bus() [1/2]

Glib::PropertyProxy< Glib::RefPtr<Gst::Bus> > Gst::NetClientClock::property_bus | ( |  | ) |

A GstBus on which to send clock status information.

Returns
  A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

## property_bus() [2/2]

Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Gst::Bus> > Gst::NetClientClock::property_bus | ( |  | ) | const

A GstBus on which to send clock status information.

Returns
  A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

## property_internal_clock()

Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Gst::Clock> > Gst::NetClientClock::property_internal_clock | ( |  | ) | const

Internal clock that directly slaved to the remote clock.

Returns
  A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

## property_minimum_update_interval() [1/2]

Glib::PropertyProxy< guint64 > Gst::NetClientClock::property_minimum_update_interval | ( |  | ) |

Minimum polling interval for packets, in nanoseconds(0 = no limit).

Returns
  A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

## property_minimum_update_interval() [2/2]

Glib::PropertyProxy_ReadOnly< guint64 > Gst::NetClientClock::property_minimum_update_interval | ( |  | ) | const

Minimum polling interval for packets, in nanoseconds(0 = no limit).

Returns
  A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

## property_port() [1/2]

Glib::PropertyProxy< int > Gst::NetClientClock::property_port | ( |  | ) |

The port on which the remote server is listening.

Returns
  A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

## property_port() [2/2]

Glib::PropertyProxy_ReadOnly< int > Gst::NetClientClock::property_port | ( |  | ) | const

The port on which the remote server is listening.

Returns
  A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

## property_round_trip_limit() [1/2]

Glib::PropertyProxy< guint64 > Gst::NetClientClock::property_round_trip_limit | ( |  | ) |

Maximum tolerable round-trip interval for packets, in nanoseconds (0 = no limit).

Returns
  A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

## property_round_trip_limit() [2/2]

Glib::PropertyProxy_ReadOnly< guint64 > Gst::NetClientClock::property_round_trip_limit | ( |  | ) | const

Maximum tolerable round-trip interval for packets, in nanoseconds (0 = no limit).

Returns
  A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

## Friends And Related Function Documentation

## wrap()

Glib::RefPtr< Gst::NetClientClock > wrap | ( | GstNetClientClock * | object,
|  | bool | take_copy = `false`
| ) |  |

related

A Glib::wrap() method for this object.

Parameters

  object | The C instance.
  take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref.

Returns
  A C++ instance that wraps this C instance.