]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/gstreamer0-10.git/commitdiff
Work around deprecated thread API in glib master
authorTim-Philipp Müller <tim.muller@collabora.co.uk>
Sun, 4 Dec 2011 13:35:38 +0000 (13:35 +0000)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Sun, 4 Dec 2011 13:35:38 +0000 (13:35 +0000)
Add private replacements for deprecated functions such as
g_mutex_new(), g_mutex_free(), g_cond_new() etc., mostly
to avoid the deprecation warnings. We can't change most of
these in 0.10 because they're part of our API and ABI.

20 files changed:
gst/glib-compat-private.h
gst/gstbus.c
gst/gstclock.c
gst/gstelement.c
gst/gstobject.h
gst/gsttask.c
libs/gst/base/gstbaseparse.c
libs/gst/base/gstbasesrc.c
libs/gst/base/gstbasetransform.c
libs/gst/base/gstcollectpads.c
libs/gst/base/gstcollectpads2.c
libs/gst/base/gstdataqueue.c
libs/gst/check/gstcheck.h
libs/gst/controller/gstcontroller.c
libs/gst/controller/gstinterpolationcontrolsource.c
libs/gst/controller/gstlfocontrolsource.c
plugins/elements/gstinputselector.c
plugins/elements/gstqueue.c
plugins/elements/gstqueue2.c
plugins/elements/gsttee.c

index 7b5d6cf860fb93f4c5e634a9a757599789dfae47..d143d3257dbc07467d6f8faf7225a05591fcae47 100644 (file)
@@ -48,6 +48,71 @@ typedef struct stat GStatBuf;
 
 /* copies */
 
 
 /* copies */
 
+#if GLIB_CHECK_VERSION (2, 31, 0)
+#define g_mutex_new gst_g_mutex_new
+static inline GMutex *
+gst_g_mutex_new (void)
+{
+  GMutex *mutex = g_slice_new (GMutex);
+  g_mutex_init (mutex);
+  return mutex;
+}
+#define g_mutex_free gst_g_mutex_free
+static inline void
+gst_g_mutex_free (GMutex *mutex)
+{
+  g_mutex_clear (mutex);
+  g_slice_free (GMutex, mutex);
+}
+#define g_static_rec_mutex_init gst_g_static_rec_mutex_init
+static inline void
+gst_g_static_rec_mutex_init (GStaticRecMutex *mutex)
+{
+  static const GStaticRecMutex init_mutex = G_STATIC_REC_MUTEX_INIT;
+
+  *mutex = init_mutex;
+}
+#define g_cond_new gst_g_cond_new
+static inline GCond *
+gst_g_cond_new (void)
+{
+  GCond *cond = g_slice_new (GCond);
+  g_cond_init (cond);
+  return cond;
+}
+#define g_cond_free gst_g_cond_free
+static inline void
+gst_g_cond_free (GCond *cond)
+{
+  g_cond_clear (cond);
+  g_slice_free (GCond, cond);
+}
+#define g_cond_timed_wait gst_g_cond_timed_wait
+static inline gboolean
+gst_g_cond_timed_wait (GCond *cond, GMutex *mutex, GTimeVal *abs_time)
+{
+  gint64 end_time;
+
+  if (abs_time == NULL) {
+    g_cond_wait (cond, mutex);
+    return TRUE;
+  }
+
+  end_time = abs_time->tv_sec;
+  end_time *= 1000000;
+  end_time += abs_time->tv_usec;
+
+  /* would be nice if we had clock_rtoffset, but that didn't seem to
+   * make it into the kernel yet...
+   */
+  /* if CLOCK_MONOTONIC is not defined then g_get_montonic_time() and
+   * g_get_real_time() are returning the same clock and we'd add ~0
+   */
+  end_time += g_get_monotonic_time () - g_get_real_time ();
+  return g_cond_wait_until (cond, mutex, end_time);
+}
+#endif /* GLIB_CHECK_VERSION (2, 31, 0) */
+
 /* adaptations */
 
 G_END_DECLS
 /* adaptations */
 
 G_END_DECLS
