G_BEGIN_DECLS
-#if !GLIB_CHECK_VERSION(2,25,0)
-
-#if defined (_MSC_VER) && !defined(_WIN64)
-typedef struct _stat32 GStatBuf;
-#else
-typedef struct stat GStatBuf;
-#endif
-
-#endif
-
-#if GLIB_CHECK_VERSION(2,26,0)
-#define GLIB_HAS_GDATETIME
-#endif
-
-/* See bug #651514 */
-#if GLIB_CHECK_VERSION(2,29,5)
-#define G_ATOMIC_POINTER_COMPARE_AND_EXCHANGE(a,b,c) \
- g_atomic_pointer_compare_and_exchange ((a),(b),(c))
-#define G_ATOMIC_INT_COMPARE_AND_EXCHANGE(a,b,c) \
- g_atomic_int_compare_and_exchange ((a),(b),(c))
-#else
-#define G_ATOMIC_POINTER_COMPARE_AND_EXCHANGE(a,b,c) \
- g_atomic_pointer_compare_and_exchange ((volatile gpointer *)(a),(b),(c))
-#define G_ATOMIC_INT_COMPARE_AND_EXCHANGE(a,b,c) \
- g_atomic_int_compare_and_exchange ((volatile int *)(a),(b),(c))
-#endif
-
-/* See bug #651514 */
-#if GLIB_CHECK_VERSION(2,29,5)
-#define G_ATOMIC_INT_ADD(a,b) g_atomic_int_add ((a),(b))
-#else
-#define G_ATOMIC_INT_ADD(a,b) g_atomic_int_exchange_and_add ((a),(b))
-#endif
-
/* copies */
/* adaptations */
{NULL}
};
-/* Since GLib 2.31.0 threading is always enabled and g_thread_init()
- * is not needed any longer and deprecated */
-#if !GLIB_CHECK_VERSION (2, 31, 0)
- /* Since GLib 2.23.2 calling g_thread_init() 'late' is allowed and is
- * automatically done as part of g_type_init() */
- if (glib_check_version (2, 23, 3)) {
- /* The GLib threading system must be initialised before calling any other
- * GLib function according to the documentation; if the application hasn't
- * called gst_init() yet or initialised the threading system otherwise, we
- * better issue a warning here (since chances are high that the application
- * has already called other GLib functions such as g_option_context_new() */
- if (!g_thread_get_initialized ()) {
- g_warning ("The GStreamer function gst_init_get_option_group() was\n"
- "\tcalled, but the GLib threading system has not been initialised\n"
- "\tyet, something that must happen before any other GLib function\n"
- "\tis called. The application needs to be fixed so that it calls\n"
- "\t if (!g_thread_get_initialized ()) g_thread_init(NULL);\n"
- "\tas very first thing in its main() function. Please file a bug\n"
- "\tagainst this application.");
- g_thread_init (NULL);
- }
- } else {
- /* GLib >= 2.23.2 */
- }
-#endif
-
group = g_option_group_new ("gst", _("GStreamer Options"),
_("Show GStreamer Options"), NULL, NULL);
g_option_group_set_parse_hooks (group, (GOptionParseFunc) init_pre,
#endif
gboolean res;
-#if !GLIB_CHECK_VERSION (2, 31, 0)
- if (!g_thread_get_initialized ())
- g_thread_init (NULL);
-#endif
-
if (gst_initialized) {
GST_DEBUG ("already initialized gst");
return TRUE;
g_type_init ();
-#if !GLIB_CHECK_VERSION (2, 31, 0)
- /* we need threading to be enabled right here */
- g_assert (g_thread_get_initialized ());
-#endif
-
#ifndef GST_DISABLE_GST_DEBUG
_priv_gst_debug_init ();
#endif
{
do {
mem->free = g_atomic_pointer_get (&queue->free_list);
- } while (!G_ATOMIC_POINTER_COMPARE_AND_EXCHANGE (&queue->free_list,
+ } while (!g_atomic_pointer_compare_and_exchange (&queue->free_list,
mem->free, mem));
}
free_list = g_atomic_pointer_get (&queue->free_list);
if (free_list == NULL)
return;
- } while (!G_ATOMIC_POINTER_COMPARE_AND_EXCHANGE (&queue->free_list, free_list,
+ } while (!g_atomic_pointer_compare_and_exchange (&queue->free_list, free_list,
NULL));
while (free_list) {
/* now we try to move the next array as the head memory. If we fail to do that,
* some other reader managed to do it first and we retry */
- if (!G_ATOMIC_POINTER_COMPARE_AND_EXCHANGE (&queue->head_mem, head_mem,
+ if (!g_atomic_pointer_compare_and_exchange (&queue->head_mem, head_mem,
next))
continue;
/* now we try to move the next array as the head memory. If we fail to do that,
* some other reader managed to do it first and we retry */
- if (!G_ATOMIC_POINTER_COMPARE_AND_EXCHANGE (&queue->head_mem, head_mem,
+ if (!g_atomic_pointer_compare_and_exchange (&queue->head_mem, head_mem,
next))
continue;
mem = new_queue_mem ((size << 1) + 1, tail);
/* try to make our new array visible to other writers */
- if (!G_ATOMIC_POINTER_COMPARE_AND_EXCHANGE (&queue->tail_mem, tail_mem,
+ if (!g_atomic_pointer_compare_and_exchange (&queue->tail_mem, tail_mem,
mem)) {
/* we tried to swap the new writer array but something changed. This is
* because some other writer beat us to it, we free our memory and try
/* check that the buffer is ours, all buffers returned to the pool have the
* pool member set to NULL and the pool refcount decreased */
- if (!G_ATOMIC_POINTER_COMPARE_AND_EXCHANGE (&buffer->pool, pool, NULL))
+ if (!g_atomic_pointer_compare_and_exchange (&buffer->pool, pool, NULL))
return;
pclass = GST_BUFFER_POOL_GET_CLASS (pool);
source = (GstBusSource *) g_source_new (&gst_bus_source_funcs,
sizeof (GstBusSource));
-#if GLIB_CHECK_VERSION(2,26,0)
g_source_set_name ((GSource *) source, "GStreamer message bus watch");
-#endif
source->bus = gst_object_ref (bus);
g_source_add_poll ((GSource *) source, &bus->priv->pollfd);
#define GST_DATE_TIME_USEC_PER_SECOND (G_GINT64_CONSTANT (1000000))
#define GST_DATE_TIME_USEC_PER_MILLISECOND (G_GINT64_CONSTANT (1000))
+/* FIXME: this bug was resolved NOTGNOME */
/* Jan 5th 2011 (Edward) : GLib's GDateTime is broken in regards to gmt offset
* on macosx. Re-enable it once the following bug is fixed:
* https://bugzilla.gnome.org/show_bug.cgi?id=638666 */
#ifdef HAVE_OSX
#undef GLIB_HAS_GDATETIME
+#else
+#define GLIB_HAS_GDATETIME
#endif
* an element at the same moment
*/
oclass = GST_ELEMENT_GET_CLASS (element);
- if (!G_ATOMIC_POINTER_COMPARE_AND_EXCHANGE (&oclass->elementfactory, NULL,
+ if (!g_atomic_pointer_compare_and_exchange (&oclass->elementfactory, NULL,
factory))
gst_object_unref (factory);
return quark; }
/* FIXME: Deprecate when we depend on GLib 2.26 */
+/* FIXME 0.11: remove gst_g_error_get_type() */
GType
gst_g_error_get_type (void)
{
-#if GLIB_CHECK_VERSION(2,25,2)
return g_error_get_type ();
-#else
- static GType type = 0;
-
- if (G_UNLIKELY (type == 0))
- type = g_boxed_type_register_static ("GstGError",
- (GBoxedCopyFunc) g_error_copy, (GBoxedFreeFunc) g_error_free);
- return type;
-#endif
}
#define FILE_A_BUG " Please file a bug at " PACKAGE_BUGREPORT "."
#define IS_FLUSHING(s) (g_atomic_int_get(&(s)->flushing))
#define SET_FLUSHING(s,val) (g_atomic_int_set(&(s)->flushing, (val)))
-#define INC_WAITING(s) (G_ATOMIC_INT_ADD(&(s)->waiting, 1))
-#define DEC_WAITING(s) (G_ATOMIC_INT_ADD(&(s)->waiting, -1))
+#define INC_WAITING(s) (g_atomic_int_add(&(s)->waiting, 1))
+#define DEC_WAITING(s) (g_atomic_int_add(&(s)->waiting, -1))
#define GET_WAITING(s) (g_atomic_int_get(&(s)->waiting))
#define TEST_REBUILD(s) (g_atomic_int_compare_and_exchange(&(s)->rebuild, 1, 0))
{
gboolean result = TRUE;
- if (G_ATOMIC_INT_ADD (&set->control_pending, 1) == 0) {
+ if (g_atomic_int_add (&set->control_pending, 1) == 0) {
/* raise when nothing pending */
GST_LOG ("%p: raise", set);
result = WAKE_EVENT (set);
break;
else
/* retry again until we read it successfully */
- G_ATOMIC_INT_ADD (&set->control_pending, 1);
+ g_atomic_int_add (&set->control_pending, 1);
}
}
return old;
#define GET_ENTRY_STATUS(e) ((GstClockReturn) g_atomic_int_get(&GST_CLOCK_ENTRY_STATUS(e)))
#define SET_ENTRY_STATUS(e,val) (g_atomic_int_set(&GST_CLOCK_ENTRY_STATUS(e),(val)))
-#define CAS_ENTRY_STATUS(e,old,val) (G_ATOMIC_INT_COMPARE_AND_EXCHANGE(\
+#define CAS_ENTRY_STATUS(e,old,val) (g_atomic_int_compare_and_exchange(\
(&GST_CLOCK_ENTRY_STATUS(e)), (old), (val)))
/* Define this to get some extra debug about jitter from each clock_wait */
if (G_LIKELY (clock->thread != NULL))
return TRUE; /* Thread already running. Nothing to do */
-#if !GLIB_CHECK_VERSION (2, 31, 0)
- clock->thread = g_thread_create ((GThreadFunc) gst_system_clock_async_thread,
- clock, TRUE, &error);
-#else
clock->thread = g_thread_try_new ("GstSystemClock",
(GThreadFunc) gst_system_clock_async_thread, clock, &error);
-#endif
if (G_UNLIKELY (error))
goto no_thread;
}
GstTagInfo;
-#if GLIB_CHECK_VERSION (2, 31, 0)
#define g_value_get_char g_value_get_schar
-#endif
-#if !GLIB_CHECK_VERSION (2, 31, 0)
-static GMutex *__tag_mutex;
-#define TAG_LOCK g_mutex_lock (__tag_mutex)
-#define TAG_UNLOCK g_mutex_unlock (__tag_mutex)
-#else
static GMutex __tag_mutex;
#define TAG_LOCK g_mutex_lock (&__tag_mutex)
#define TAG_UNLOCK g_mutex_unlock (&__tag_mutex)
-#endif
/* tags hash table: maps tag name string => GstTagInfo */
static GHashTable *__tags;
void
_priv_gst_tag_initialize (void)
{
-#if !GLIB_CHECK_VERSION (2, 31, 0)
- __tag_mutex = g_mutex_new ();
-#else
g_mutex_init (&__tag_mutex);
-#endif
+
__tags = g_hash_table_new (g_str_hash, g_str_equal);
gst_tag_register (GST_TAG_TITLE, GST_TAG_FLAG_META,
G_TYPE_STRING,
{
GstTagMergeMode mode;
GstTagList *list;
-#if !GLIB_CHECK_VERSION (2, 31, 0)
- GStaticMutex lock;
-#else
GMutex lock;
-#endif
} GstTagData;
-#if !GLIB_CHECK_VERSION (2, 31, 0)
-#define GST_TAG_DATA_LOCK(data) g_static_mutex_lock(&data->lock)
-#define GST_TAG_DATA_UNLOCK(data) g_static_mutex_unlock(&data->lock)
-#else
#define GST_TAG_DATA_LOCK(data) g_mutex_lock(&data->lock)
#define GST_TAG_DATA_UNLOCK(data) g_mutex_unlock(&data->lock)
-#endif
GType
gst_tag_setter_get_type (void)
if (data->list)
gst_tag_list_free (data->list);
-#if !GLIB_CHECK_VERSION (2, 31, 0)
- g_static_mutex_free (&data->lock);
-#else
g_mutex_clear (&data->lock);
-#endif
g_slice_free (GstTagData, data);
}
data = g_object_get_qdata (G_OBJECT (setter), gst_tag_key);
if (!data) {
/* make sure no other thread is creating a GstTagData at the same time */
-#if !GLIB_CHECK_VERSION (2, 31, 0)
- static GStaticMutex create_mutex = G_STATIC_MUTEX_INIT;
-
- g_static_mutex_lock (&create_mutex);
-#else
static GMutex create_mutex; /* no initialisation required */
g_mutex_lock (&create_mutex);
-#endif
data = g_object_get_qdata (G_OBJECT (setter), gst_tag_key);
if (!data) {
data = g_slice_new (GstTagData);
-#if !GLIB_CHECK_VERSION (2, 31, 0)
- g_static_mutex_init (&data->lock);
-#else
g_mutex_init (&data->lock);
-#endif
data->list = NULL;
data->mode = GST_TAG_MERGE_KEEP;
g_object_set_qdata_full (G_OBJECT (setter), gst_tag_key, data,
gst_tag_data_free);
}
-#if !GLIB_CHECK_VERSION (2, 31, 0)
- g_static_mutex_unlock (&create_mutex);
-#else
+
g_mutex_unlock (&create_mutex);
-#endif
}
return data;
task->thread = tself;
/* only update the priority when it was changed */
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);
GST_OBJECT_UNLOCK (task);
priv->thr_callbacks.leave_thread (task, tself, priv->thr_user_data);
GST_OBJECT_LOCK (task);
- } 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
*
* Since: 0.10.24
*/
+/* FIXME 0.11: remove gst_task_set_priority() */
void
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 !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);
}
gst_util_seqnum_next (void)
{
static gint counter = 0;
- return G_ATOMIC_INT_ADD (&counter, 1);
+ return g_atomic_int_add (&counter, 1);
}
/**
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;
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_PAD_MODE_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);
if (argc != 2 || strcmp (argv[1], "-l"))
return 1;
-#if !GLIB_CHECK_VERSION (2, 31, 0)
- if (!g_thread_supported ())
- g_thread_init (NULL);
-#endif
-
my_argc = 2;
my_argv = g_malloc (my_argc * sizeof (char *));
my_argv[0] = argv[0];
self->priv->socket = socket;
self->priv->servaddr = G_SOCKET_ADDRESS (servaddr);
-#if !GLIB_CHECK_VERSION (2, 31, 0)
- self->priv->thread = g_thread_create (gst_net_client_clock_thread, self, TRUE,
- &error);
-#else
self->priv->thread = g_thread_try_new ("GstNetClientClock",
gst_net_client_clock_thread, self, &error);
-#endif
if (error != NULL)
goto no_thread;
self->priv->socket = socket;
self->priv->cancel = g_cancellable_new ();
-#if !GLIB_CHECK_VERSION (2, 31, 0)
- self->priv->thread =
- g_thread_create (gst_net_time_provider_thread, self, TRUE, &err);
-#else
self->priv->thread = g_thread_try_new ("GstNetTimeProvider",
gst_net_time_provider_thread, self, &err);
-#endif
if (err != NULL)
goto no_thread;
fakesink->state_error = DEFAULT_STATE_ERROR;
fakesink->signal_handoffs = DEFAULT_SIGNAL_HANDOFFS;
fakesink->num_buffers = DEFAULT_NUM_BUFFERS;
-#if !GLIB_CHECK_VERSION(2,26,0)
- g_static_rec_mutex_init (&fakesink->notify_lock);
-#endif
gst_base_sink_set_sync (GST_BASE_SINK (fakesink), DEFAULT_SYNC);
}
static void
gst_fake_sink_finalize (GObject * obj)
{
-#if !GLIB_CHECK_VERSION(2,26,0)
- GstFakeSink *sink = GST_FAKE_SINK (obj);
-
- g_static_rec_mutex_free (&sink->notify_lock);
-#endif
-
G_OBJECT_CLASS (parent_class)->finalize (obj);
}
static void
gst_fake_sink_notify_last_message (GstFakeSink * sink)
{
- /* FIXME: this hacks around a bug in GLib/GObject: doing concurrent
- * g_object_notify() on the same object might lead to crashes, see
- * http://bugzilla.gnome.org/show_bug.cgi?id=166020#c60 and follow-ups.
- * So we really don't want to do a g_object_notify() here for out-of-band
- * events with the streaming thread possibly also doing a g_object_notify()
- * for an in-band buffer or event. This is fixed in GLib >= 2.26 */
-#if !GLIB_CHECK_VERSION(2,26,0)
- g_static_rec_mutex_lock (&sink->notify_lock);
- g_object_notify ((GObject *) sink, "last-message");
- g_static_rec_mutex_unlock (&sink->notify_lock);
-#else
g_object_notify_by_pspec ((GObject *) sink, pspec_last_message);
-#endif
}
static gboolean
gchar *last_message;
gint num_buffers;
gint num_buffers_left;
-#if !GLIB_CHECK_VERSION(2,26,0)
- GStaticRecMutex notify_lock;
-#endif
};
struct _GstFakeSinkClass {
g_free (sstr);
GST_OBJECT_UNLOCK (src);
-#if !GLIB_CHECK_VERSION(2,26,0)
- g_object_notify ((GObject *) src, "last-message");
-#else
g_object_notify_by_pspec ((GObject *) src, pspec_last_message);
-#endif
}
return GST_BASE_SRC_CLASS (parent_class)->event (basesrc, event);
GST_MINI_OBJECT_CAST (buf)->flags, flag_str, buf);
GST_OBJECT_UNLOCK (src);
-#if !GLIB_CHECK_VERSION(2,26,0)
- g_object_notify ((GObject *) src, "last-message");
-#else
g_object_notify_by_pspec ((GObject *) src, pspec_last_message);
-#endif
}
if (src->signal_handoffs) {
g_free (identity->last_message);
-#if !GLIB_CHECK_VERSION(2,26,0)
- g_static_rec_mutex_free (&identity->notify_lock);
-#endif
-
G_OBJECT_CLASS (parent_class)->finalize (object);
}
identity->last_message = NULL;
identity->signal_handoffs = DEFAULT_SIGNAL_HANDOFFS;
-#if !GLIB_CHECK_VERSION(2,26,0)
- g_static_rec_mutex_init (&identity->notify_lock);
-#endif
-
gst_base_transform_set_gap_aware (GST_BASE_TRANSFORM_CAST (identity), TRUE);
}
static void
gst_identity_notify_last_message (GstIdentity * identity)
{
- /* FIXME: this hacks around a bug in GLib/GObject: doing concurrent
- * g_object_notify() on the same object might lead to crashes, see
- * http://bugzilla.gnome.org/show_bug.cgi?id=166020#c60 and follow-ups.
- * So we really don't want to do a g_object_notify() here for out-of-band
- * events with the streaming thread possibly also doing a g_object_notify()
- * for an in-band buffer or event. This is fixed in GLib >= 2.26 */
-#if !GLIB_CHECK_VERSION(2,26,0)
- g_static_rec_mutex_lock (&identity->notify_lock);
- g_object_notify ((GObject *) identity, "last-message");
- g_static_rec_mutex_unlock (&identity->notify_lock);
-#else
g_object_notify_by_pspec ((GObject *) identity, pspec_last_message);
-#endif
}
static gboolean
gchar *last_message;
guint64 offset;
gboolean signal_handoffs;
-
-#if !GLIB_CHECK_VERSION(2,26,0)
- GStaticRecMutex notify_lock;
-#endif
};
struct _GstIdentityClass {
GST_DEBUG_CATEGORY_STATIC (input_selector_debug);
#define GST_CAT_DEFAULT input_selector_debug
-#if GLIB_CHECK_VERSION(2, 26, 0)
-#define NOTIFY_MUTEX_LOCK()
-#define NOTIFY_MUTEX_UNLOCK()
-#else
-static GStaticRecMutex notify_mutex = G_STATIC_REC_MUTEX_INIT;
-#define NOTIFY_MUTEX_LOCK() g_rec_mutex_lock (¬ify_mutex)
-#define NOTIFY_MUTEX_UNLOCK() g_rec_mutex_unlock (¬ify_mutex)
-#endif
-
static GstStaticPadTemplate gst_input_selector_sink_factory =
GST_STATIC_PAD_TEMPLATE ("sink_%u",
GST_PAD_SINK,
GST_INPUT_SELECTOR_UNLOCK (sel);
if (prev_active_sinkpad != active_sinkpad && pad == active_sinkpad) {
- NOTIFY_MUTEX_LOCK ();
g_object_notify (G_OBJECT (sel), "active-pad");
- NOTIFY_MUTEX_UNLOCK ();
}
switch (GST_EVENT_TYPE (event)) {
GST_INPUT_SELECTOR_UNLOCK (sel);
if (prev_active_sinkpad != active_sinkpad && pad == active_sinkpad) {
- NOTIFY_MUTEX_LOCK ();
g_object_notify (G_OBJECT (sel), "active-pad");
- NOTIFY_MUTEX_UNLOCK ();
}
if (start_event)
goto was_eos;
/* Get a unique incrementing id */
- curid = G_ATOMIC_INT_ADD ((gint *) & mq->counter, 1);
+ curid = g_atomic_int_add ((gint *) & mq->counter, 1);
GST_LOG_OBJECT (mq, "SingleQueue %d : about to enqueue buffer %p with id %d",
sq->id, buffer, curid);
goto was_eos;
/* Get an unique incrementing id. */
- curid = G_ATOMIC_INT_ADD ((gint *) & mq->counter, 1);
+ curid = g_atomic_int_add ((gint *) & mq->counter, 1);
item = gst_multi_queue_event_item_new ((GstMiniObject *) event, curid);
static void
gst_tee_notify_alloc_pad (GstTee * tee)
{
-#if !GLIB_CHECK_VERSION(2,26,0)
- g_object_notify ((GObject *) tee, "alloc-pad");
-#else
g_object_notify_by_pspec ((GObject *) tee, pspec_alloc_pad);
-#endif
}
static gboolean
}
GST_OBJECT_UNLOCK (tee);
-#if !GLIB_CHECK_VERSION(2,26,0)
- g_object_notify ((GObject *) tee, "last-message");
-#else
g_object_notify_by_pspec ((GObject *) tee, pspec_last_message);
-#endif
}
static GstFlowReturn
for (t = 0; t < num_threads; t++) {
GError *error = NULL;
-#if !GLIB_CHECK_VERSION (2, 31, 0)
- threads[t] = g_thread_create (run_test, GINT_TO_POINTER (t), TRUE, &error);
-#else
threads[t] = g_thread_try_new ("bufferstresstest", run_test,
GINT_TO_POINTER (t), &error);
-#endif
+
if (error) {
printf ("ERROR: g_thread_create() %s\n", error->message);
exit (-1);
while (running) {
gst_clock_get_time (sysclock);
- prev = G_ATOMIC_INT_ADD (&count, 1);
+ prev = g_atomic_int_add (&count, 1);
if (prev == G_MAXINT)
g_warning ("overflow");
}
for (t = 0; t < num_threads; t++) {
GError *error = NULL;
-#if !GLIB_CHECK_VERSION (2, 31, 0)
- threads[t] = g_thread_create (run_test, sysclock, TRUE, &error);
-#else
threads[t] = g_thread_try_new ("clockstresstest", run_test,
sysclock, &error);
-#endif
+
if (error) {
printf ("ERROR: g_thread_create() %s\n", error->message);
exit (-1);
for (t = 0; t < num_threads; t++) {
GError *error = NULL;
-#if !GLIB_CHECK_VERSION (2, 31, 0)
- threads[t] = g_thread_create (run_test, GINT_TO_POINTER (t), TRUE, &error);
-#else
threads[t] = g_thread_try_new ("pollstresstest", run_test,
GINT_TO_POINTER (t), &error);
-#endif
+
if (error) {
printf ("ERROR: g_thread_create() %s\n", error->message);
exit (-1);
textdomain (GETTEXT_PACKAGE);
#endif
-#if !GLIB_CHECK_VERSION (2, 31, 0)
- g_thread_init (NULL);
-#endif
-
gst_tools_set_prgname ("gst-inspect");
#ifndef GST_DISABLE_OPTION_PARSING
textdomain (GETTEXT_PACKAGE);
#endif
-#if !GLIB_CHECK_VERSION (2, 31, 0)
- g_thread_init (NULL);
-#endif
-
gst_tools_set_prgname ("gst-launch");
#ifndef GST_DISABLE_OPTION_PARSING
textdomain (GETTEXT_PACKAGE);
#endif
-#if !GLIB_CHECK_VERSION (2, 31, 0)
- g_thread_init (NULL);
-#endif
-
gst_tools_set_prgname ("gst-typefind");
ctx = g_option_context_new ("FILES");