GstSystemClock

GstSystemClock — Default clock that uses the current system time

Synopsis

#include <gst/gst.h>

enum                GstClockType;
struct              GstSystemClock;
GstClock *          gst_system_clock_obtain             (void);
void                gst_system_clock_set_default        (GstClock *new_clock);

Object Hierarchy

  GObject
   +----GInitiallyUnowned
         +----GstObject
               +----GstClock
                     +----GstSystemClock

Properties

  "clock-type"               GstClockType          : Read / Write

Description

The GStreamer core provides a GstSystemClock based on the system time. Asynchronous callbacks are scheduled from an internal thread.

Clock implementors are encouraged to subclass this systemclock as it implements the async notification.

Subclasses can however override all of the important methods for sync and async notifications to implement their own callback methods or blocking wait operations.

Details

enum GstClockType

typedef enum {
  GST_CLOCK_TYPE_REALTIME       = 0,
  GST_CLOCK_TYPE_MONOTONIC      = 1,
  GST_CLOCK_TYPE_OTHER          = 2
} GstClockType;

The different kind of clocks.

GST_CLOCK_TYPE_REALTIME

time since Epoch

GST_CLOCK_TYPE_MONOTONIC

monotonic time since some unspecified starting point

GST_CLOCK_TYPE_OTHER

some other time source is used (Since 1.0.5)

struct GstSystemClock

struct GstSystemClock;

The default implementation of a GstClock that uses the system time.


gst_system_clock_obtain ()

GstClock *          gst_system_clock_obtain             (void);

Get a handle to the default system clock. The refcount of the clock will be increased so you need to unref the clock after usage.

Returns :

the default clock. MT safe. [transfer full]

gst_system_clock_set_default ()

void                gst_system_clock_set_default        (GstClock *new_clock);

Sets the default system clock that can be obtained with gst_system_clock_obtain().

This is mostly used for testing and debugging purposes when you want to have control over the time reported by the default system clock.

MT safe.

new_clock :

a GstClock

Since 1.4

Property Details

The "clock-type" property

  "clock-type"               GstClockType          : Read / Write

The type of underlying clock implementation used.

Default value: GST_CLOCK_TYPE_MONOTONIC

See Also

GstClock