query: add gst_clear_query()
[platform/upstream/gstreamer.git] / gst / gstclock.c
index 007ceed..dc4af8c 100644 (file)
@@ -249,10 +249,14 @@ gst_clock_entry_new (GstClock * clock, GstClockTime time,
       "created entry %p, time %" GST_TIME_FORMAT, entry, GST_TIME_ARGS (time));
 
   entry->refcount = 1;
+#ifndef GST_REMOVE_DEPRECATED
 #ifndef GST_DISABLE_DEPRECATED
   entry->clock = clock;
+#else
+  entry->_clock = clock;
 #endif
-  g_weak_ref_init (&entry->ABI.clock, clock);
+#endif
+  g_weak_ref_init (&entry->ABI.abi.clock, clock);
   entry->type = type;
   entry->time = time;
   entry->interval = interval;
@@ -358,7 +362,7 @@ _gst_clock_id_free (GstClockID id)
   if (entry->destroy_data)
     entry->destroy_data (entry->user_data);
 
-  g_weak_ref_clear (&entry->ABI.clock);
+  g_weak_ref_clear (&entry->ABI.abi.clock);
 
   /* FIXME: add tracer hook for struct allocations such as clock entries */
 
@@ -532,7 +536,7 @@ gst_clock_id_wait (GstClockID id, GstClockTimeDiff * jitter)
   entry = (GstClockEntry *) id;
   requested = GST_CLOCK_ENTRY_TIME (entry);
 
-  clock = g_weak_ref_get (&entry->ABI.clock);
+  clock = g_weak_ref_get (&entry->ABI.abi.clock);
   if (G_UNLIKELY (clock == NULL))
     goto invalid_entry;
 
@@ -616,7 +620,7 @@ gst_clock_id_wait_async (GstClockID id,
 
   entry = (GstClockEntry *) id;
   requested = GST_CLOCK_ENTRY_TIME (entry);
-  clock = g_weak_ref_get (&entry->ABI.clock);
+  clock = g_weak_ref_get (&entry->ABI.abi.clock);
   if (G_UNLIKELY (clock == NULL))
     goto invalid_entry;
 
@@ -681,7 +685,7 @@ gst_clock_id_unschedule (GstClockID id)
   g_return_if_fail (id != NULL);
 
   entry = (GstClockEntry *) id;
-  clock = g_weak_ref_get (&entry->ABI.clock);
+  clock = g_weak_ref_get (&entry->ABI.abi.clock);
   if (G_UNLIKELY (clock == NULL))
     goto invalid_entry;
 
@@ -1385,6 +1389,8 @@ gst_clock_get_master (GstClock * clock)
  *     underlying clock has been freed.  Unref after usage.
  *
  * MT safe.
+ *
+ * Since: 1.16
  */
 GstClock *
 gst_clock_id_get_clock (GstClockID id)
@@ -1394,14 +1400,14 @@ gst_clock_id_get_clock (GstClockID id)
   g_return_val_if_fail (id != NULL, NULL);
 
   entry = (GstClockEntry *) id;
-  return g_weak_ref_get (&entry->ABI.clock);
+  return g_weak_ref_get (&entry->ABI.abi.clock);
 }
 
 /**
  * gst_clock_id_uses_clock:
  * @id: a #GstClockID to check
  * @clock: a #GstClock to compare against
- * 
+ *
  * This function returns whether @id uses @clock as the underlying clock.
  * @clock can be NULL, in which case the return value indicates whether
  * the underlying clock has been freed.  If this is the case, the @id is
@@ -1410,6 +1416,8 @@ gst_clock_id_get_clock (GstClockID id)
  * Returns: whether the clock @id uses the same underlying #GstClock @clock.
  *
  * MT safe.
+ *
+ * Since: 1.16
  */
 gboolean
 gst_clock_id_uses_clock (GstClockID id, GstClock * clock)
@@ -1419,9 +1427,10 @@ gst_clock_id_uses_clock (GstClockID id, GstClock * clock)
   gboolean ret = FALSE;
 
   g_return_val_if_fail (id != NULL, FALSE);
+  g_return_val_if_fail (clock != NULL, FALSE);
 
   entry = (GstClockEntry *) id;
-  entry_clock = g_weak_ref_get (&entry->ABI.clock);
+  entry_clock = g_weak_ref_get (&entry->ABI.abi.clock);
   if (entry_clock == clock)
     ret = TRUE;