index 42c66def54520ce2e021c2b575aaac25a4ce50e0..b80420b9ded635f5de7670e79c5b29bda480e00c 100644 (file)
@@ -77,6 +77,7 @@
 #include "gstinfo.h"
 
 #include "gstbus.h"
 #include "gstinfo.h"
 
 #include "gstbus.h"
+#include "glib-compat-private.h"
 
 #define GST_CAT_DEFAULT GST_CAT_BUS
 /* bus signals */
 
 #define GST_CAT_DEFAULT GST_CAT_BUS
 /* bus signals */
index 45f503e731661711c791cc6ce8574699676dcd58..bd2eb8f23c5c3922be343273a3283826671c9c0e 100644 (file)
 #include "gstclock.h"
 #include "gstinfo.h"
 #include "gstutils.h"
 #include "gstclock.h"
 #include "gstinfo.h"
 #include "gstutils.h"
+#include "glib-compat-private.h"
 
 #ifndef GST_DISABLE_TRACE
 /* #define GST_WITH_ALLOC_TRACE */
 
 #ifndef GST_DISABLE_TRACE
 /* #define GST_WITH_ALLOC_TRACE */
index afa25b9d3717cbe247c5606cf9bbd57e73886cc7..6577428d70b1990a029fed09acdbf1460252ac9c 100644 (file)
@@ -95,6 +95,7 @@
 #include "gstinfo.h"
 #include "gstvalue.h"
 #include "gst-i18n-lib.h"
 #include "gstinfo.h"
 #include "gstvalue.h"
 #include "gst-i18n-lib.h"
+#include "glib-compat-private.h"
 
 /* Element signals and args */
 enum
 
 /* Element signals and args */
 enum
