#include "config.h"
#endif
-/* FIXME 0.11: suppress warnings for deprecated API such as GStaticRecMutex
- * with newer GLib versions (>= 2.31.0) */
-#define GLIB_DISABLE_DEPRECATION_WARNINGS
-
#include "gstalsamixer.h"
#include "gst/glib-compat-private.h"
#include <errno.h>
goto error;
g_rec_mutex_init (&ret->rec_mutex);
- g_static_rec_mutex_init (&ret->task_mutex);
+ g_rec_mutex_init (&ret->task_mutex);
ret->task = gst_task_new (task_monitor_alsa, ret);
gst_task_set_lock (ret->task, &ret->task_mutex);
mixer->task = NULL;
}
- g_static_rec_mutex_free (&mixer->task_mutex);
+ g_rec_mutex_clear (&mixer->task_mutex);
if (mixer->pfd[0] > 0) {
close (mixer->pfd[0]);
snd_mixer_t * handle;
GstTask * task;
- GStaticRecMutex task_mutex;
+ GRecMutex task_mutex;
GRecMutex rec_mutex;
#include "config.h"
#endif
-/* FIXME 0.11: suppress warnings for deprecated API such as GStaticRecMutex
- * with newer GLib versions (>= 2.31.0) */
-#define GLIB_DISABLE_DEPRECATION_WARNINGS
-
#include <string.h>
#include <gst/gst-i18n-plugin.h>
#include <gst/tag/tag.h>
#include <string.h>
-/* FIXME 0.11: suppress warnings for deprecated API such as GStaticRecMutex
- * with newer GLib versions (>= 2.31.0) */
-#define GLIB_DISABLE_DEPRECATION_WARNINGS
#include "gstaudiobasesink.h"
GST_DEBUG_CATEGORY_STATIC (gst_audio_base_sink_debug);
#include "config.h"
#endif
-/* FIXME 0.11: suppress warnings for deprecated API such as GStaticRecMutex
- * with newer GLib versions (>= 2.31.0) */
-#define GLIB_DISABLE_DEPRECATION_WARNINGS
-
#include "gstaudiodecoder.h"
#include <gst/pbutils/descriptions.h>
dec->priv->adapter_out = gst_adapter_new ();
g_queue_init (&dec->priv->frames);
- g_static_rec_mutex_init (&dec->stream_lock);
+ g_rec_mutex_init (&dec->stream_lock);
/* property default */
dec->priv->latency = DEFAULT_LATENCY;
g_object_unref (dec->priv->adapter_out);
}
- g_static_rec_mutex_free (&dec->stream_lock);
+ g_rec_mutex_clear (&dec->stream_lock);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
*/
#define GST_AUDIO_DECODER_SINK_PAD(obj) (((GstAudioDecoder *) (obj))->sinkpad)
-#define GST_AUDIO_DECODER_STREAM_LOCK(dec) g_static_rec_mutex_lock (&GST_AUDIO_DECODER (dec)->stream_lock)
-#define GST_AUDIO_DECODER_STREAM_UNLOCK(dec) g_static_rec_mutex_unlock (&GST_AUDIO_DECODER (dec)->stream_lock)
+#define GST_AUDIO_DECODER_STREAM_LOCK(dec) g_rec_mutex_lock (&GST_AUDIO_DECODER (dec)->stream_lock)
+#define GST_AUDIO_DECODER_STREAM_UNLOCK(dec) g_rec_mutex_unlock (&GST_AUDIO_DECODER (dec)->stream_lock)
typedef struct _GstAudioDecoder GstAudioDecoder;
typedef struct _GstAudioDecoderClass GstAudioDecoderClass;
/* protects all data processing, i.e. is locked
* in the chain function, finish_frame and when
* processing serialized events */
- GStaticRecMutex stream_lock;
+ GRecMutex stream_lock;
/* MT-protected (with STREAM_LOCK) */
GstSegment segment;
# include "config.h"
#endif
-/* FIXME 0.11: suppress warnings for deprecated API such as GStaticRecMutex
- * with newer GLib versions (>= 2.31.0) */
-#define GLIB_DISABLE_DEPRECATION_WARNINGS
-
#include "gstaudioencoder.h"
#include <gst/base/gstadapter.h>
#include <gst/audio/audio.h>
enc->priv->adapter = gst_adapter_new ();
- g_static_rec_mutex_init (&enc->stream_lock);
+ g_rec_mutex_init (&enc->stream_lock);
/* property default */
enc->priv->granule = DEFAULT_GRANULE;
g_object_unref (enc->priv->adapter);
- g_static_rec_mutex_free (&enc->stream_lock);
+ g_rec_mutex_clear (&enc->stream_lock);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
*/
#define GST_AUDIO_ENCODER_SEGMENT(obj) (GST_AUDIO_ENCODER_CAST (obj)->segment)
-#define GST_AUDIO_ENCODER_STREAM_LOCK(enc) g_static_rec_mutex_lock (&GST_AUDIO_ENCODER (enc)->stream_lock)
-#define GST_AUDIO_ENCODER_STREAM_UNLOCK(enc) g_static_rec_mutex_unlock (&GST_AUDIO_ENCODER (enc)->stream_lock)
+#define GST_AUDIO_ENCODER_STREAM_LOCK(enc) g_rec_mutex_lock (&GST_AUDIO_ENCODER (enc)->stream_lock)
+#define GST_AUDIO_ENCODER_STREAM_UNLOCK(enc) g_rec_mutex_unlock (&GST_AUDIO_ENCODER (enc)->stream_lock)
typedef struct _GstAudioEncoder GstAudioEncoder;
typedef struct _GstAudioEncoderClass GstAudioEncoderClass;
/* protects all data processing, i.e. is locked
* in the chain function, finish_frame and when
* processing serialized events */
- GStaticRecMutex stream_lock;
+ GRecMutex stream_lock;
/* MT-protected (with STREAM_LOCK) */
GstSegment segment;
*/
/* Element-Checklist-Version: 5 */
-/* FIXME 0.11: suppress warnings for deprecated API such as GStaticRecMutex
- * with newer GLib versions (>= 2.31.0) */
-#define GLIB_DISABLE_DEPRECATION_WARNINGS
-
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "config.h"
#endif
-/* FIXME 0.11: suppress warnings for deprecated API such as GStaticRecMutex
- * with newer GLib versions (>= 2.31.0) */
-#define GLIB_DISABLE_DEPRECATION_WARNINGS
-
#include <gst/gst-i18n-plugin.h>
#include <string.h>
#include "config.h"
#endif
-/* FIXME 0.11: suppress warnings for deprecated API such as GStaticRecMutex
- * with newer GLib versions (>= 2.31.0) */
-#define GLIB_DISABLE_DEPRECATION_WARNINGS
-
#include <gst/gst-i18n-plugin.h>
#include <string.h>
#include "config.h"
#endif
-/* FIXME 0.11: suppress warnings for deprecated API such as GStaticRecMutex
- * with newer GLib versions (>= 2.31.0) */
-#define GLIB_DISABLE_DEPRECATION_WARNINGS
-
#include <string.h>
#include <gst/gst.h>
gulong block_id;
};
-#define GST_SOURCE_GROUP_GET_LOCK(group) (((GstSourceGroup*)(group))->lock)
+#define GST_SOURCE_GROUP_GET_LOCK(group) (&((GstSourceGroup*)(group))->lock)
#define GST_SOURCE_GROUP_LOCK(group) (g_mutex_lock (GST_SOURCE_GROUP_GET_LOCK(group)))
#define GST_SOURCE_GROUP_UNLOCK(group) (g_mutex_unlock (GST_SOURCE_GROUP_GET_LOCK(group)))
{
GstPlayBin *playbin;
- GMutex *lock;
+ GMutex lock;
gboolean valid; /* the group has valid info to start playback */
gboolean active; /* the group is active */
gulong block_id;
- GMutex *stream_changed_pending_lock;
+ GMutex stream_changed_pending_lock;
GList *stream_changed_pending;
/* selectors for different streams */
};
#define GST_PLAY_BIN_GET_LOCK(bin) (&((GstPlayBin*)(bin))->lock)
-#define GST_PLAY_BIN_LOCK(bin) (g_static_rec_mutex_lock (GST_PLAY_BIN_GET_LOCK(bin)))
-#define GST_PLAY_BIN_UNLOCK(bin) (g_static_rec_mutex_unlock (GST_PLAY_BIN_GET_LOCK(bin)))
+#define GST_PLAY_BIN_LOCK(bin) (g_rec_mutex_lock (GST_PLAY_BIN_GET_LOCK(bin)))
+#define GST_PLAY_BIN_UNLOCK(bin) (g_rec_mutex_unlock (GST_PLAY_BIN_GET_LOCK(bin)))
/* lock to protect dynamic callbacks, like no-more-pads */
-#define GST_PLAY_BIN_DYN_LOCK(bin) g_mutex_lock ((bin)->dyn_lock)
-#define GST_PLAY_BIN_DYN_UNLOCK(bin) g_mutex_unlock ((bin)->dyn_lock)
+#define GST_PLAY_BIN_DYN_LOCK(bin) g_mutex_lock (&(bin)->dyn_lock)
+#define GST_PLAY_BIN_DYN_UNLOCK(bin) g_mutex_unlock (&(bin)->dyn_lock)
/* lock for shutdown */
#define GST_PLAY_BIN_SHUTDOWN_LOCK(bin,label) \
{
GstPipeline parent;
- GStaticRecMutex lock; /* to protect group switching */
+ GRecMutex lock; /* to protect group switching */
/* the groups, we use a double buffer to switch between current and next */
GstSourceGroup groups[2]; /* array with group info */
GstElement *source;
/* lock protecting dynamic adding/removing */
- GMutex *dyn_lock;
+ GMutex dyn_lock;
/* if we are shutting down or not */
gint shutdown;
- GMutex *elements_lock;
+ GMutex elements_lock;
guint32 elements_cookie;
GList *elements; /* factories we can use for selecting elements */
group->video_channels = g_ptr_array_new ();
group->audio_channels = g_ptr_array_new ();
group->text_channels = g_ptr_array_new ();
- group->lock = g_mutex_new ();
+ g_mutex_init (&group->lock);
/* init selectors. The selector is found by finding the first prefix that
* matches the media. */
group->playbin = playbin;
g_ptr_array_free (group->audio_channels, TRUE);
g_ptr_array_free (group->text_channels, TRUE);
- g_mutex_free (group->lock);
+ g_mutex_clear (&group->lock);
if (group->audio_sink) {
if (group->audio_sink != playbin->audio_sink)
gst_element_set_state (group->audio_sink, GST_STATE_NULL);
g_list_free (group->stream_changed_pending);
group->stream_changed_pending = NULL;
- if (group->stream_changed_pending_lock)
- g_mutex_free (group->stream_changed_pending_lock);
- group->stream_changed_pending_lock = NULL;
+ if (group->stream_changed_pending_lock.p)
+ g_mutex_clear (&group->stream_changed_pending_lock);
+ group->stream_changed_pending_lock.p = NULL;
}
static void
static void
gst_play_bin_init (GstPlayBin * playbin)
{
- g_static_rec_mutex_init (&playbin->lock);
- playbin->dyn_lock = g_mutex_new ();
+ g_rec_mutex_init (&playbin->lock);
+ g_mutex_init (&playbin->dyn_lock);
/* assume we can create a selector */
playbin->have_selector = TRUE;
init_group (playbin, &playbin->groups[1]);
/* first filter out the interesting element factories */
- playbin->elements_lock = g_mutex_new ();
+ g_mutex_init (&playbin->elements_lock);
/* add sink */
playbin->playsink = g_object_new (GST_TYPE_PLAY_SINK, NULL);
if (playbin->elements)
gst_plugin_feature_list_free (playbin->elements);
- g_static_rec_mutex_free (&playbin->lock);
- g_mutex_free (playbin->dyn_lock);
- g_mutex_free (playbin->elements_lock);
+ g_rec_mutex_clear (&playbin->lock);
+ g_mutex_clear (&playbin->dyn_lock);
+ g_mutex_clear (&playbin->elements_lock);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
gboolean pending;
GST_SOURCE_GROUP_LOCK (group);
- if (group->stream_changed_pending_lock) {
- g_mutex_lock (group->stream_changed_pending_lock);
+ if (group->stream_changed_pending_lock.p) {
+ g_mutex_lock (&group->stream_changed_pending_lock);
pending = group->pending || group->stream_changed_pending;
- g_mutex_unlock (group->stream_changed_pending_lock);
+ g_mutex_unlock (&group->stream_changed_pending_lock);
} else {
pending = group->pending;
}
GList *l, *l_prev;
group = playbin->curr_group;
- g_mutex_lock (group->stream_changed_pending_lock);
+ g_mutex_lock (&group->stream_changed_pending_lock);
for (l = group->stream_changed_pending; l;) {
guint32 l_seqnum = GPOINTER_TO_UINT (l->data);
l = l->next;
}
}
- g_mutex_unlock (group->stream_changed_pending_lock);
+ g_mutex_unlock (&group->stream_changed_pending_lock);
}
} else if (GST_MESSAGE_TYPE (msg) == GST_MESSAGE_ASYNC_START ||
GST_MESSAGE_TYPE (msg) == GST_MESSAGE_ASYNC_DONE) {
msg = gst_message_new_element (GST_OBJECT_CAST (playbin), s);
seqnum = gst_message_get_seqnum (msg);
event = gst_event_new_sink_message (msg);
- g_mutex_lock (group->stream_changed_pending_lock);
+ g_mutex_lock (&group->stream_changed_pending_lock);
group->stream_changed_pending =
g_list_prepend (group->stream_changed_pending,
GUINT_TO_POINTER (seqnum));
GST_PAD_PROBE_TYPE_DATA_DOWNSTREAM,
stream_changed_data_probe, (gpointer) select, NULL);
- g_mutex_unlock (group->stream_changed_pending_lock);
+ g_mutex_unlock (&group->stream_changed_pending_lock);
gst_message_unref (msg);
}
group, GST_DEBUG_PAD_NAME (pad), caps);
/* filter out the elements based on the caps. */
- g_mutex_lock (playbin->elements_lock);
+ g_mutex_lock (&playbin->elements_lock);
gst_play_bin_update_elements_list (playbin);
mylist =
gst_element_factory_list_filter (playbin->elements, caps, GST_PAD_SINK,
FALSE);
- g_mutex_unlock (playbin->elements_lock);
+ g_mutex_unlock (&playbin->elements_lock);
GST_DEBUG_OBJECT (playbin, "found factories %p", mylist);
GST_PLUGIN_FEATURE_LIST_DEBUG (mylist);
g_list_free (group->stream_changed_pending);
group->stream_changed_pending = NULL;
- if (!group->stream_changed_pending_lock)
- group->stream_changed_pending_lock = g_mutex_new ();
+ if (!group->stream_changed_pending_lock.p)
+ g_mutex_init (&group->stream_changed_pending_lock);
if (group->uridecodebin) {
GST_DEBUG_OBJECT (playbin, "reusing existing uridecodebin");
#include "config.h"
#endif
-/* FIXME 0.11: suppress warnings for deprecated API such as GStaticRecMutex
- * with newer GLib versions (>= 2.31.0) */
-#define GLIB_DISABLE_DEPRECATION_WARNINGS
-
#include <string.h>
#include <gst/gst.h>
#define GST_PLAY_SINK_GET_LOCK(playsink) (&((GstPlaySink *)playsink)->lock)
#define GST_PLAY_SINK_LOCK(playsink) G_STMT_START { \
GST_LOG_OBJECT (playsink, "locking from thread %p", g_thread_self ()); \
- g_static_rec_mutex_lock (GST_PLAY_SINK_GET_LOCK (playsink)); \
+ g_rec_mutex_lock (GST_PLAY_SINK_GET_LOCK (playsink)); \
GST_LOG_OBJECT (playsink, "locked from thread %p", g_thread_self ()); \
} G_STMT_END
#define GST_PLAY_SINK_UNLOCK(playsink) G_STMT_START { \
GST_LOG_OBJECT (playsink, "unlocking from thread %p", g_thread_self ()); \
- g_static_rec_mutex_unlock (GST_PLAY_SINK_GET_LOCK (playsink)); \
+ g_rec_mutex_unlock (GST_PLAY_SINK_GET_LOCK (playsink)); \
} G_STMT_END
#define PENDING_FLAG_SET(playsink, flagtype) \
{
GstBin bin;
- GStaticRecMutex lock;
+ GRecMutex lock;
gboolean async_pending;
gboolean need_async_start;
gst_bin_add (GST_BIN_CAST (playsink),
GST_ELEMENT_CAST (playsink->stream_synchronizer));
- g_static_rec_mutex_init (&playsink->lock);
+ g_rec_mutex_init (&playsink->lock);
GST_OBJECT_FLAG_SET (playsink, GST_ELEMENT_FLAG_SINK);
}
playsink = GST_PLAY_SINK (object);
- g_static_rec_mutex_free (&playsink->lock);
+ g_rec_mutex_clear (&playsink->lock);
G_OBJECT_CLASS (gst_play_sink_parent_class)->finalize (object);
}
#include "config.h"
#endif
-/* FIXME 0.11: suppress warnings for deprecated API such as GStaticRecMutex
- * with newer GLib versions (>= 2.31.0) */
-#define GLIB_DISABLE_DEPRECATION_WARNINGS
-
#include "gststreamsynchronizer.h"
#include "gst/glib-compat-private.h"
GST_STREAM_SYNCHRONIZER_UNLOCK (self);
/* Add pads and activate unless we're going to NULL */
- g_static_rec_mutex_lock (GST_STATE_GET_LOCK (self));
+ g_rec_mutex_lock (GST_STATE_GET_LOCK (self));
if (GST_STATE_TARGET (self) != GST_STATE_NULL) {
gst_pad_set_active (stream->srcpad, TRUE);
gst_pad_set_active (stream->sinkpad, TRUE);
}
gst_element_add_pad (GST_ELEMENT_CAST (self), stream->srcpad);
gst_element_add_pad (GST_ELEMENT_CAST (self), stream->sinkpad);
- g_static_rec_mutex_unlock (GST_STATE_GET_LOCK (self));
+ g_rec_mutex_unlock (GST_STATE_GET_LOCK (self));
return stream->sinkpad;
}
#include "config.h"
#endif
-/* FIXME 0.11: suppress warnings for deprecated API such as GStaticRecMutex
- * with newer GLib versions (>= 2.31.0) */
-#define GLIB_DISABLE_DEPRECATION_WARNINGS
-
#include <gst/gst-i18n-plugin.h>
#include "gstmultisocketsink.h"
this = GST_MULTI_SOCKET_SINK (object);
- CLIENTS_LOCK_FREE (this);
+ CLIENTS_LOCK_CLEAR (this);
g_hash_table_destroy (this->socket_hash);
g_array_free (this->bufqueue, TRUE);
guint64 last_buffer_ts;
} GstSocketClient;
-#define CLIENTS_LOCK_INIT(socketsink) (g_static_rec_mutex_init(&socketsink->clientslock))
-#define CLIENTS_LOCK_FREE(socketsink) (g_static_rec_mutex_free(&socketsink->clientslock))
-#define CLIENTS_LOCK(socketsink) (g_static_rec_mutex_lock(&socketsink->clientslock))
-#define CLIENTS_UNLOCK(socketsink) (g_static_rec_mutex_unlock(&socketsink->clientslock))
+#define CLIENTS_LOCK_INIT(socketsink) (g_rec_mutex_init(&socketsink->clientslock))
+#define CLIENTS_LOCK_CLEAR(socketsink) (g_rec_mutex_clear(&socketsink->clientslock))
+#define CLIENTS_LOCK(socketsink) (g_rec_mutex_lock(&socketsink->clientslock))
+#define CLIENTS_UNLOCK(socketsink) (g_rec_mutex_unlock(&socketsink->clientslock))
/**
* GstMultiSocketSink:
guint64 bytes_to_serve; /* how much bytes we must serve */
guint64 bytes_served; /* how much bytes have we served */
- GStaticRecMutex clientslock; /* lock to protect the clients list */
+ GRecMutex clientslock; /* lock to protect the clients list */
GList *clients; /* list of clients we are serving */
GHashTable *socket_hash; /* index on socket to client */
guint clients_cookie; /* Cookie to detect changes to the clients list */