#include "gstclock.h"
#include "gstinfo.h"
#include "gstutils.h"
+#include "glib-compat-private.h"
#ifndef GST_DISABLE_TRACE
/* #define GST_WITH_ALLOC_TRACE */
/* seqlocks */
#define read_seqbegin(clock) \
- g_atomic_int_get (&clock->ABI.priv->post_count);
+ g_atomic_int_get (&clock->priv->post_count);
static inline gboolean
read_seqretry (GstClock * clock, gint seq)
{
/* no retry if the seqnum did not change */
- if (G_LIKELY (seq == g_atomic_int_get (&clock->ABI.priv->pre_count)))
+ if (G_LIKELY (seq == g_atomic_int_get (&clock->priv->pre_count)))
return FALSE;
/* wait for the writer to finish and retry */
#define write_seqlock(clock) \
G_STMT_START { \
GST_OBJECT_LOCK (clock); \
- g_atomic_int_inc (&clock->ABI.priv->pre_count); \
+ g_atomic_int_inc (&clock->priv->pre_count); \
} G_STMT_END;
#define write_sequnlock(clock) \
G_STMT_START { \
- g_atomic_int_inc (&clock->ABI.priv->post_count); \
+ g_atomic_int_inc (&clock->priv->post_count); \
GST_OBJECT_UNLOCK (clock); \
} G_STMT_END;
static void gst_clock_update_stats (GstClock * clock);
-static GstObjectClass *parent_class = NULL;
-
/* static guint gst_clock_signals[LAST_SIGNAL] = { 0 }; */
static GstClockID
entry = g_slice_new (GstClockEntry);
#ifndef GST_DISABLE_TRACE
- gst_alloc_trace_new (_gst_clock_entry_trace, entry);
+ _gst_alloc_trace_new (_gst_clock_entry_trace, entry);
#endif
GST_CAT_DEBUG_OBJECT (GST_CAT_CLOCK, clock,
"created entry %p, time %" GST_TIME_FORMAT, entry, GST_TIME_ARGS (time));
entry->destroy_data (entry->user_data);
#ifndef GST_DISABLE_TRACE
- gst_alloc_trace_free (_gst_clock_entry_trace, id);
+ _gst_alloc_trace_free (_gst_clock_entry_trace, id);
#endif
g_slice_free (GstClockEntry, id);
}
/*
* GstClock abstract base class implementation
*/
+#define gst_clock_parent_class parent_class
G_DEFINE_TYPE (GstClock, gst_clock, GST_TYPE_OBJECT);
static void
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
- parent_class = g_type_class_peek_parent (klass);
-
#ifndef GST_DISABLE_TRACE
_gst_clock_entry_trace =
- gst_alloc_trace_register (GST_CLOCK_ENTRY_TRACE_NAME);
+ _gst_alloc_trace_register (GST_CLOCK_ENTRY_TRACE_NAME, -1);
#endif
gobject_class->dispose = gst_clock_dispose;
{
clock->last_time = 0;
clock->entries = NULL;
- clock->entries_changed = g_cond_new ();
+ g_cond_init (&clock->entries_changed);
clock->stats = FALSE;
- clock->ABI.priv =
+ clock->priv =
G_TYPE_INSTANCE_GET_PRIVATE (clock, GST_TYPE_CLOCK, GstClockPrivate);
clock->internal_calibration = 0;
clock->rate_numerator = 1;
clock->rate_denominator = 1;
- clock->slave_lock = g_mutex_new ();
+ g_mutex_init (&clock->slave_lock);
clock->window_size = DEFAULT_WINDOW_SIZE;
clock->window_threshold = DEFAULT_WINDOW_THRESHOLD;
clock->filling = TRUE;
clock->times = NULL;
GST_CLOCK_SLAVE_UNLOCK (clock);
- g_cond_free (clock->entries_changed);
- g_mutex_free (clock->slave_lock);
+ g_cond_clear (&clock->entries_changed);
+ g_mutex_clear (&clock->slave_lock);
G_OBJECT_CLASS (parent_class)->finalize (object);
}