index b9c5206d4b2f450816dfce8e3f007f4f1fd6cbaa..a522aeebb49c1263584b891502dd3cf2d10645a4 100644 (file)
@@ -215,29 +215,48 @@ struct _GstObject {
  *
  * This macro will return the class lock used to protect deep_notify signal
  * emission on thread-unsafe glib versions (glib < 2.8).
  *
  * This macro will return the class lock used to protect deep_notify signal
  * emission on thread-unsafe glib versions (glib < 2.8).
+ *
+ * Deprecated: 0.10.36: Don't use this, it's not needed any longer.
  */
  */
+#ifndef GST_DISABLE_DEPRECATED
 #define GST_CLASS_GET_LOCK(obj)         (GST_OBJECT_CLASS_CAST(obj)->lock)
 #define GST_CLASS_GET_LOCK(obj)         (GST_OBJECT_CLASS_CAST(obj)->lock)
+#endif
+
 /**
  * GST_CLASS_LOCK:
  * @obj: a #GstObjectClass
  *
  * Lock the class.
 /**
  * GST_CLASS_LOCK:
  * @obj: a #GstObjectClass
  *
  * Lock the class.
+ *
+ * Deprecated: 0.10.36: Don't use this, it's not needed any longer.
  */
  */
+#ifndef GST_DISABLE_DEPRECATED
 #define GST_CLASS_LOCK(obj)             (g_static_rec_mutex_lock(GST_CLASS_GET_LOCK(obj)))
 #define GST_CLASS_LOCK(obj)             (g_static_rec_mutex_lock(GST_CLASS_GET_LOCK(obj)))
+#endif
+
 /**
  * GST_CLASS_TRYLOCK:
  * @obj: a #GstObjectClass
  *
  * Try to lock the class, returns TRUE if class could be locked.
 /**
  * GST_CLASS_TRYLOCK:
  * @obj: a #GstObjectClass
  *
  * Try to lock the class, returns TRUE if class could be locked.
+ *
+ * Deprecated: 0.10.36: Don't use this, it's not needed any longer.
  */
  */
+#ifndef GST_DISABLE_DEPRECATED
 #define GST_CLASS_TRYLOCK(obj)          (g_static_rec_mutex_trylock(GST_CLASS_GET_LOCK(obj)))
 #define GST_CLASS_TRYLOCK(obj)          (g_static_rec_mutex_trylock(GST_CLASS_GET_LOCK(obj)))
+#endif
+
 /**
  * GST_CLASS_UNLOCK:
  * @obj: a #GstObjectClass
  *
  * Unlock the class.
 /**
  * GST_CLASS_UNLOCK:
  * @obj: a #GstObjectClass
  *
  * Unlock the class.
+ *
+ * Deprecated: 0.10.36: Don't use this, it's not needed any longer.
  */
  */
+#ifndef GST_DISABLE_DEPRECATED
 #define GST_CLASS_UNLOCK(obj)           (g_static_rec_mutex_unlock(GST_CLASS_GET_LOCK(obj)))
 #define GST_CLASS_UNLOCK(obj)           (g_static_rec_mutex_unlock(GST_CLASS_GET_LOCK(obj)))
+#endif
 
 /**
  * GstObjectClass:
 
 /**
  * GstObjectClass:
index e06e0d69176eaf330dfe744ce32c99485841d887..c66c7b760c57db82acde38e0722b72e6002b0092 100644 (file)
@@ -72,6 +72,7 @@
 
 #include "gstinfo.h"
 #include "gsttask.h"
 
 #include "gstinfo.h"
 #include "gsttask.h"
+#include "glib-compat-private.h"
 
 #include <stdio.h>
 
 
 #include <stdio.h>
 
@@ -276,8 +277,13 @@ gst_task_func (GstTask * task)
     goto no_lock;
   task->abidata.ABI.thread = tself;
   /* only update the priority when it was changed */
     goto no_lock;
   task->abidata.ABI.thread = tself;
   /* only update the priority when it was changed */
-  if (priv->prio_set)
+  if (priv->prio_set) {
+#if !GLIB_CHECK_VERSION (2, 31, 0)
     g_thread_set_priority (tself, priv->priority);
     g_thread_set_priority (tself, priv->priority);
+#else
+    GST_INFO_OBJECT (task, "Thread priorities no longer have any effect");
+#endif
+  }
   GST_OBJECT_UNLOCK (task);
 
   /* fire the enter_thread callback when we need to */
   GST_OBJECT_UNLOCK (task);
 
   /* fire the enter_thread callback when we need to */
@@ -333,7 +339,9 @@ exit:
   } else {
     /* restore normal priority when releasing back into the pool, we will not
      * touch the priority when a custom callback has been installed. */
   } else {
     /* restore normal priority when releasing back into the pool, we will not
      * touch the priority when a custom callback has been installed. */
+#if !GLIB_CHECK_VERSION (2, 31, 0)
     g_thread_set_priority (tself, G_THREAD_PRIORITY_NORMAL);
     g_thread_set_priority (tself, G_THREAD_PRIORITY_NORMAL);
+#endif
   }
   /* now we allow messing with the lock again by setting the running flag to
    * FALSE. Together with the SIGNAL this is the sign for the _join() to
   }
   /* now we allow messing with the lock again by setting the running flag to
    * FALSE. Together with the SIGNAL this is the sign for the _join() to
@@ -475,7 +483,11 @@ gst_task_set_priority (GstTask * task, GThreadPriority priority)
   if (thread != NULL) {
     /* if this task already has a thread, we can configure the priority right
      * away, else we do that when we assign a thread to the task. */
   if (thread != NULL) {
     /* if this task already has a thread, we can configure the priority right
      * away, else we do that when we assign a thread to the task. */
+#if !GLIB_CHECK_VERSION (2, 31, 0)
     g_thread_set_priority (thread, priority);
     g_thread_set_priority (thread, priority);
+#else
+    GST_INFO_OBJECT (task, "Thread priorities no longer have any effect");
+#endif
   }
   GST_OBJECT_UNLOCK (task);
 }
   }
   GST_OBJECT_UNLOCK (task);
 }
