gstreamermm: Gst::ClockID Class Reference

gstreamermm 1.10.0

Public Types | Public Member Functions | Protected Member Functions | Related Functions | List of all members
Gst::ClockID Class Reference

A data type to hold the handle to an outstanding sync or async clock callback. More...

`#include <gstreamermm/clock.h>`

## Public Types
typedef sigc::slot< bool, const Glib::RefPtr< Gst::Clock >&, Gst::ClockTime, const Glib::RefPtr< Gst::ClockID >& > | SlotClock
| For example, bool on_clock(const Glib::RefPtr<Gst::Clock>& clock, ClockTime time, const Glib::RefPtr<Gst::ClockID>& id);. More...

## Public Member Functions
void | reference () const
| Increment the reference count for this object. More...
void | unreference () const
| Decrement the reference count for this object. More...
GstClockEntry* | gobj ()
| Provides access to the underlying C instance. More...
const GstClockEntry* | gobj () const
| Provides access to the underlying C instance. More...
GstClockEntry* | gobj_copy () const
| Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. More...
| ClockID ()=delete
| ClockID (const ClockID&)=delete
ClockID& | operator= (const ClockID&)=delete
Gst::ClockTime | get_time () const
| Get the time of the clock ID. More...
ClockReturn | wait (Gst::ClockTimeDiff& jitter)
| Perform a blocking wait on the Gst::ClockID. More...
ClockReturn | wait ()
| A wait() convenience overload. More...
ClockReturn | wait_async (const SlotClock& slot)
| Register a slot on the given Gst::ClockID id with the given slot. More...
void | unschedule ()
| Cancel an outstanding request with id. More...

## Protected Member Functions
void | operator delete (void*, std::size_t)

## Related Functions
(Note that these are not member functions.)
Glib::RefPtr< Gst::ClockID > | wrap (GstClockEntry* object, bool take_copy=false)
| A Glib::wrap() method for this object. More...

## Detailed Description

A data type to hold the handle to an outstanding sync or async clock callback.

## Member Typedef Documentation

## ◆ SlotClock

typedef sigc::slot< bool, const Glib::RefPtr<Gst::Clock>&, Gst::ClockTime, const Glib::RefPtr<Gst::ClockID>& > Gst::ClockID::SlotClock

For example, bool on_clock(const Glib::RefPtr<Gst::Clock>& clock, ClockTime time, const Glib::RefPtr<Gst::ClockID>& id);.

The clock function return value is currently unused (see GstClockCallback).

## Constructor & Destructor Documentation

## ◆ ClockID() [1/2]

Gst::ClockID::ClockID | ( |  | ) |
| delete

## ◆ ClockID() [2/2]

Gst::ClockID::ClockID | ( | const ClockID& |  | ) |
| delete

## Member Function Documentation

## ◆ get_time()

Gst::ClockTime Gst::ClockID::get_time | ( |  | ) | const

Get the time of the clock ID.

Returns
  The time of the given clock id.

MT safe.

## ◆ gobj() [1/2]

GstClockEntry* Gst::ClockID::gobj | ( |  | ) |

Provides access to the underlying C instance.

## ◆ gobj() [2/2]

const GstClockEntry* Gst::ClockID::gobj | ( |  | ) | const

Provides access to the underlying C instance.

## ◆ gobj_copy()

GstClockEntry* Gst::ClockID::gobj_copy | ( |  | ) | const

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

## ◆ operator delete()

void Gst::ClockID::operator delete | ( | void * | ,
|  | std::size_t |
| ) |  |
| protected

## ◆ operator=()

ClockID& Gst::ClockID::operator= | ( | const ClockID& |  | ) |
| delete

## ◆ reference()

void Gst::ClockID::reference | ( |  | ) | const

Increment the reference count for this object.

You should never need to do this manually - use the object via a RefPtr instead.

## ◆ unreference()

void Gst::ClockID::unreference | ( |  | ) | const

Decrement the reference count for this object.

You should never need to do this manually - use the object via a RefPtr instead.

## ◆ unschedule()

void Gst::ClockID::unschedule | ( |  | ) |

Cancel an outstanding request with id.

This can either be an outstanding async notification or a pending sync notification. After this call, id cannot be used anymore to receive sync or async notifications, you need to create a new Gst::ClockID.

MT safe.

## ◆ wait() [1/2]

ClockReturn Gst::ClockID::wait | ( |  | ) |

A wait() convenience overload.

## ◆ wait() [2/2]

ClockReturn Gst::ClockID::wait | ( | Gst::ClockTimeDiff& | jitter | ) |

Perform a blocking wait on the Gst::ClockID.

The Gst::ClockID should have been created with Gst::Clock::create_single_shot_id() or Gst::Clock::create_periodic_id() and should not have been unscheduled with a call to unschedule().

If this function returns Gst::CLOCK_OK or Gst::CLOCK_EARLY, the jitter argument will contain the difference against the clock and the time of the Gst::ClockID when this method was called. Positive values indicate how late the Gst::ClockID was relative to the clock (in which case this function will return Gst::CLOCK_EARLY). Negative values indicate how much time was spent waiting on the clock before this function returned.

Parameters

  jitter | A pointer that will contain the jitter.

Returns
  The result of the blocking wait. Gst::CLOCK_EARLY will be returned if the current clock time is past the time of the Gst::ClockID, Gst::CLOCK_OK if Gst::ClockID was scheduled in time. Gst::CLOCK_UNSCHEDULED if Gst::ClockID was unscheduled with unschedule().

MT safe.

## ◆ wait_async()

ClockReturn Gst::ClockID::wait_async | ( | const SlotClock& | slot | ) |

Register a slot on the given Gst::ClockID id with the given slot.

When passing a Gst::ClockID with an invalid time to this function, the slot will be called immediatly with a time set to Gst::CLOCK_TIME_NONE. The slot will be called when the time of id has been reached.

Parameters

  slot | The slot to callback.

Returns
  The result of the non blocking wait. MT safe.

## Friends And Related Function Documentation

## ◆ wrap()

Glib::RefPtr< Gst::ClockID > wrap | ( | GstClockEntry * | 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.