mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 19:51:11 +00:00
gst/gstclock.*: Change resolution to be a GstClockTime.
Original commit message from CVS: 2005-11-19 Andy Wingo <wingo@pobox.com> * gst/gstclock.h: * gst/gstclock.c (GstClock, GstClockClass): Change resolution to be a GstClockTime. (gst_clock_set_resolution, gst_clock_get_resolution): Resolution is a GstClockTime. Fixes #321710.
This commit is contained in:
parent
c0b753f74f
commit
f082cb34a4
3 changed files with 24 additions and 16 deletions
|
@ -1,5 +1,11 @@
|
|||
2005-11-19 Andy Wingo <wingo@pobox.com>
|
||||
|
||||
* gst/gstclock.h:
|
||||
* gst/gstclock.c (GstClock, GstClockClass): Change resolution to
|
||||
be a GstClockTime.
|
||||
(gst_clock_set_resolution, gst_clock_get_resolution): Resolution
|
||||
is a GstClockTime. Fixes #321710.
|
||||
|
||||
* gst/gstclock.h (GstClock): Remove offset property. Add
|
||||
internal_calibration and external_calibration. Fix padding. Pad
|
||||
also by GstClockTime so we don't run into problems.
|
||||
|
|
|
@ -549,20 +549,20 @@ gst_clock_finalize (GObject * object)
|
|||
|
||||
/**
|
||||
* gst_clock_set_resolution
|
||||
* @clock: The clock set the resolution on
|
||||
* @clock: a #GstClock
|
||||
* @resolution: The resolution to set
|
||||
*
|
||||
* Set the accuracy of the clock.
|
||||
*
|
||||
* Returns: the new resolution of the clock.
|
||||
*/
|
||||
guint64
|
||||
gst_clock_set_resolution (GstClock * clock, guint64 resolution)
|
||||
GstClockTime
|
||||
gst_clock_set_resolution (GstClock * clock, GstClockTime resolution)
|
||||
{
|
||||
GstClockClass *cclass;
|
||||
|
||||
g_return_val_if_fail (GST_IS_CLOCK (clock), G_GINT64_CONSTANT (0));
|
||||
g_return_val_if_fail (resolution != 0, G_GINT64_CONSTANT (0));
|
||||
g_return_val_if_fail (GST_IS_CLOCK (clock), 0);
|
||||
g_return_val_if_fail (resolution != 0, 0);
|
||||
|
||||
cclass = GST_CLOCK_GET_CLASS (clock);
|
||||
|
||||
|
@ -575,27 +575,27 @@ gst_clock_set_resolution (GstClock * clock, guint64 resolution)
|
|||
|
||||
/**
|
||||
* gst_clock_get_resolution
|
||||
* @clock: The clock get the resolution of
|
||||
* @clock: a #GstClock
|
||||
*
|
||||
* Get the accuracy of the clock.
|
||||
*
|
||||
* Returns: the resolution of the clock in microseconds.
|
||||
* Returns: the resolution of the clock in units of #GstClockTime.
|
||||
*
|
||||
* MT safe.
|
||||
*/
|
||||
guint64
|
||||
GstClockTime
|
||||
gst_clock_get_resolution (GstClock * clock)
|
||||
{
|
||||
GstClockClass *cclass;
|
||||
|
||||
g_return_val_if_fail (GST_IS_CLOCK (clock), G_GINT64_CONSTANT (0));
|
||||
g_return_val_if_fail (GST_IS_CLOCK (clock), 0);
|
||||
|
||||
cclass = GST_CLOCK_GET_CLASS (clock);
|
||||
|
||||
if (cclass->get_resolution)
|
||||
return cclass->get_resolution (clock);
|
||||
|
||||
return G_GINT64_CONSTANT (1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -381,7 +381,7 @@ struct _GstClock {
|
|||
GCond *entries_changed;
|
||||
|
||||
/*< private >*/
|
||||
guint64 resolution;
|
||||
GstClockTime resolution;
|
||||
gboolean stats;
|
||||
|
||||
GstClockTime _gst_reserved[GST_PADDING];
|
||||
|
@ -392,9 +392,10 @@ struct _GstClockClass {
|
|||
|
||||
/*< protected >*/
|
||||
/* vtable */
|
||||
guint64 (*change_resolution) (GstClock *clock, guint64 old_resolution,
|
||||
guint64 new_resolution);
|
||||
guint64 (*get_resolution) (GstClock *clock);
|
||||
GstClockTime (*change_resolution) (GstClock *clock,
|
||||
GstClockTime old_resolution,
|
||||
GstClockTime new_resolution);
|
||||
GstClockTime (*get_resolution) (GstClock *clock);
|
||||
|
||||
GstClockTime (*get_internal_time) (GstClock *clock);
|
||||
|
||||
|
@ -409,8 +410,9 @@ struct _GstClockClass {
|
|||
|
||||
GType gst_clock_get_type (void);
|
||||
|
||||
guint64 gst_clock_set_resolution (GstClock *clock, guint64 resolution);
|
||||
guint64 gst_clock_get_resolution (GstClock *clock);
|
||||
GstClockTime gst_clock_set_resolution (GstClock *clock,
|
||||
GstClockTime resolution);
|
||||
GstClockTime gst_clock_get_resolution (GstClock *clock);
|
||||
|
||||
GstClockTime gst_clock_get_time (GstClock *clock);
|
||||
void gst_clock_set_calibration (GstClock *clock, GstClockTime internal,
|
||||
|
|
Loading…
Reference in a new issue