index 308bb8a8955d8329abb3d409ede9efa6c29670c3..3cd4db50782315ce44d243600d0cf8d6f85d4e14 100644 (file)
@@ -284,7 +284,11 @@ struct _GstBaseParsePrivate
   GstIndex *index;
   gint index_id;
   gboolean own_index;
   GstIndex *index;
   gint index_id;
   gboolean own_index;
+#if !GLIB_CHECK_VERSION (2, 31, 0)
   GStaticMutex index_lock;
   GStaticMutex index_lock;
+#else
+  GMutex index_lock;
+#endif
 
   /* seek table entries only maintained if upstream is BYTE seekable */
   gboolean upstream_seekable;
 
   /* seek table entries only maintained if upstream is BYTE seekable */
   gboolean upstream_seekable;
@@ -333,6 +337,18 @@ typedef struct _GstBaseParseSeek
   GstClockTime start_ts;
 } GstBaseParseSeek;
 
   GstClockTime start_ts;
 } GstBaseParseSeek;
 
+#if !GLIB_CHECK_VERSION (2, 31, 0)
+#define GST_BASE_PARSE_INDEX_LOCK(parse) \
+  g_static_mutex_lock (&parse->priv->index_lock);
+#define GST_BASE_PARSE_INDEX_UNLOCK(parse) \
+  g_static_mutex_unlock (&parse->priv->index_lock);
+#else
+#define GST_BASE_PARSE_INDEX_LOCK(parse) \
+  g_mutex_lock (&parse->priv->index_lock);
+#define GST_BASE_PARSE_INDEX_UNLOCK(parse) \
+  g_mutex_unlock (&parse->priv->index_lock);
+#endif
+
 static GstElementClass *parent_class = NULL;
 
 static void gst_base_parse_class_init (GstBaseParseClass * klass);
 static GstElementClass *parent_class = NULL;
 
 static void gst_base_parse_class_init (GstBaseParseClass * klass);
@@ -474,8 +490,11 @@ gst_base_parse_finalize (GObject * object)
     gst_object_unref (parse->priv->index);
     parse->priv->index = NULL;
   }
     gst_object_unref (parse->priv->index);
     parse->priv->index = NULL;
   }
-
+#if !GLIB_CHECK_VERSION (2, 31, 0)
   g_static_mutex_free (&parse->priv->index_lock);
   g_static_mutex_free (&parse->priv->index_lock);
+#else
+  g_mutex_clear (&parse->priv->index_lock);
+#endif
 
   gst_base_parse_clear_queues (parse);
 
 
   gst_base_parse_clear_queues (parse);
 
@@ -560,7 +579,11 @@ gst_base_parse_init (GstBaseParse * parse, GstBaseParseClass * bclass)
 
   parse->priv->pad_mode = GST_ACTIVATE_NONE;
 
 
   parse->priv->pad_mode = GST_ACTIVATE_NONE;
 
+#if !GLIB_CHECK_VERSION (2, 31, 0)
   g_static_mutex_init (&parse->priv->index_lock);
   g_static_mutex_init (&parse->priv->index_lock);
+#else
+  g_mutex_init (&parse->priv->index_lock);
+#endif
 
   /* init state */
   gst_base_parse_reset (parse);
 
   /* init state */
   gst_base_parse_reset (parse);
