/* 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
#include "gstinfo.h"
#include "gstbus.h"
+#include "glib-compat-private.h"
#define GST_CAT_DEFAULT GST_CAT_BUS
/* bus signals */
#include "gstclock.h"
#include "gstinfo.h"
#include "gstutils.h"
+#include "glib-compat-private.h"
#ifndef GST_DISABLE_TRACE
/* #define GST_WITH_ALLOC_TRACE */
#include "gstinfo.h"
#include "gstvalue.h"
#include "gst-i18n-lib.h"
+#include "glib-compat-private.h"
/* Element signals and args */
enum
*
* 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)
+#endif
+
/**
* 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)))
+#endif
+
/**
* 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)))
+#endif
+
/**
* 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)))
+#endif
/**
* GstObjectClass:
#include "gstinfo.h"
#include "gsttask.h"
+#include "glib-compat-private.h"
#include <stdio.h>
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);
+#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 */
} 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);
+#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
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);
+#else
+ GST_INFO_OBJECT (task, "Thread priorities no longer have any effect");
+#endif
}
GST_OBJECT_UNLOCK (task);
}
GstIndex *index;
gint index_id;
gboolean own_index;
+#if !GLIB_CHECK_VERSION (2, 31, 0)
GStaticMutex index_lock;
+#else
+ GMutex index_lock;
+#endif
/* seek table entries only maintained if upstream is BYTE seekable */
gboolean upstream_seekable;
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);
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);
+#else
+ g_mutex_clear (&parse->priv->index_lock);
+#endif
gst_base_parse_clear_queues (parse);
parse->priv->pad_mode = GST_ACTIVATE_NONE;
+#if !GLIB_CHECK_VERSION (2, 31, 0)
g_static_mutex_init (&parse->priv->index_lock);
+#else
+ g_mutex_init (&parse->priv->index_lock);
+#endif
/* init state */
gst_base_parse_reset (parse);
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);
- g_static_mutex_unlock (&parse->priv->index_lock);
+ GST_BASE_PARSE_INDEX_UNLOCK (parse);
if (key) {
parse->priv->index_last_offset = offset;
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,
ts = GST_CLOCK_TIME_NONE;
}
}
- g_static_mutex_unlock (&parse->priv->index_lock);
+ GST_BASE_PARSE_INDEX_UNLOCK (parse);
exit:
if (_ts)
{
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) {
} else {
parse->priv->index = NULL;
}
- g_static_mutex_unlock (&parse->priv->index_lock);
+ GST_BASE_PARSE_INDEX_UNLOCK (parse);
}
static GstIndex *
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);
- g_static_mutex_unlock (&parse->priv->index_lock);
+ GST_BASE_PARSE_INDEX_UNLOCK (parse);
return result;
}
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;
&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;
#include <string.h>
#include <gst/gst_private.h>
+#include <gst/glib-compat-private.h>
#include "gstbasesrc.h"
#include "gsttypefindhelper.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 "gstcollectpads.h"
+#include "gst/glib-compat-private.h"
GST_DEBUG_CATEGORY_STATIC (collect_pads_debug);
#define GST_CAT_DEFAULT collect_pads_debug
#include "gstcollectpads2.h"
+#include "../../../gst/glib-compat-private.h"
+
GST_DEBUG_CATEGORY_STATIC (collect_pads2_debug);
#define GST_CAT_DEFAULT collect_pads2_debug
#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)
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() \
#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);
#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);
#include "gstlfocontrolsource.h"
#include "gstlfocontrolsourceprivate.h"
+#include "gst/glib-compat-private.h"
+
#include <gst/math-compat.h>
#define EMPTY(x) (x)
#include "gstinputselector.h"
+#include "gst/glib-compat-private.h"
+
GST_DEBUG_CATEGORY_STATIC (input_selector_debug);
#define GST_CAT_DEFAULT input_selector_debug
#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,
#include <glib/gstdio.h>
#include "gst/gst-i18n-lib.h"
+#include "gst/glib-compat-private.h"
#include <string.h>
#endif
#include "gsttee.h"
+#include "gst/glib-compat-private.h"
#include <string.h>