Description
GStreamer uses a global clock to synchronise the plugins in a pipeline.
Different clock implementations are possible by implementing this abstract
base class.
The clock time is always measured in nanoseconds, with the clock being set
to 0 when the pipeline goes to READY. Usually all renderers sync to the global
clock so that the clock is always a good measure of the time in the pipeline.
Details
GstClockTime
typedef guint64 GstClockTime; |
A datatype to hold a time, measured in nanoseconds.
GstClockTimeDiff
typedef gint64 GstClockTimeDiff; |
A datatype to hold a timedifference, measured in nanoseconds.
GstClockCallback ()
The function prototype of the callback.
GstClockID
typedef gpointer GstClockID; |
A detatype to hold the handle to an outstanding async clock callback
enum GstClockReturn
typedef enum
{
GST_CLOCK_STOPPED = 0,
GST_CLOCK_TIMEOUT = 1,
GST_CLOCK_EARLY = 2,
GST_CLOCK_ERROR = 3
} GstClockReturn; |
The return value of a clock operation.
GST_CLOCK_TIME_NONE
#define GST_CLOCK_TIME_NONE ((guint64)-1) |
Constant to define an undefined clock time
GST_SECOND
#define GST_SECOND ((guint64)G_USEC_PER_SEC * 1000LL) |
Constant that defines one GStreamer second
GST_MSECOND
#define GST_MSECOND ((guint64)GST_SECOND/1000LL) |
Constant that defines one GStreamer millisecond
GST_USECOND
#define GST_USECOND ((guint64)GST_SECOND/1000000LL) |
Constant that defines one GStreamer microsecond
GST_NSECOND
#define GST_NSECOND ((guint64)GST_SECOND/1000000000LL) |
Constant that defines one GStreamer nanosecond
GST_CLOCK_DIFF()
#define GST_CLOCK_DIFF(s, e) (GstClockTimeDiff)((s)-(e)) |
Calculate a difference between to clock times.
GST_TIMEVAL_TO_TIME()
#define GST_TIMEVAL_TO_TIME(tv) ((tv).tv_sec * GST_SECOND + (tv).tv_usec * GST_USECOND) |
Convert a GTimeVal to a GstClockTime
GST_TIME_TO_TIMEVAL()
#define GST_TIME_TO_TIMEVAL(t,tv) |
Convert a GstClockTime to a GTimeVal
struct GstClock
The opaque data structure of the clock.
gst_clock_set_speed ()
void gst_clock_set_speed (GstClock *clock,
gdouble speed); |
Sets the speed on the given clock. 1.0 is the default
speed.
gst_clock_get_speed ()
gdouble gst_clock_get_speed (GstClock *clock); |
Gets the speed of the given clock.
gst_clock_set_active ()
void gst_clock_set_active (GstClock *clock,
gboolean active); |
Activates or deactivates the clock based on the active parameter.
As soon as the clock is activated, the time will start ticking.
gst_clock_is_active ()
gboolean gst_clock_is_active (GstClock *clock); |
Checks if the given clock is active.
gst_clock_reset ()
Reset the clock to time 0.
gst_clock_handle_discont ()
gboolean gst_clock_handle_discont (GstClock *clock,
guint64 time); |
Notifies the clock of a discontinuity in time.
gst_clock_async_supported ()
gboolean gst_clock_async_supported (GstClock *clock); |
Checks if this clock can support asynchronous notification.
gst_clock_wait ()
Wait and block till the clock reaches the specified time.
The jitter value contains the difference between the requested time and
the actual time, negative values indicate that the requested time
was allready passed when this call was made.
gst_clock_wait_async ()
Register a callback on the given clock that will be triggered
when the clock has reached the given time. A ClockID is returned
that can be used to cancel the request.
gst_clock_cancel_wait_async ()
Cancel an outstanding async notification request with the given ID.
gst_clock_notify_async ()
Register a callback on the given clock that will be periodically
triggered with the specified interval. A ClockID is returned
that can be used to cancel the request.
gst_clock_remove_notify_async ()
Cancel an outstanding async notification request with the given ID.
gst_clock_wait_id ()
Wait and block on the clockid obtained with gst_clock_wait_async.
The jitter value is described in gst_clock_wait().
gst_clock_get_next_id ()
Get the clockid of the next event.
gst_clock_unlock_id ()
Unlock the ClockID.
gst_clock_get_time ()
Gets the current time of the given clock. The time is always
monotonically increasing.
gst_clock_id_get_time ()
Get the time of the clock ID
gst_clock_get_resolution ()
guint64 gst_clock_get_resolution (GstClock *clock); |
Get the accuracy of the clock.
gst_clock_set_resolution ()
void gst_clock_set_resolution (GstClock *clock,
guint64 resolution); |
Set the accuracy of the clock.