@@ -1488,11 +1511,11 @@ gst_base_parse_add_index_entry (GstBaseParse * parse, guint64 offset,
   associations[1].value = offset;
 
   /* index might change on-the-fly, although that would be nutty app ... */
   associations[1].value = offset;
 
   /* index might change on-the-fly, although that would be nutty app ... */
-  g_static_mutex_lock (&parse->priv->index_lock);
+  GST_BASE_PARSE_INDEX_LOCK (parse);
   gst_index_add_associationv (parse->priv->index, parse->priv->index_id,
       (key) ? GST_ASSOCIATION_FLAG_KEY_UNIT : GST_ASSOCIATION_FLAG_DELTA_UNIT,
       2, (const GstIndexAssociation *) &associations);
   gst_index_add_associationv (parse->priv->index, parse->priv->index_id,
       (key) ? GST_ASSOCIATION_FLAG_KEY_UNIT : GST_ASSOCIATION_FLAG_DELTA_UNIT,
       2, (const GstIndexAssociation *) &associations);
-  g_static_mutex_unlock (&parse->priv->index_lock);
+  GST_BASE_PARSE_INDEX_UNLOCK (parse);
 
   if (key) {
     parse->priv->index_last_offset = offset;
 
   if (key) {
     parse->priv->index_last_offset = offset;
@@ -3632,7 +3655,7 @@ gst_base_parse_find_offset (GstBaseParse * parse, GstClockTime time,
     goto exit;
   }
 
     goto exit;
   }
 
-  g_static_mutex_lock (&parse->priv->index_lock);
+  GST_BASE_PARSE_INDEX_LOCK (parse);
   if (parse->priv->index) {
     /* Let's check if we have an index entry for that time */
     entry = gst_index_get_assoc_entry (parse->priv->index,
   if (parse->priv->index) {
     /* Let's check if we have an index entry for that time */
     entry = gst_index_get_assoc_entry (parse->priv->index,
@@ -3656,7 +3679,7 @@ gst_base_parse_find_offset (GstBaseParse * parse, GstClockTime time,
       ts = GST_CLOCK_TIME_NONE;
     }
   }
       ts = GST_CLOCK_TIME_NONE;
     }
   }
-  g_static_mutex_unlock (&parse->priv->index_lock);
+  GST_BASE_PARSE_INDEX_UNLOCK (parse);
 
 exit:
   if (_ts)
 
 exit:
   if (_ts)
@@ -4007,7 +4030,7 @@ gst_base_parse_set_index (GstElement * element, GstIndex * index)
 {
   GstBaseParse *parse = GST_BASE_PARSE (element);
 
 {
   GstBaseParse *parse = GST_BASE_PARSE (element);
 
-  g_static_mutex_lock (&parse->priv->index_lock);
+  GST_BASE_PARSE_INDEX_LOCK (parse);
   if (parse->priv->index)
     gst_object_unref (parse->priv->index);
   if (index) {
   if (parse->priv->index)
     gst_object_unref (parse->priv->index);
   if (index) {
@@ -4018,7 +4041,7 @@ gst_base_parse_set_index (GstElement * element, GstIndex * index)
   } else {
     parse->priv->index = NULL;
   }
   } else {
     parse->priv->index = NULL;
   }
-  g_static_mutex_unlock (&parse->priv->index_lock);
+  GST_BASE_PARSE_INDEX_UNLOCK (parse);
 }
 
 static GstIndex *
 }
 
 static GstIndex *
@@ -4027,10 +4050,10 @@ gst_base_parse_get_index (GstElement * element)
   GstBaseParse *parse = GST_BASE_PARSE (element);
   GstIndex *result = NULL;
 
   GstBaseParse *parse = GST_BASE_PARSE (element);
   GstIndex *result = NULL;
 
-  g_static_mutex_lock (&parse->priv->index_lock);
+  GST_BASE_PARSE_INDEX_LOCK (parse);
   if (parse->priv->index)
     result = gst_object_ref (parse->priv->index);
   if (parse->priv->index)
     result = gst_object_ref (parse->priv->index);
-  g_static_mutex_unlock (&parse->priv->index_lock);
+  GST_BASE_PARSE_INDEX_UNLOCK (parse);
 
   return result;
 }
 
   return result;
 }
@@ -4047,7 +4070,7 @@ gst_base_parse_change_state (GstElement * element, GstStateChange transition)
     case GST_STATE_CHANGE_READY_TO_PAUSED:
       /* If this is our own index destroy it as the
        * old entries might be wrong for the new stream */
     case GST_STATE_CHANGE_READY_TO_PAUSED:
       /* If this is our own index destroy it as the
        * old entries might be wrong for the new stream */
-      g_static_mutex_lock (&parse->priv->index_lock);
+      GST_BASE_PARSE_INDEX_LOCK (parse);
       if (parse->priv->own_index) {
         gst_object_unref (parse->priv->index);
         parse->priv->index = NULL;
       if (parse->priv->own_index) {
         gst_object_unref (parse->priv->index);
         parse->priv->index = NULL;
@@ -4063,7 +4086,7 @@ gst_base_parse_change_state (GstElement * element, GstStateChange transition)
             &parse->priv->index_id);
         parse->priv->own_index = TRUE;
       }
             &parse->priv->index_id);
         parse->priv->own_index = TRUE;
       }
-      g_static_mutex_unlock (&parse->priv->index_lock);
+      GST_BASE_PARSE_INDEX_UNLOCK (parse);
       break;
     default:
       break;
       break;
     default:
       break;
index f0609a19536f2daa8616612e321a5111fc441e04..cc9631ab21e0157ff31f89a76cf5a612f9be5d60 100644 (file)
 #include <string.h>
 
 #include <gst/gst_private.h>
 #include <string.h>
 
 #include <gst/gst_private.h>
+#include <gst/glib-compat-private.h>
 
 #include "gstbasesrc.h"
 #include "gsttypefindhelper.h"
 
 #include "gstbasesrc.h"
 #include "gsttypefindhelper.h"
index fbed6578849548be2bd2a8d093e9f45953a33295..6946ae97cb3eeb2ee81a34c65b038a837ea2b5dd 100644 (file)
 
 #include "../../../gst/gst_private.h"
 #include "../../../gst/gst-i18n-lib.h"
 
 #include "../../../gst/gst_private.h"
 #include "../../../gst/gst-i18n-lib.h"
+#include "../../../gst/glib-compat-private.h"
 #include "gstbasetransform.h"
 #include <gst/gstmarshal.h>
 
 #include "gstbasetransform.h"
 #include <gst/gstmarshal.h>
 
index 004508d3216bee415d40764fa19e0d836f811462..7fb0bf42bd792dc8bd96cfa033d3975699fd15b7 100644 (file)
@@ -73,6 +73,7 @@
  */
 
 #include "gstcollectpads.h"
  */
 
 #include "gstcollectpads.h"
+#include "gst/glib-compat-private.h"
 
 GST_DEBUG_CATEGORY_STATIC (collect_pads_debug);
 #define GST_CAT_DEFAULT collect_pads_debug
 
 GST_DEBUG_CATEGORY_STATIC (collect_pads_debug);
 #define GST_CAT_DEFAULT collect_pads_debug
index f549bef4107490faa6b4998cfddf73a7ab4e486b..fbd6150d0e36907bb5b2e154834969dca9a0dbd6 100644 (file)
@@ -84,6 +84,8 @@
 
 #include "gstcollectpads2.h"
 
 
 #include "gstcollectpads2.h"
 
+#include "../../../gst/glib-compat-private.h"
+
 GST_DEBUG_CATEGORY_STATIC (collect_pads2_debug);
 #define GST_CAT_DEFAULT collect_pads2_debug
 
 GST_DEBUG_CATEGORY_STATIC (collect_pads2_debug);
 #define GST_CAT_DEFAULT collect_pads2_debug
 
index f6b11177cb360903340875caee2fbfb43607c937..2d325e3e4141b4ba6f2fb6b80035dcd5dd044c1b 100644 (file)
@@ -33,6 +33,7 @@
 #include <gst/gst.h>
 #include "string.h"
 #include "gstdataqueue.h"
 #include <gst/gst.h>
 #include "string.h"
 #include "gstdataqueue.h"
+#include "gst/glib-compat-private.h"
 
 GST_DEBUG_CATEGORY_STATIC (data_queue_debug);
 #define GST_CAT_DEFAULT (data_queue_debug)
 
 GST_DEBUG_CATEGORY_STATIC (data_queue_debug);
 #define GST_CAT_DEFAULT (data_queue_debug)
index e77c007bce3783f370ff579e4aa31b4e23dfc7f6..46bf6c5422afa474243fdf0fe6ba36175fdb3bb8 100644 (file)
@@ -286,6 +286,68 @@ gst_g_thread_create (GThreadFunc func, gpointer data, gboolean joinable,
   g_assert (joinable);
   return g_thread_try_new ("gst-check", func, data, error);
 }
   g_assert (joinable);
   return g_thread_try_new ("gst-check", func, data, error);
 }
+#define g_mutex_new gst_g_mutex_new
+static inline GMutex *
+gst_g_mutex_new (void)
+{
+  GMutex *mutex = g_slice_new (GMutex);
+  g_mutex_init (mutex);
+  return mutex;
+}
+#define g_mutex_free gst_g_mutex_free
+static inline void
+gst_g_mutex_free (GMutex *mutex)
+{
+  g_mutex_clear (mutex);
+  g_slice_free (GMutex, mutex);
+}
+#define g_static_rec_mutex_init gst_g_static_rec_mutex_init
+static inline void
+gst_g_static_rec_mutex_init (GStaticRecMutex *mutex)
+{
+  static const GStaticRecMutex init_mutex = G_STATIC_REC_MUTEX_INIT;
+
+  *mutex = init_mutex;
+}
+#define g_cond_new gst_g_cond_new
+static inline GCond *
+gst_g_cond_new (void)
+{
+  GCond *cond = g_slice_new (GCond);
+  g_cond_init (cond);
+  return cond;
+}
+#define g_cond_free gst_g_cond_free
+static inline void
+gst_g_cond_free (GCond *cond)
+{
+  g_cond_clear (cond);
+  g_slice_free (GCond, cond);
+}
+#define g_cond_timed_wait gst_g_cond_timed_wait
+static inline gboolean
+gst_g_cond_timed_wait (GCond *cond, GMutex *mutex, GTimeVal *abs_time)
+{
+  gint64 end_time;
+
+  if (abs_time == NULL) {
+    g_cond_wait (cond, mutex);
+    return TRUE;
+  }
+
+  end_time = abs_time->tv_sec;
+  end_time *= 1000000;
+  end_time += abs_time->tv_usec;
+
+  /* would be nice if we had clock_rtoffset, but that didn't seem to
+   * make it into the kernel yet...
+   */
+  /* if CLOCK_MONOTONIC is not defined then g_get_montonic_time() and
+   * g_get_real_time() are returning the same clock and we'd add ~0
+   */
+  end_time += g_get_monotonic_time () - g_get_real_time ();
+  return g_cond_wait_until (cond, mutex, end_time);
+}
 #endif
 
 #define MAIN_INIT()                    \
 #endif
 
 #define MAIN_INIT()                    \
index f6e2cbf2e7785ae709829f21d57a1ae23c55e749..44480871cad255d77fd82824a9c38036ee1247ed 100644 (file)
@@ -80,6 +80,7 @@
 #include "gstcontrollerprivate.h"
 #include "gstcontrolsource.h"
 #include "gstinterpolationcontrolsource.h"
 #include "gstcontrollerprivate.h"
 #include "gstcontrolsource.h"
 #include "gstinterpolationcontrolsource.h"
+#include "gst/glib-compat-private.h"
 
 #define GST_CAT_DEFAULT controller_debug
 GST_DEBUG_CATEGORY_EXTERN (GST_CAT_DEFAULT);
 
 #define GST_CAT_DEFAULT controller_debug
 GST_DEBUG_CATEGORY_EXTERN (GST_CAT_DEFAULT);
index f320d7d0fc1422a228db78a65e4b1b6a82520101..2bdefeb8c672e7420056a3f08e9e2ed265d6f543 100644 (file)
@@ -43,6 +43,7 @@
 #include "gstcontrolsource.h"
 #include "gstinterpolationcontrolsource.h"
 #include "gstinterpolationcontrolsourceprivate.h"
 #include "gstcontrolsource.h"
 #include "gstinterpolationcontrolsource.h"
 #include "gstinterpolationcontrolsourceprivate.h"
+#include "gst/glib-compat-private.h"
 
 #define GST_CAT_DEFAULT controller_debug
 GST_DEBUG_CATEGORY_EXTERN (GST_CAT_DEFAULT);
 
 #define GST_CAT_DEFAULT controller_debug
 GST_DEBUG_CATEGORY_EXTERN (GST_CAT_DEFAULT);
index 06711b285f77347672a470db978960224bca0af6..61396875d627c3afbfd17d6dde42d2165250ef2c 100644 (file)
@@ -43,6 +43,8 @@
 #include "gstlfocontrolsource.h"
 #include "gstlfocontrolsourceprivate.h"
 
 #include "gstlfocontrolsource.h"
 #include "gstlfocontrolsourceprivate.h"
 
+#include "gst/glib-compat-private.h"
+
 #include <gst/math-compat.h>
 
 #define EMPTY(x) (x)
 #include <gst/math-compat.h>
 
 #define EMPTY(x) (x)
index c143cbfdbc40aef5b6bf2a8e8a6c688bb79dec4b..19030fb37e0f6e36b360ff57c1d94c8b1e65d4ac 100644 (file)
@@ -59,6 +59,8 @@
 
 #include "gstinputselector.h"
 
 
 #include "gstinputselector.h"
 
+#include "gst/glib-compat-private.h"
+
 GST_DEBUG_CATEGORY_STATIC (input_selector_debug);
 #define GST_CAT_DEFAULT input_selector_debug
 
 GST_DEBUG_CATEGORY_STATIC (input_selector_debug);
 #define GST_CAT_DEFAULT input_selector_debug
 
index e291abd5df8939957ee6ffb4582cf1c0f1d2d4fd..25829d8013c707f2085ed34195866b3f439c6a02 100644 (file)
@@ -61,6 +61,7 @@
 #include "gstqueue.h"
 
 #include "../../gst/gst-i18n-lib.h"
 #include "gstqueue.h"
 
 #include "../../gst/gst-i18n-lib.h"
+#include "../../gst/glib-compat-private.h"
 
 static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink",
     GST_PAD_SINK,
 
 static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink",
     GST_PAD_SINK,
index 244023627fec85466547075a95af6864a94b672a..8c4e4ccad48d1348f425f07d7dc75846398fef69 100644 (file)
@@ -63,6 +63,7 @@
 #include <glib/gstdio.h>
 
 #include "gst/gst-i18n-lib.h"
 #include <glib/gstdio.h>
 
 #include "gst/gst-i18n-lib.h"
+#include "gst/glib-compat-private.h"
 
 #include <string.h>
 
 
 #include <string.h>
 
index 6b9e7cc8009a5060906cc71a924e2e9ac9c0cf39..6b875a78a0830764362d8d368aef38c2ba97e2a8 100644 (file)
@@ -48,6 +48,7 @@
 #endif
 
 #include "gsttee.h"
 #endif
 
 #include "gsttee.h"
+#include "gst/glib-compat-private.h"
 
 #include <string.h>
 
 
 #include <string.h>