summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/dv/gstdvdemux.c4
-rw-r--r--ext/flac/gstflacdec.c4
-rw-r--r--ext/jack/gstjackaudioclient.c40
-rw-r--r--ext/pulse/pulsesink.c39
-rw-r--r--ext/pulse/pulsesink.h2
-rw-r--r--ext/soup/gstsouphttpclientsink.c46
-rw-r--r--ext/soup/gstsouphttpclientsink.h4
-rw-r--r--ext/wavpack/gstwavpackparse.c4
-rw-r--r--gst/avi/gstavidemux.c4
-rw-r--r--gst/equalizer/gstiirequalizer.c8
-rw-r--r--gst/equalizer/gstiirequalizer.h2
-rw-r--r--gst/flv/gstflvdemux.c4
-rw-r--r--gst/imagefreeze/gstimagefreeze.c4
-rw-r--r--gst/isomp4/gstqtmoovrecover.c8
-rw-r--r--gst/isomp4/gstqtmoovrecover.h2
-rw-r--r--gst/isomp4/qtdemux.c4
-rw-r--r--gst/matroska/matroska-demux.c4
-rw-r--r--gst/rtpmanager/gstrtpbin.c30
-rw-r--r--gst/rtpmanager/gstrtpjitterbuffer.c20
-rw-r--r--gst/rtpmanager/gstrtpsession.c10
-rw-r--r--gst/rtpmanager/gstrtpssrcdemux.c12
-rw-r--r--gst/rtpmanager/gstrtpssrcdemux.h2
-rw-r--r--gst/rtpmanager/rtpsession.c4
-rw-r--r--gst/rtpmanager/rtpsession.h6
-rw-r--r--gst/rtsp/gstrtspsrc.c16
-rw-r--r--gst/rtsp/gstrtspsrc.h16
-rw-r--r--gst/shapewipe/gstshapewipe.c45
-rw-r--r--gst/shapewipe/gstshapewipe.h4
-rw-r--r--gst/udp/gstmultiudpsink.c42
-rw-r--r--gst/udp/gstmultiudpsink.h2
-rw-r--r--gst/videomixer/videomixer2.c4
-rw-r--r--gst/wavparse/gstwavparse.c4
-rw-r--r--sys/v4l2/gstv4l2videooverlay.c40
-rw-r--r--sys/ximage/gstximagesrc.c61
-rw-r--r--sys/ximage/gstximagesrc.h4
-rw-r--r--tests/check/elements/deinterleave.c1
36 files changed, 211 insertions, 295 deletions
diff --git a/ext/dv/gstdvdemux.c b/ext/dv/gstdvdemux.c
index d3618ed19..fe0617e84 100644
--- a/ext/dv/gstdvdemux.c
+++ b/ext/dv/gstdvdemux.c
@@ -22,10 +22,6 @@
#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 <math.h>
diff --git a/ext/flac/gstflacdec.c b/ext/flac/gstflacdec.c
index 7066d7db9..c71a7ec95 100644
--- a/ext/flac/gstflacdec.c
+++ b/ext/flac/gstflacdec.c
@@ -42,10 +42,6 @@
#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 "gstflacdec.h"
diff --git a/ext/jack/gstjackaudioclient.c b/ext/jack/gstjackaudioclient.c
index c33949f02..243b7ffd3 100644
--- a/ext/jack/gstjackaudioclient.c
+++ b/ext/jack/gstjackaudioclient.c
@@ -43,8 +43,8 @@ static GList *connections;
typedef struct
{
gint refcount;
- GMutex *lock;
- GCond *flush_cond;
+ GMutex lock;
+ GCond flush_cond;
/* id/server pair and the connection */
gchar *id;
@@ -113,7 +113,7 @@ jack_process_cb (jack_nframes_t nframes, void *arg)
}
}
- g_mutex_lock (conn->lock);
+ g_mutex_lock (&conn->lock);
/* call sources first, then sinks. Sources will either push data into the
* ringbuffer of the sinks, which will then pull the data out of it, or
* sinks will pull the data from the sources. */
@@ -125,7 +125,7 @@ jack_process_cb (jack_nframes_t nframes, void *arg)
res = client->process (nframes, client->user_data);
if (client->deactivate) {
client->deactivate = FALSE;
- g_cond_signal (conn->flush_cond);
+ g_cond_signal (&conn->flush_cond);
}
}
}
@@ -137,11 +137,11 @@ jack_process_cb (jack_nframes_t nframes, void *arg)
res = client->process (nframes, client->user_data);
if (client->deactivate) {
client->deactivate = FALSE;
- g_cond_signal (conn->flush_cond);
+ g_cond_signal (&conn->flush_cond);
}
}
}
- g_mutex_unlock (conn->lock);
+ g_mutex_unlock (&conn->lock);
return res;
}
@@ -168,7 +168,7 @@ jack_shutdown_cb (void *arg)
GST_DEBUG ("disconnect client %s from server %s", conn->id,
GST_STR_NULL (conn->server));
- g_mutex_lock (conn->lock);
+ g_mutex_lock (&conn->lock);
for (walk = conn->src_clients; walk; walk = g_list_next (walk)) {
GstJackAudioClient *client = (GstJackAudioClient *) walk->data;
@@ -181,7 +181,7 @@ jack_shutdown_cb (void *arg)
if (client->shutdown)
client->shutdown (client->user_data);
}
- g_mutex_unlock (conn->lock);
+ g_mutex_unlock (&conn->lock);
}
typedef struct
@@ -240,8 +240,8 @@ gst_jack_audio_make_connection (const gchar * id, const gchar * server,
/* now create object */
conn = g_new (GstJackAudioConnection, 1);
conn->refcount = 1;
- conn->lock = g_mutex_new ();
- conn->flush_cond = g_cond_new ();
+ g_mutex_init (&conn->lock);
+ g_cond_init (&conn->flush_cond);
conn->id = g_strdup (id);
conn->server = g_strdup (server);
conn->client = jclient;
@@ -276,7 +276,7 @@ could_not_activate:
{
GST_ERROR ("Could not activate client (%d)", res);
*status = JackFailure;
- g_mutex_free (conn->lock);
+ g_mutex_clear (&conn->lock);
g_free (conn->id);
g_free (conn->server);
g_free (conn);
@@ -365,8 +365,8 @@ gst_jack_audio_unref_connection (GstJackAudioConnection * conn)
}
/* free resources */
- g_mutex_free (conn->lock);
- g_cond_free (conn->flush_cond);
+ g_mutex_clear (&conn->lock);
+ g_cond_clear (&conn->flush_cond);
g_free (conn->id);
g_free (conn->server);
g_free (conn);
@@ -377,7 +377,7 @@ static void
gst_jack_audio_connection_add_client (GstJackAudioConnection * conn,
GstJackAudioClient * client)
{
- g_mutex_lock (conn->lock);
+ g_mutex_lock (&conn->lock);
switch (client->type) {
case GST_JACK_CLIENT_SOURCE:
conn->src_clients = g_list_append (conn->src_clients, client);
@@ -391,14 +391,14 @@ gst_jack_audio_connection_add_client (GstJackAudioConnection * conn,
g_warning ("trying to add unknown client type");
break;
}
- g_mutex_unlock (conn->lock);
+ g_mutex_unlock (&conn->lock);
}
static void
gst_jack_audio_connection_remove_client (GstJackAudioConnection * conn,
GstJackAudioClient * client)
{
- g_mutex_lock (conn->lock);
+ g_mutex_lock (&conn->lock);
switch (client->type) {
case GST_JACK_CLIENT_SOURCE:
conn->src_clients = g_list_remove (conn->src_clients, client);
@@ -412,7 +412,7 @@ gst_jack_audio_connection_remove_client (GstJackAudioConnection * conn,
g_warning ("trying to remove unknown client type");
break;
}
- g_mutex_unlock (conn->lock);
+ g_mutex_unlock (&conn->lock);
}
/**
@@ -537,17 +537,17 @@ gst_jack_audio_client_set_active (GstJackAudioClient * client, gboolean active)
g_return_val_if_fail (client != NULL, -1);
/* make sure that we are not dispatching the client */
- g_mutex_lock (client->conn->lock);
+ g_mutex_lock (&client->conn->lock);
if (client->active && !active) {
/* we need to process once more to flush the port */
client->deactivate = TRUE;
/* need to wait for process_cb run once more */
while (client->deactivate)
- g_cond_wait (client->conn->flush_cond, client->conn->lock);
+ g_cond_wait (&client->conn->flush_cond, &client->conn->lock);
}
client->active = active;
- g_mutex_unlock (client->conn->lock);
+ g_mutex_unlock (&client->conn->lock);
return 0;
}
diff --git a/ext/pulse/pulsesink.c b/ext/pulse/pulsesink.c
index 371863e7a..8699ccf0d 100644
--- a/ext/pulse/pulsesink.c
+++ b/ext/pulse/pulsesink.c
@@ -126,7 +126,7 @@ static pa_threaded_mainloop *mainloop = NULL;
static guint mainloop_ref_ct = 0;
/* lock for access to shared resources */
-static GMutex *pa_shared_resource_mutex = NULL;
+static GMutex pa_shared_resource_mutex;
/* We keep a custom ringbuffer that is backed up by data allocated by
* pulseaudio. We must also overide the commit function to write into
@@ -184,8 +184,7 @@ G_DEFINE_TYPE (GstPulseRingBuffer, gst_pulseringbuffer,
static void
gst_pulsesink_init_contexts (void)
{
- g_assert (pa_shared_resource_mutex == NULL);
- pa_shared_resource_mutex = g_mutex_new ();
+ g_mutex_init (&pa_shared_resource_mutex);
gst_pulse_shared_contexts = g_hash_table_new_full (g_str_hash, g_str_equal,
g_free, NULL);
}
@@ -285,7 +284,7 @@ gst_pulsering_destroy_stream (GstPulseRingBuffer * pbuf)
static void
gst_pulsering_destroy_context (GstPulseRingBuffer * pbuf)
{
- g_mutex_lock (pa_shared_resource_mutex);
+ g_mutex_lock (&pa_shared_resource_mutex);
GST_DEBUG_OBJECT (pbuf, "destroying ringbuffer %p", pbuf);
@@ -326,7 +325,7 @@ gst_pulsering_destroy_context (GstPulseRingBuffer * pbuf)
g_free (pbuf->context_name);
pbuf->context_name = NULL;
}
- g_mutex_unlock (pa_shared_resource_mutex);
+ g_mutex_unlock (&pa_shared_resource_mutex);
}
static void
@@ -472,7 +471,7 @@ gst_pulseringbuffer_open_device (GstAudioRingBuffer * buf)
pa_threaded_mainloop_lock (mainloop);
- g_mutex_lock (pa_shared_resource_mutex);
+ g_mutex_lock (&pa_shared_resource_mutex);
need_unlock_shared = TRUE;
pctx = g_hash_table_lookup (gst_pulse_shared_contexts, pbuf->context_name);
@@ -509,7 +508,7 @@ gst_pulseringbuffer_open_device (GstAudioRingBuffer * buf)
pctx->ring_buffers = g_slist_prepend (pctx->ring_buffers, pbuf);
}
- g_mutex_unlock (pa_shared_resource_mutex);
+ g_mutex_unlock (&pa_shared_resource_mutex);
need_unlock_shared = FALSE;
/* context created or shared okay */
@@ -543,7 +542,7 @@ gst_pulseringbuffer_open_device (GstAudioRingBuffer * buf)
unlock_and_fail:
{
if (need_unlock_shared)
- g_mutex_unlock (pa_shared_resource_mutex);
+ g_mutex_unlock (&pa_shared_resource_mutex);
gst_pulsering_destroy_context (pbuf);
pa_threaded_mainloop_unlock (mainloop);
return FALSE;
@@ -1937,7 +1936,7 @@ gst_pulsesink_sink_info_cb (pa_context * c, const pa_sink_info * i, int eol,
g_free (psink->device_description);
psink->device_description = g_strdup (i->description);
- g_mutex_lock (psink->sink_formats_lock);
+ g_mutex_lock (&psink->sink_formats_lock);
for (l = g_list_first (psink->sink_formats); l; l = g_list_next (l))
pa_format_info_free ((pa_format_info *) l->data);
@@ -1949,7 +1948,7 @@ gst_pulsesink_sink_info_cb (pa_context * c, const pa_sink_info * i, int eol,
psink->sink_formats = g_list_prepend (psink->sink_formats,
pa_format_info_copy (i->formats[j]));
- g_mutex_unlock (psink->sink_formats_lock);
+ g_mutex_unlock (&psink->sink_formats_lock);
done:
pa_threaded_mainloop_signal (mainloop, 0);
@@ -2028,14 +2027,14 @@ gst_pulsesink_query_acceptcaps (GstPulseSink * psink, GstCaps * caps)
goto out;
}
- g_mutex_lock (psink->sink_formats_lock);
+ g_mutex_lock (&psink->sink_formats_lock);
for (i = g_list_first (psink->sink_formats); i; i = g_list_next (i)) {
if (pa_format_info_is_compatible ((pa_format_info *) i->data, format)) {
ret = TRUE;
break;
}
}
- g_mutex_unlock (psink->sink_formats_lock);
+ g_mutex_unlock (&psink->sink_formats_lock);
} else {
/* We're in READY, let's connect a stream to see if the format is
* accpeted by whatever sink we're routed to */
@@ -2093,7 +2092,7 @@ gst_pulsesink_init (GstPulseSink * pulsesink)
pulsesink->device_description = NULL;
pulsesink->client_name = gst_pulse_client_name ();
- pulsesink->sink_formats_lock = g_mutex_new ();
+ g_mutex_init (&pulsesink->sink_formats_lock);
pulsesink->sink_formats = NULL;
pulsesink->volume = DEFAULT_VOLUME;
@@ -2139,7 +2138,7 @@ gst_pulsesink_finalize (GObject * object)
pa_format_info_free ((pa_format_info *) i->data);
g_list_free (pulsesink->sink_formats);
- g_mutex_free (pulsesink->sink_formats_lock);
+ g_mutex_clear (&pulsesink->sink_formats_lock);
if (pulsesink->properties)
gst_structure_free (pulsesink->properties);
@@ -2840,7 +2839,7 @@ gst_pulsesink_release_mainloop (GstPulseSink * psink)
}
pa_threaded_mainloop_unlock (mainloop);
- g_mutex_lock (pa_shared_resource_mutex);
+ g_mutex_lock (&pa_shared_resource_mutex);
mainloop_ref_ct--;
if (!mainloop_ref_ct) {
GST_INFO_OBJECT (psink, "terminating pa main loop thread");
@@ -2848,7 +2847,7 @@ gst_pulsesink_release_mainloop (GstPulseSink * psink)
pa_threaded_mainloop_free (mainloop);
mainloop = NULL;
}
- g_mutex_unlock (pa_shared_resource_mutex);
+ g_mutex_unlock (&pa_shared_resource_mutex);
}
static GstStateChangeReturn
@@ -2859,18 +2858,18 @@ gst_pulsesink_change_state (GstElement * element, GstStateChange transition)
switch (transition) {
case GST_STATE_CHANGE_NULL_TO_READY:
- g_mutex_lock (pa_shared_resource_mutex);
+ g_mutex_lock (&pa_shared_resource_mutex);
if (!mainloop_ref_ct) {
GST_INFO_OBJECT (element, "new pa main loop thread");
if (!(mainloop = pa_threaded_mainloop_new ()))
goto mainloop_failed;
mainloop_ref_ct = 1;
pa_threaded_mainloop_start (mainloop);
- g_mutex_unlock (pa_shared_resource_mutex);
+ g_mutex_unlock (&pa_shared_resource_mutex);
} else {
GST_INFO_OBJECT (element, "reusing pa main loop thread");
mainloop_ref_ct++;
- g_mutex_unlock (pa_shared_resource_mutex);
+ g_mutex_unlock (&pa_shared_resource_mutex);
}
break;
case GST_STATE_CHANGE_READY_TO_PAUSED:
@@ -2906,7 +2905,7 @@ gst_pulsesink_change_state (GstElement * element, GstStateChange transition)
/* ERRORS */
mainloop_failed:
{
- g_mutex_unlock (pa_shared_resource_mutex);
+ g_mutex_unlock (&pa_shared_resource_mutex);
GST_ELEMENT_ERROR (pulsesink, RESOURCE, FAILED,
("pa_threaded_mainloop_new() failed"), (NULL));
return GST_STATE_CHANGE_FAILURE;
diff --git a/ext/pulse/pulsesink.h b/ext/pulse/pulsesink.h
index 9f5ae2211..f2dcbbdf3 100644
--- a/ext/pulse/pulsesink.h
+++ b/ext/pulse/pulsesink.h
@@ -77,7 +77,7 @@ struct _GstPulseSink
GstStructure *properties;
pa_proplist *proplist;
- GMutex *sink_formats_lock;
+ GMutex sink_formats_lock;
GList *sink_formats;
volatile gint format_lost;
GstClockTime format_lost_time;
diff --git a/ext/soup/gstsouphttpclientsink.c b/ext/soup/gstsouphttpclientsink.c
index d8f46df9d..5dec06171 100644
--- a/ext/soup/gstsouphttpclientsink.c
+++ b/ext/soup/gstsouphttpclientsink.c
@@ -202,8 +202,8 @@ gst_soup_http_client_sink_init (GstSoupHttpClientSink * souphttpsink)
{
const char *proxy;
- souphttpsink->mutex = g_mutex_new ();
- souphttpsink->cond = g_cond_new ();
+ g_mutex_init (&souphttpsink->mutex);
+ g_cond_init (&souphttpsink->cond);
souphttpsink->location = NULL;
souphttpsink->automatic_redirect = TRUE;
@@ -260,7 +260,7 @@ gst_soup_http_client_sink_set_property (GObject * object, guint property_id,
{
GstSoupHttpClientSink *souphttpsink = GST_SOUP_HTTP_CLIENT_SINK (object);
- g_mutex_lock (souphttpsink->mutex);
+ g_mutex_lock (&souphttpsink->mutex);
switch (property_id) {
case PROP_SESSION:
if (souphttpsink->prop_session) {
@@ -321,7 +321,7 @@ gst_soup_http_client_sink_set_property (GObject * object, guint property_id,
break;
}
done:
- g_mutex_unlock (souphttpsink->mutex);
+ g_mutex_unlock (&souphttpsink->mutex);
}
void
@@ -403,8 +403,8 @@ gst_soup_http_client_sink_finalize (GObject * object)
soup_uri_free (souphttpsink->proxy);
g_free (souphttpsink->location);
- g_cond_free (souphttpsink->cond);
- g_mutex_free (souphttpsink->mutex);
+ g_cond_clear (&souphttpsink->cond);
+ g_mutex_clear (&souphttpsink->mutex);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
@@ -454,9 +454,9 @@ thread_ready_idle_cb (gpointer data)
GST_LOG_OBJECT (souphttpsink, "thread ready");
- g_mutex_lock (souphttpsink->mutex);
- g_cond_signal (souphttpsink->cond);
- g_mutex_unlock (souphttpsink->mutex);
+ g_mutex_lock (&souphttpsink->mutex);
+ g_cond_signal (&souphttpsink->cond);
+ g_mutex_unlock (&souphttpsink->mutex);
return FALSE; /* only run once */
}
@@ -497,7 +497,7 @@ gst_soup_http_client_sink_start (GstBaseSink * sink)
souphttpsink->loop = g_main_loop_new (souphttpsink->context, TRUE);
- g_mutex_lock (souphttpsink->mutex);
+ g_mutex_lock (&souphttpsink->mutex);
/* FIXME: error handling */
#if !GLIB_CHECK_VERSION (2, 31, 0)
@@ -509,8 +509,8 @@ gst_soup_http_client_sink_start (GstBaseSink * sink)
#endif
GST_LOG_OBJECT (souphttpsink, "waiting for main loop thread to start up");
- g_cond_wait (souphttpsink->cond, souphttpsink->mutex);
- g_mutex_unlock (souphttpsink->mutex);
+ g_cond_wait (&souphttpsink->cond, &souphttpsink->mutex);
+ g_mutex_unlock (&souphttpsink->mutex);
GST_LOG_OBJECT (souphttpsink, "main loop thread running");
souphttpsink->session =
@@ -574,12 +574,12 @@ gst_soup_http_client_sink_event (GstBaseSink * sink, GstEvent * event)
if (GST_EVENT_TYPE (event) == GST_EVENT_EOS) {
GST_DEBUG_OBJECT (souphttpsink, "got eos");
- g_mutex_lock (souphttpsink->mutex);
+ g_mutex_lock (&souphttpsink->mutex);
while (souphttpsink->message) {
GST_DEBUG_OBJECT (souphttpsink, "waiting");
- g_cond_wait (souphttpsink->cond, souphttpsink->mutex);
+ g_cond_wait (&souphttpsink->cond, &souphttpsink->mutex);
}
- g_mutex_unlock (souphttpsink->mutex);
+ g_mutex_unlock (&souphttpsink->mutex);
GST_DEBUG_OBJECT (souphttpsink, "finished eos");
}
@@ -687,9 +687,9 @@ send_message_locked (GstSoupHttpClientSink * souphttpsink)
static gboolean
send_message (GstSoupHttpClientSink * souphttpsink)
{
- g_mutex_lock (souphttpsink->mutex);
+ g_mutex_lock (&souphttpsink->mutex);
send_message_locked (souphttpsink);
- g_mutex_unlock (souphttpsink->mutex);
+ g_mutex_unlock (&souphttpsink->mutex);
return FALSE;
}
@@ -702,14 +702,14 @@ callback (SoupSession * session, SoupMessage * msg, gpointer user_data)
GST_DEBUG_OBJECT (souphttpsink, "callback status=%d %s",
msg->status_code, msg->reason_phrase);
- g_mutex_lock (souphttpsink->mutex);
- g_cond_signal (souphttpsink->cond);
+ g_mutex_lock (&souphttpsink->mutex);
+ g_cond_signal (&souphttpsink->cond);
souphttpsink->message = NULL;
if (!SOUP_STATUS_IS_SUCCESSFUL (msg->status_code)) {
souphttpsink->status_code = msg->status_code;
souphttpsink->reason_phrase = g_strdup (msg->reason_phrase);
- g_mutex_unlock (souphttpsink->mutex);
+ g_mutex_unlock (&souphttpsink->mutex);
return;
}
@@ -717,7 +717,7 @@ callback (SoupSession * session, SoupMessage * msg, gpointer user_data)
souphttpsink->sent_buffers = NULL;
send_message_locked (souphttpsink);
- g_mutex_unlock (souphttpsink->mutex);
+ g_mutex_unlock (&souphttpsink->mutex);
}
static GstFlowReturn
@@ -736,7 +736,7 @@ gst_soup_http_client_sink_render (GstBaseSink * sink, GstBuffer * buffer)
return GST_FLOW_ERROR;
}
- g_mutex_lock (souphttpsink->mutex);
+ g_mutex_lock (&souphttpsink->mutex);
if (souphttpsink->location != NULL) {
wake = (souphttpsink->queued_buffers == NULL);
souphttpsink->queued_buffers =
@@ -750,7 +750,7 @@ gst_soup_http_client_sink_render (GstBaseSink * sink, GstBuffer * buffer)
g_source_unref (source);
}
}
- g_mutex_unlock (souphttpsink->mutex);
+ g_mutex_unlock (&souphttpsink->mutex);
return GST_FLOW_OK;
}
diff --git a/ext/soup/gstsouphttpclientsink.h b/ext/soup/gstsouphttpclientsink.h
index fab143051..d8ed3da85 100644
--- a/ext/soup/gstsouphttpclientsink.h
+++ b/ext/soup/gstsouphttpclientsink.h
@@ -38,8 +38,8 @@ struct _GstSoupHttpClientSink
{
GstBaseSink base_souphttpsink;
- GMutex *mutex;
- GCond *cond;
+ GMutex mutex;
+ GCond cond;
GMainContext *context;
GMainLoop *loop;
GThread *thread;
diff --git a/ext/wavpack/gstwavpackparse.c b/ext/wavpack/gstwavpackparse.c
index 4bb1e7e2b..5ffa7a5f3 100644
--- a/ext/wavpack/gstwavpackparse.c
+++ b/ext/wavpack/gstwavpackparse.c
@@ -42,10 +42,6 @@
#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.h>
#include <gst/gst-i18n-plugin.h>
diff --git a/gst/avi/gstavidemux.c b/gst/avi/gstavidemux.c
index 1c2384b0b..da0943af7 100644
--- a/gst/avi/gstavidemux.c
+++ b/gst/avi/gstavidemux.c
@@ -45,10 +45,6 @@
#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 <stdio.h>
diff --git a/gst/equalizer/gstiirequalizer.c b/gst/equalizer/gstiirequalizer.c
index da7f8e43c..42ac1dad9 100644
--- a/gst/equalizer/gstiirequalizer.c
+++ b/gst/equalizer/gstiirequalizer.c
@@ -37,8 +37,8 @@
GST_DEBUG_CATEGORY (equalizer_debug);
#define GST_CAT_DEFAULT equalizer_debug
-#define BANDS_LOCK(equ) g_mutex_lock(equ->bands_lock)
-#define BANDS_UNLOCK(equ) g_mutex_unlock(equ->bands_lock)
+#define BANDS_LOCK(equ) g_mutex_lock(&equ->bands_lock)
+#define BANDS_UNLOCK(equ) g_mutex_unlock(&equ->bands_lock)
static void gst_iir_equalizer_child_proxy_interface_init (gpointer g_iface,
gpointer iface_data);
@@ -371,7 +371,7 @@ gst_iir_equalizer_class_init (GstIirEqualizerClass * klass)
static void
gst_iir_equalizer_init (GstIirEqualizer * eq)
{
- eq->bands_lock = g_mutex_new ();
+ g_mutex_init (&eq->bands_lock);
eq->need_new_coefficients = TRUE;
}
@@ -391,7 +391,7 @@ gst_iir_equalizer_finalize (GObject * object)
g_free (equ->bands);
g_free (equ->history);
- g_mutex_free (equ->bands_lock);
+ g_mutex_clear (&equ->bands_lock);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
diff --git a/gst/equalizer/gstiirequalizer.h b/gst/equalizer/gstiirequalizer.h
index f4bb10f0f..98f220097 100644
--- a/gst/equalizer/gstiirequalizer.h
+++ b/gst/equalizer/gstiirequalizer.h
@@ -50,7 +50,7 @@ struct _GstIirEqualizer
/*< private >*/
- GMutex *bands_lock;
+ GMutex bands_lock;
GstIirEqualizerBand **bands;
/* properties */
diff --git a/gst/flv/gstflvdemux.c b/gst/flv/gstflvdemux.c
index 47426c284..db8cd4ef3 100644
--- a/gst/flv/gstflvdemux.c
+++ b/gst/flv/gstflvdemux.c
@@ -34,10 +34,6 @@
#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 "gstflvdemux.h"
#include "gstflvmux.h"
diff --git a/gst/imagefreeze/gstimagefreeze.c b/gst/imagefreeze/gstimagefreeze.c
index 03c425d33..071ae7023 100644
--- a/gst/imagefreeze/gstimagefreeze.c
+++ b/gst/imagefreeze/gstimagefreeze.c
@@ -41,10 +41,6 @@
#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/glib-compat-private.h>
#include "gstimagefreeze.h"
diff --git a/gst/isomp4/gstqtmoovrecover.c b/gst/isomp4/gstqtmoovrecover.c
index 3fbfec329..eca365b26 100644
--- a/gst/isomp4/gstqtmoovrecover.c
+++ b/gst/isomp4/gstqtmoovrecover.c
@@ -65,10 +65,6 @@
#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 <glib/gstdio.h>
#include <gst/gst.h>
@@ -348,7 +344,7 @@ gst_qt_moov_recover_change_state (GstElement * element,
switch (transition) {
case GST_STATE_CHANGE_NULL_TO_READY:
qtmr->task = gst_task_new (gst_qt_moov_recover_run, qtmr);
- g_static_rec_mutex_init (&qtmr->task_mutex);
+ g_rec_mutex_init (&qtmr->task_mutex);
gst_task_set_lock (qtmr->task, &qtmr->task_mutex);
break;
case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
@@ -369,7 +365,7 @@ gst_qt_moov_recover_change_state (GstElement * element,
g_assert (gst_task_get_state (qtmr->task) == GST_TASK_STOPPED);
gst_object_unref (qtmr->task);
qtmr->task = NULL;
- g_static_rec_mutex_free (&qtmr->task_mutex);
+ g_rec_mutex_clear (&qtmr->task_mutex);
break;
default:
break;
diff --git a/gst/isomp4/gstqtmoovrecover.h b/gst/isomp4/gstqtmoovrecover.h
index 15eac847b..c37692179 100644
--- a/gst/isomp4/gstqtmoovrecover.h
+++ b/gst/isomp4/gstqtmoovrecover.h
@@ -66,7 +66,7 @@ struct _GstQTMoovRecover
GstPipeline pipeline;
GstTask *task;
- GStaticRecMutex task_mutex;
+ GRecMutex task_mutex;
/* properties */
gboolean faststart_mode;
diff --git a/gst/isomp4/qtdemux.c b/gst/isomp4/qtdemux.c
index b7511c5c7..64aca4393 100644
--- a/gst/isomp4/qtdemux.c
+++ b/gst/isomp4/qtdemux.c
@@ -47,10 +47,6 @@
#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 <glib/gprintf.h>
diff --git a/gst/matroska/matroska-demux.c b/gst/matroska/matroska-demux.c
index bf0beb634..1eed1603d 100644
--- a/gst/matroska/matroska-demux.c
+++ b/gst/matroska/matroska-demux.c
@@ -49,10 +49,6 @@
#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 <math.h>
#include <string.h>
#include <glib/gprintf.h>
diff --git a/gst/rtpmanager/gstrtpbin.c b/gst/rtpmanager/gstrtpbin.c
index 615fa3c41..45142a547 100644
--- a/gst/rtpmanager/gstrtpbin.c
+++ b/gst/rtpmanager/gstrtpbin.c
@@ -181,12 +181,12 @@ GST_STATIC_PAD_TEMPLATE ("send_rtp_src_%u",
#define GST_RTP_BIN_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_RTP_BIN, GstRtpBinPrivate))
-#define GST_RTP_BIN_LOCK(bin) g_mutex_lock ((bin)->priv->bin_lock)
-#define GST_RTP_BIN_UNLOCK(bin) g_mutex_unlock ((bin)->priv->bin_lock)
+#define GST_RTP_BIN_LOCK(bin) g_mutex_lock (&(bin)->priv->bin_lock)
+#define GST_RTP_BIN_UNLOCK(bin) g_mutex_unlock (&(bin)->priv->bin_lock)
/* lock to protect dynamic callbacks, like pad-added and new ssrc. */
-#define GST_RTP_BIN_DYN_LOCK(bin) g_mutex_lock ((bin)->priv->dyn_lock)
-#define GST_RTP_BIN_DYN_UNLOCK(bin) g_mutex_unlock ((bin)->priv->dyn_lock)
+#define GST_RTP_BIN_DYN_LOCK(bin) g_mutex_lock (&(bin)->priv->dyn_lock)
+#define GST_RTP_BIN_DYN_UNLOCK(bin) g_mutex_unlock (&(bin)->priv->dyn_lock)
/* lock for shutdown */
#define GST_RTP_BIN_SHUTDOWN_LOCK(bin,label) \
@@ -206,10 +206,10 @@ G_STMT_START { \
struct _GstRtpBinPrivate
{
- GMutex *bin_lock;
+ GMutex bin_lock;
/* lock protecting dynamic adding/removing */
- GMutex *dyn_lock;
+ GMutex dyn_lock;
/* if we are shutting down or not */
gint shutdown;
@@ -349,8 +349,8 @@ struct _GstRtpBinStream
gint64 clock_base;
};
-#define GST_RTP_SESSION_LOCK(sess) g_mutex_lock ((sess)->lock)
-#define GST_RTP_SESSION_UNLOCK(sess) g_mutex_unlock ((sess)->lock)
+#define GST_RTP_SESSION_LOCK(sess) g_mutex_lock (&(sess)->lock)
+#define GST_RTP_SESSION_UNLOCK(sess) g_mutex_unlock (&(sess)->lock)
/* Manages the receiving end of the packets.
*
@@ -373,7 +373,7 @@ struct _GstRtpBinSession
gulong demux_newpad_sig;
gulong demux_padremoved_sig;
- GMutex *lock;
+ GMutex lock;
/* list of GstRtpBinStream */
GSList *streams;
@@ -564,7 +564,7 @@ create_session (GstRtpBin * rtpbin, gint id)
goto no_demux;
sess = g_new0 (GstRtpBinSession, 1);
- sess->lock = g_mutex_new ();
+ g_mutex_init (&sess->lock);
sess->id = id;
sess->bin = rtpbin;
sess->session = session;
@@ -703,7 +703,7 @@ free_session (GstRtpBinSession * sess, GstRtpBin * bin)
g_slist_foreach (sess->streams, (GFunc) free_stream, NULL);
g_slist_free (sess->streams);
- g_mutex_free (sess->lock);
+ g_mutex_clear (&sess->lock);
g_hash_table_destroy (sess->ptmap);
g_free (sess);
@@ -1883,8 +1883,8 @@ gst_rtp_bin_init (GstRtpBin * rtpbin)
gchar *str;
rtpbin->priv = GST_RTP_BIN_GET_PRIVATE (rtpbin);
- rtpbin->priv->bin_lock = g_mutex_new ();
- rtpbin->priv->dyn_lock = g_mutex_new ();
+ g_mutex_init (&rtpbin->priv->bin_lock);
+ g_mutex_init (&rtpbin->priv->dyn_lock);
rtpbin->latency_ms = DEFAULT_LATENCY_MS;
rtpbin->latency_ns = DEFAULT_LATENCY_MS * GST_MSECOND;
@@ -1935,8 +1935,8 @@ gst_rtp_bin_finalize (GObject * object)
if (rtpbin->sdes)
gst_structure_free (rtpbin->sdes);
- g_mutex_free (rtpbin->priv->bin_lock);
- g_mutex_free (rtpbin->priv->dyn_lock);
+ g_mutex_clear (&rtpbin->priv->bin_lock);
+ g_mutex_clear (&rtpbin->priv->dyn_lock);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
diff --git a/gst/rtpmanager/gstrtpjitterbuffer.c b/gst/rtpmanager/gstrtpjitterbuffer.c
index e6ef09447..d3bfe6824 100644
--- a/gst/rtpmanager/gstrtpjitterbuffer.c
+++ b/gst/rtpmanager/gstrtpjitterbuffer.c
@@ -102,7 +102,7 @@ enum
PROP_LAST
};
-#define JBUF_LOCK(priv) (g_mutex_lock ((priv)->jbuf_lock))
+#define JBUF_LOCK(priv) (g_mutex_lock (&(priv)->jbuf_lock))
#define JBUF_LOCK_CHECK(priv,label) G_STMT_START { \
JBUF_LOCK (priv); \
@@ -110,8 +110,8 @@ enum
goto label; \
} G_STMT_END
-#define JBUF_UNLOCK(priv) (g_mutex_unlock ((priv)->jbuf_lock))
-#define JBUF_WAIT(priv) (g_cond_wait ((priv)->jbuf_cond, (priv)->jbuf_lock))
+#define JBUF_UNLOCK(priv) (g_mutex_unlock (&(priv)->jbuf_lock))
+#define JBUF_WAIT(priv) (g_cond_wait (&(priv)->jbuf_cond, &(priv)->jbuf_lock))
#define JBUF_WAIT_CHECK(priv,label) G_STMT_START { \
JBUF_WAIT(priv); \
@@ -119,7 +119,7 @@ enum
goto label; \
} G_STMT_END
-#define JBUF_SIGNAL(priv) (g_cond_signal ((priv)->jbuf_cond))
+#define JBUF_SIGNAL(priv) (g_cond_signal (&(priv)->jbuf_cond))
struct _GstRtpJitterBufferPrivate
{
@@ -127,8 +127,8 @@ struct _GstRtpJitterBufferPrivate
GstPad *rtcpsinkpad;
RTPJitterBuffer *jbuf;
- GMutex *jbuf_lock;
- GCond *jbuf_cond;
+ GMutex jbuf_lock;
+ GCond jbuf_cond;
gboolean waiting;
gboolean discont;
gboolean active;
@@ -464,8 +464,8 @@ gst_rtp_jitter_buffer_init (GstRtpJitterBuffer * jitterbuffer)
priv->do_lost = DEFAULT_DO_LOST;
priv->jbuf = rtp_jitter_buffer_new ();
- priv->jbuf_lock = g_mutex_new ();
- priv->jbuf_cond = g_cond_new ();
+ g_mutex_init (&priv->jbuf_lock);
+ g_cond_init (&priv->jbuf_cond);
/* reset skew detection initialy */
rtp_jitter_buffer_reset_skew (priv->jbuf);
@@ -508,8 +508,8 @@ gst_rtp_jitter_buffer_finalize (GObject * object)
jitterbuffer = GST_RTP_JITTER_BUFFER (object);
- g_mutex_free (jitterbuffer->priv->jbuf_lock);
- g_cond_free (jitterbuffer->priv->jbuf_cond);
+ g_mutex_clear (&jitterbuffer->priv->jbuf_lock);
+ g_cond_clear (&jitterbuffer->priv->jbuf_cond);
g_object_unref (jitterbuffer->priv->jbuf);
diff --git a/gst/rtpmanager/gstrtpsession.c b/gst/rtpmanager/gstrtpsession.c
index a5df3273b..8fd9e05a7 100644
--- a/gst/rtpmanager/gstrtpsession.c
+++ b/gst/rtpmanager/gstrtpsession.c
@@ -223,12 +223,12 @@ enum
#define GST_RTP_SESSION_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_RTP_SESSION, GstRtpSessionPrivate))
-#define GST_RTP_SESSION_LOCK(sess) g_mutex_lock ((sess)->priv->lock)
-#define GST_RTP_SESSION_UNLOCK(sess) g_mutex_unlock ((sess)->priv->lock)
+#define GST_RTP_SESSION_LOCK(sess) g_mutex_lock (&(sess)->priv->lock)
+#define GST_RTP_SESSION_UNLOCK(sess) g_mutex_unlock (&(sess)->priv->lock)
struct _GstRtpSessionPrivate
{
- GMutex *lock;
+ GMutex lock;
GstClock *sysclock;
RTPSession *session;
@@ -621,7 +621,7 @@ static void
gst_rtp_session_init (GstRtpSession * rtpsession)
{
rtpsession->priv = GST_RTP_SESSION_GET_PRIVATE (rtpsession);
- rtpsession->priv->lock = g_mutex_new ();
+ g_mutex_init (&rtpsession->priv->lock);
rtpsession->priv->sysclock = gst_system_clock_obtain ();
rtpsession->priv->session = rtp_session_new ();
rtpsession->priv->use_pipeline_clock = DEFAULT_USE_PIPELINE_CLOCK;
@@ -664,7 +664,7 @@ gst_rtp_session_finalize (GObject * object)
rtpsession = GST_RTP_SESSION (object);
g_hash_table_destroy (rtpsession->priv->ptmap);
- g_mutex_free (rtpsession->priv->lock);
+ g_mutex_clear (&rtpsession->priv->lock);
g_object_unref (rtpsession->priv->sysclock);
g_object_unref (rtpsession->priv->session);
diff --git a/gst/rtpmanager/gstrtpssrcdemux.c b/gst/rtpmanager/gstrtpssrcdemux.c
index 8a350ba65..257cb9d40 100644
--- a/gst/rtpmanager/gstrtpssrcdemux.c
+++ b/gst/rtpmanager/gstrtpssrcdemux.c
@@ -44,10 +44,6 @@
#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/rtp/gstrtpbuffer.h>
#include <gst/rtp/gstrtcpbuffer.h>
@@ -87,8 +83,8 @@ GST_STATIC_PAD_TEMPLATE ("rtcp_src_%u",
GST_STATIC_CAPS ("application/x-rtcp")
);
-#define GST_PAD_LOCK(obj) (g_static_rec_mutex_lock (&(obj)->padlock))
-#define GST_PAD_UNLOCK(obj) (g_static_rec_mutex_unlock (&(obj)->padlock))
+#define GST_PAD_LOCK(obj) (g_rec_mutex_lock (&(obj)->padlock))
+#define GST_PAD_UNLOCK(obj) (g_rec_mutex_unlock (&(obj)->padlock))
/* signals */
enum
@@ -338,7 +334,7 @@ gst_rtp_ssrc_demux_init (GstRtpSsrcDemux * demux)
gst_rtp_ssrc_demux_iterate_internal_links_sink);
gst_element_add_pad (GST_ELEMENT_CAST (demux), demux->rtcp_sink);
- g_static_rec_mutex_init (&demux->padlock);
+ g_rec_mutex_init (&demux->padlock);
gst_segment_init (&demux->segment, GST_FORMAT_UNDEFINED);
}
@@ -380,7 +376,7 @@ gst_rtp_ssrc_demux_finalize (GObject * object)
GstRtpSsrcDemux *demux;
demux = GST_RTP_SSRC_DEMUX (object);
- g_static_rec_mutex_free (&demux->padlock);
+ g_rec_mutex_clear (&demux->padlock);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
diff --git a/gst/rtpmanager/gstrtpssrcdemux.h b/gst/rtpmanager/gstrtpssrcdemux.h
index 6f792d968..9233bc0e4 100644
--- a/gst/rtpmanager/gstrtpssrcdemux.h
+++ b/gst/rtpmanager/gstrtpssrcdemux.h
@@ -41,7 +41,7 @@ struct _GstRtpSsrcDemux
GstPad *rtp_sink;
GstPad *rtcp_sink;
- GStaticRecMutex padlock;
+ GRecMutex padlock;
GSList *srcpads;
};
diff --git a/gst/rtpmanager/rtpsession.c b/gst/rtpmanager/rtpsession.c
index 47ca3f63d..4846d9210 100644
--- a/gst/rtpmanager/rtpsession.c
+++ b/gst/rtpmanager/rtpsession.c
@@ -449,7 +449,7 @@ rtp_session_init (RTPSession * sess)
gint i;
gchar *str;
- sess->lock = g_mutex_new ();
+ g_mutex_init (&sess->lock);
sess->key = g_random_int ();
sess->mask_idx = 0;
sess->mask = 0;
@@ -513,7 +513,7 @@ rtp_session_finalize (GObject * object)
sess = RTP_SESSION_CAST (object);
- g_mutex_free (sess->lock);
+ g_mutex_clear (&sess->lock);
for (i = 0; i < 32; i++)
g_hash_table_destroy (sess->ssrcs[i]);
diff --git a/gst/rtpmanager/rtpsession.h b/gst/rtpmanager/rtpsession.h
index 929b6d494..8ca9458c7 100644
--- a/gst/rtpmanager/rtpsession.h
+++ b/gst/rtpmanager/rtpsession.h
@@ -34,8 +34,8 @@ typedef struct _RTPSessionClass RTPSessionClass;
#define RTP_IS_SESSION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),RTP_TYPE_SESSION))
#define RTP_SESSION_CAST(sess) ((RTPSession *)(sess))
-#define RTP_SESSION_LOCK(sess) (g_mutex_lock ((sess)->lock))
-#define RTP_SESSION_UNLOCK(sess) (g_mutex_unlock ((sess)->lock))
+#define RTP_SESSION_LOCK(sess) (g_mutex_lock (&(sess)->lock))
+#define RTP_SESSION_UNLOCK(sess) (g_mutex_unlock (&(sess)->lock))
/**
* RTPSessionProcessRTP:
@@ -184,7 +184,7 @@ typedef struct {
struct _RTPSession {
GObject object;
- GMutex *lock;
+ GMutex lock;
guint header_len;
guint mtu;
diff --git a/gst/rtsp/gstrtspsrc.c b/gst/rtsp/gstrtspsrc.c
index c096c5102..4f29a06ca 100644
--- a/gst/rtsp/gstrtspsrc.c
+++ b/gst/rtsp/gstrtspsrc.c
@@ -81,10 +81,6 @@
#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
-
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif /* HAVE_UNISTD_H */
@@ -515,12 +511,10 @@ gst_rtspsrc_init (GstRTSPSrc * src)
/* protects the streaming thread in interleaved mode or the polling
* thread in UDP mode. */
- src->stream_rec_lock = g_new (GStaticRecMutex, 1);
- g_static_rec_mutex_init (src->stream_rec_lock);
+ g_rec_mutex_init (&src->stream_rec_lock);
/* protects our state changes from multiple invocations */
- src->state_rec_lock = g_new (GStaticRecMutex, 1);
- g_static_rec_mutex_init (src->state_rec_lock);
+ g_rec_mutex_init (&src->state_rec_lock);
src->state = GST_RTSP_STATE_INVALID;
@@ -547,10 +541,8 @@ gst_rtspsrc_finalize (GObject * object)
}
/* free locks */
- g_static_rec_mutex_free (rtspsrc->stream_rec_lock);
- g_free (rtspsrc->stream_rec_lock);
- g_static_rec_mutex_free (rtspsrc->state_rec_lock);
- g_free (rtspsrc->state_rec_lock);
+ g_rec_mutex_clear (&rtspsrc->stream_rec_lock);
+ g_rec_mutex_clear (&rtspsrc->state_rec_lock);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
diff --git a/gst/rtsp/gstrtspsrc.h b/gst/rtsp/gstrtspsrc.h
index bcfa31e75..9e208bfd0 100644
--- a/gst/rtsp/gstrtspsrc.h
+++ b/gst/rtsp/gstrtspsrc.h
@@ -71,13 +71,13 @@ G_BEGIN_DECLS
typedef struct _GstRTSPSrc GstRTSPSrc;
typedef struct _GstRTSPSrcClass GstRTSPSrcClass;
-#define GST_RTSP_STATE_GET_LOCK(rtsp) (GST_RTSPSRC_CAST(rtsp)->state_rec_lock)
-#define GST_RTSP_STATE_LOCK(rtsp) (g_static_rec_mutex_lock (GST_RTSP_STATE_GET_LOCK(rtsp)))
-#define GST_RTSP_STATE_UNLOCK(rtsp) (g_static_rec_mutex_unlock (GST_RTSP_STATE_GET_LOCK(rtsp)))
+#define GST_RTSP_STATE_GET_LOCK(rtsp) (&GST_RTSPSRC_CAST(rtsp)->state_rec_lock)
+#define GST_RTSP_STATE_LOCK(rtsp) (g_rec_mutex_lock (GST_RTSP_STATE_GET_LOCK(rtsp)))
+#define GST_RTSP_STATE_UNLOCK(rtsp) (g_rec_mutex_unlock (GST_RTSP_STATE_GET_LOCK(rtsp)))
-#define GST_RTSP_STREAM_GET_LOCK(rtsp) (GST_RTSPSRC_CAST(rtsp)->stream_rec_lock)
-#define GST_RTSP_STREAM_LOCK(rtsp) (g_static_rec_mutex_lock (GST_RTSP_STREAM_GET_LOCK(rtsp)))
-#define GST_RTSP_STREAM_UNLOCK(rtsp) (g_static_rec_mutex_unlock (GST_RTSP_STREAM_GET_LOCK(rtsp)))
+#define GST_RTSP_STREAM_GET_LOCK(rtsp) (&GST_RTSPSRC_CAST(rtsp)->stream_rec_lock)
+#define GST_RTSP_STREAM_LOCK(rtsp) (g_rec_mutex_lock (GST_RTSP_STREAM_GET_LOCK(rtsp)))
+#define GST_RTSP_STREAM_UNLOCK(rtsp) (g_rec_mutex_unlock (GST_RTSP_STREAM_GET_LOCK(rtsp)))
typedef struct _GstRTSPConnInfo GstRTSPConnInfo;
@@ -168,7 +168,7 @@ struct _GstRTSPSrc {
/* task and mutex for interleaved mode */
gboolean interleaved;
GstTask *task;
- GStaticRecMutex *stream_rec_lock;
+ GRecMutex stream_rec_lock;
GstSegment segment;
gboolean running;
gboolean need_range;
@@ -184,7 +184,7 @@ struct _GstRTSPSrc {
gboolean open_error;
/* mutex for protecting state changes */
- GStaticRecMutex *state_rec_lock;
+ GRecMutex state_rec_lock;
GstSDPMessage *sdp;
gboolean from_sdp;
diff --git a/gst/shapewipe/gstshapewipe.c b/gst/shapewipe/gstshapewipe.c
index 1a4d86024..b17712679 100644
--- a/gst/shapewipe/gstshapewipe.c
+++ b/gst/shapewipe/gstshapewipe.c
@@ -194,8 +194,8 @@ gst_shape_wipe_init (GstShapeWipe * self)
GST_DEBUG_FUNCPTR (gst_shape_wipe_src_query));
gst_element_add_pad (GST_ELEMENT (self), self->srcpad);
- self->mask_mutex = g_mutex_new ();
- self->mask_cond = g_cond_new ();
+ g_mutex_init (&self->mask_mutex);
+ g_cond_init (&self->mask_cond);
gst_shape_wipe_reset (self);
}
@@ -253,13 +253,8 @@ gst_shape_wipe_finalize (GObject * object)
gst_shape_wipe_reset (self);
- if (self->mask_cond)
- g_cond_free (self->mask_cond);
- self->mask_cond = NULL;
-
- if (self->mask_mutex)
- g_mutex_free (self->mask_mutex);
- self->mask_mutex = NULL;
+ g_cond_clear (&self->mask_cond);
+ g_mutex_clear (&self->mask_mutex);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
@@ -273,9 +268,9 @@ gst_shape_wipe_reset (GstShapeWipe * self)
gst_buffer_unref (self->mask);
self->mask = NULL;
- g_mutex_lock (self->mask_mutex);
- g_cond_signal (self->mask_cond);
- g_mutex_unlock (self->mask_mutex);
+ g_mutex_lock (&self->mask_mutex);
+ g_cond_signal (&self->mask_cond);
+ g_mutex_unlock (&self->mask_mutex);
gst_video_info_init (&self->info);
self->mask_bpp = 0;
@@ -298,12 +293,12 @@ gst_shape_wipe_video_sink_setcaps (GstShapeWipe * self, GstCaps * caps)
goto invalid_caps;
if (self->info.width != info.width || self->info.height != info.height) {
- g_mutex_lock (self->mask_mutex);
+ g_mutex_lock (&self->mask_mutex);
self->info = info;
if (self->mask)
gst_buffer_unref (self->mask);
self->mask = NULL;
- g_mutex_unlock (self->mask_mutex);
+ g_mutex_unlock (&self->mask_mutex);
}
@@ -857,19 +852,19 @@ gst_shape_wipe_video_sink_chain (GstPad * pad, GstObject * parent,
"Blending buffer with timestamp %" GST_TIME_FORMAT " at position %f",
GST_TIME_ARGS (timestamp), self->mask_position);
- g_mutex_lock (self->mask_mutex);
+ g_mutex_lock (&self->mask_mutex);
if (self->shutdown)
goto shutdown;
if (!self->mask)
- g_cond_wait (self->mask_cond, self->mask_mutex);
+ g_cond_wait (&self->mask_cond, &self->mask_mutex);
if (self->mask == NULL || self->shutdown) {
goto shutdown;
} else {
mask = gst_buffer_ref (self->mask);
}
- g_mutex_unlock (self->mask_mutex);
+ g_mutex_unlock (&self->mask_mutex);
if (!gst_shape_wipe_do_qos (self, GST_BUFFER_TIMESTAMP (buffer)))
goto qos;
@@ -958,12 +953,12 @@ gst_shape_wipe_mask_sink_chain (GstPad * pad, GstObject * parent,
GstShapeWipe *self = GST_SHAPE_WIPE (parent);
GstFlowReturn ret = GST_FLOW_OK;
- g_mutex_lock (self->mask_mutex);
+ g_mutex_lock (&self->mask_mutex);
GST_DEBUG_OBJECT (self, "Setting new mask buffer: %" GST_PTR_FORMAT, buffer);
gst_buffer_replace (&self->mask, buffer);
- g_cond_signal (self->mask_cond);
- g_mutex_unlock (self->mask_mutex);
+ g_cond_signal (&self->mask_cond);
+ g_mutex_unlock (&self->mask_mutex);
gst_buffer_unref (buffer);
@@ -982,10 +977,10 @@ gst_shape_wipe_change_state (GstElement * element, GstStateChange transition)
break;
case GST_STATE_CHANGE_PAUSED_TO_READY:
/* Unblock video sink chain function */
- g_mutex_lock (self->mask_mutex);
+ g_mutex_lock (&self->mask_mutex);
self->shutdown = TRUE;
- g_cond_signal (self->mask_cond);
- g_mutex_unlock (self->mask_mutex);
+ g_cond_signal (&self->mask_cond);
+ g_mutex_unlock (&self->mask_mutex);
break;
default:
break;
@@ -1067,9 +1062,9 @@ gst_shape_wipe_mask_sink_event (GstPad * pad, GstObject * parent,
break;
}
case GST_EVENT_FLUSH_STOP:
- g_mutex_lock (self->mask_mutex);
+ g_mutex_lock (&self->mask_mutex);
gst_buffer_replace (&self->mask, NULL);
- g_mutex_unlock (self->mask_mutex);
+ g_mutex_unlock (&self->mask_mutex);
break;
default:
break;
diff --git a/gst/shapewipe/gstshapewipe.h b/gst/shapewipe/gstshapewipe.h
index 296ef597a..860f3f41d 100644
--- a/gst/shapewipe/gstshapewipe.h
+++ b/gst/shapewipe/gstshapewipe.h
@@ -55,8 +55,8 @@ struct _GstShapeWipe
GstBuffer *mask;
gfloat mask_position;
gfloat mask_border;
- GMutex *mask_mutex;
- GCond *mask_cond;
+ GMutex mask_mutex;
+ GCond mask_cond;
gint mask_bpp;
GstVideoInfo info;
diff --git a/gst/udp/gstmultiudpsink.c b/gst/udp/gstmultiudpsink.c
index 3871a6e1d..96dfb02d6 100644
--- a/gst/udp/gstmultiudpsink.c
+++ b/gst/udp/gstmultiudpsink.c
@@ -326,7 +326,7 @@ gst_multiudpsink_class_init (GstMultiUDPSinkClass * klass)
static void
gst_multiudpsink_init (GstMultiUDPSink * sink)
{
- sink->client_lock = g_mutex_new ();
+ g_mutex_init (&sink->client_lock);
sink->socket = DEFAULT_SOCKET;
sink->used_socket = DEFAULT_USED_SOCKET;
sink->close_socket = DEFAULT_CLOSE_SOCKET;
@@ -429,7 +429,7 @@ gst_multiudpsink_finalize (GObject * object)
g_object_unref (sink->cancellable);
sink->cancellable = NULL;
- g_mutex_free (sink->client_lock);
+ g_mutex_clear (&sink->client_lock);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
@@ -475,7 +475,7 @@ gst_multiudpsink_render (GstBaseSink * bsink, GstBuffer * buffer)
/* grab lock while iterating and sending to clients, this should be
* fast as UDP never blocks */
- g_mutex_lock (sink->client_lock);
+ g_mutex_lock (&sink->client_lock);
GST_LOG_OBJECT (bsink, "about to send %d bytes", size);
no_clients = 0;
@@ -506,7 +506,7 @@ gst_multiudpsink_render (GstBaseSink * bsink, GstBuffer * buffer)
sink->bytes_served += ret;
}
}
- g_mutex_unlock (sink->client_lock);
+ g_mutex_unlock (&sink->client_lock);
/* unmap all memory again */
for (i = 0; i < n_mem; i++) {
@@ -545,7 +545,7 @@ gst_multiudpsink_set_clients_string (GstMultiUDPSink * sink,
clients = g_strsplit (string, ",", 0);
- g_mutex_lock (sink->client_lock);
+ g_mutex_lock (&sink->client_lock);
/* clear all existing clients */
gst_multiudpsink_clear_internal (sink, FALSE);
for (i = 0; clients[i]; i++) {
@@ -561,7 +561,7 @@ gst_multiudpsink_set_clients_string (GstMultiUDPSink * sink,
if (port != 0)
gst_multiudpsink_add_internal (sink, host, port, FALSE);
}
- g_mutex_unlock (sink->client_lock);
+ g_mutex_unlock (&sink->client_lock);
g_strfreev (clients);
}
@@ -574,7 +574,7 @@ gst_multiudpsink_get_clients_string (GstMultiUDPSink * sink)
str = g_string_new ("");
- g_mutex_lock (sink->client_lock);
+ g_mutex_lock (&sink->client_lock);
clients = sink->clients;
while (clients) {
GstUDPClient *client;
@@ -590,7 +590,7 @@ gst_multiudpsink_get_clients_string (GstMultiUDPSink * sink)
(clients || count > 1 ? "," : ""));
}
}
- g_mutex_unlock (sink->client_lock);
+ g_mutex_unlock (&sink->client_lock);
return g_string_free (str, FALSE);
}
@@ -919,7 +919,7 @@ gst_multiudpsink_add_internal (GstMultiUDPSink * sink, const gchar * host,
GST_DEBUG_OBJECT (sink, "adding client on host %s, port %d", host, port);
if (lock)
- g_mutex_lock (sink->client_lock);
+ g_mutex_lock (&sink->client_lock);
find = g_list_find_custom (sink->clients, &udpclient,
(GCompareFunc) client_compare);
@@ -945,7 +945,7 @@ gst_multiudpsink_add_internal (GstMultiUDPSink * sink, const gchar * host,
}
if (lock)
- g_mutex_unlock (sink->client_lock);
+ g_mutex_unlock (&sink->client_lock);
g_signal_emit (G_OBJECT (sink),
gst_multiudpsink_signals[SIGNAL_CLIENT_ADDED], 0, host, port);
@@ -959,7 +959,7 @@ error:
GST_DEBUG_OBJECT (sink, "did not add client on host %s, port %d", host,
port);
if (lock)
- g_mutex_unlock (sink->client_lock);
+ g_mutex_unlock (&sink->client_lock);
return;
}
}
@@ -981,7 +981,7 @@ gst_multiudpsink_remove (GstMultiUDPSink * sink, const gchar * host, gint port)
udpclient.host = (gchar *) host;
udpclient.port = port;
- g_mutex_lock (sink->client_lock);
+ g_mutex_lock (&sink->client_lock);
find = g_list_find_custom (sink->clients, &udpclient,
(GCompareFunc) client_compare);
if (!find)
@@ -1015,23 +1015,23 @@ gst_multiudpsink_remove (GstMultiUDPSink * sink, const gchar * host, gint port)
}
/* Unlock to emit signal before we delete the actual client */
- g_mutex_unlock (sink->client_lock);
+ g_mutex_unlock (&sink->client_lock);
g_signal_emit (G_OBJECT (sink),
gst_multiudpsink_signals[SIGNAL_CLIENT_REMOVED], 0, host, port);
- g_mutex_lock (sink->client_lock);
+ g_mutex_lock (&sink->client_lock);
sink->clients = g_list_delete_link (sink->clients, find);
free_client (client);
}
- g_mutex_unlock (sink->client_lock);
+ g_mutex_unlock (&sink->client_lock);
return;
/* ERRORS */
not_found:
{
- g_mutex_unlock (sink->client_lock);
+ g_mutex_unlock (&sink->client_lock);
GST_WARNING_OBJECT (sink, "client at host %s, port %d not found",
host, port);
return;
@@ -1045,12 +1045,12 @@ gst_multiudpsink_clear_internal (GstMultiUDPSink * sink, gboolean lock)
/* we only need to remove the client structure, there is no additional
* socket or anything to free for UDP */
if (lock)
- g_mutex_lock (sink->client_lock);
+ g_mutex_lock (&sink->client_lock);
g_list_foreach (sink->clients, (GFunc) free_client, sink);
g_list_free (sink->clients);
sink->clients = NULL;
if (lock)
- g_mutex_unlock (sink->client_lock);
+ g_mutex_unlock (&sink->client_lock);
}
void
@@ -1071,7 +1071,7 @@ gst_multiudpsink_get_stats (GstMultiUDPSink * sink, const gchar * host,
udpclient.host = (gchar *) host;
udpclient.port = port;
- g_mutex_lock (sink->client_lock);
+ g_mutex_lock (&sink->client_lock);
find = g_list_find_custom (sink->clients, &udpclient,
(GCompareFunc) client_compare);
@@ -1090,14 +1090,14 @@ gst_multiudpsink_get_stats (GstMultiUDPSink * sink, const gchar * host,
"connect-time", G_TYPE_UINT64, client->connect_time,
"disconnect-time", G_TYPE_UINT64, client->disconnect_time, NULL);
- g_mutex_unlock (sink->client_lock);
+ g_mutex_unlock (&sink->client_lock);
return result;
/* ERRORS */
not_found:
{
- g_mutex_unlock (sink->client_lock);
+ g_mutex_unlock (&sink->client_lock);
GST_WARNING_OBJECT (sink, "client with host %s, port %d not found",
host, port);
/* Apparently (see comment in gstmultifdsink.c) returning NULL from here may
diff --git a/gst/udp/gstmultiudpsink.h b/gst/udp/gstmultiudpsink.h
index aa5f2e9eb..e003822ed 100644
--- a/gst/udp/gstmultiudpsink.h
+++ b/gst/udp/gstmultiudpsink.h
@@ -60,7 +60,7 @@ struct _GstMultiUDPSink {
GSocket *used_socket;
GCancellable *cancellable;
- GMutex *client_lock;
+ GMutex client_lock;
GList *clients;
/* properties */
diff --git a/gst/videomixer/videomixer2.c b/gst/videomixer/videomixer2.c
index b8d419ae9..e72031d5f 100644
--- a/gst/videomixer/videomixer2.c
+++ b/gst/videomixer/videomixer2.c
@@ -86,10 +86,6 @@
#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 "videomixer2.h"
diff --git a/gst/wavparse/gstwavparse.c b/gst/wavparse/gstwavparse.c
index 1306a9a26..9045ecd7c 100644
--- a/gst/wavparse/gstwavparse.c
+++ b/gst/wavparse/gstwavparse.c
@@ -50,10 +50,6 @@
#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 <math.h>
diff --git a/sys/v4l2/gstv4l2videooverlay.c b/sys/v4l2/gstv4l2videooverlay.c
index 6ac15cdf4..702c1a5c1 100644
--- a/sys/v4l2/gstv4l2videooverlay.c
+++ b/sys/v4l2/gstv4l2videooverlay.c
@@ -45,7 +45,7 @@ struct _GstV4l2Xv
{
Display *dpy;
gint port, idle_id, event_id;
- GMutex *mutex; /* to serialize calls to X11 */
+ GMutex mutex; /* to serialize calls to X11 */
};
GST_DEBUG_CATEGORY_STATIC (v4l2xv_debug);
@@ -131,7 +131,7 @@ gst_v4l2_video_overlay_open (GstV4l2Object * v4l2object)
v4l2xv = g_new0 (GstV4l2Xv, 1);
v4l2xv->dpy = dpy;
v4l2xv->port = id;
- v4l2xv->mutex = g_mutex_new ();
+ g_mutex_init (&v4l2xv->mutex);
v4l2xv->idle_id = 0;
v4l2xv->event_id = 0;
v4l2object->xv = v4l2xv;
@@ -155,7 +155,7 @@ gst_v4l2_video_overlay_close (GstV4l2Object * v4l2object)
}
XCloseDisplay (v4l2xv->dpy);
- g_mutex_free (v4l2xv->mutex);
+ g_mutex_clear (&v4l2xv->mutex);
if (v4l2xv->idle_id)
g_source_remove (v4l2xv->idle_id);
if (v4l2xv->event_id)
@@ -204,9 +204,9 @@ gst_v4l2_video_overlay_get_render_rect (GstV4l2Object * v4l2object,
GstV4l2Xv *v4l2xv = v4l2object->xv;
gboolean ret = FALSE;
if (v4l2xv) {
- g_mutex_lock (v4l2xv->mutex);
+ g_mutex_lock (&v4l2xv->mutex);
ret = get_render_rect (v4l2object, rect);
- g_mutex_unlock (v4l2xv->mutex);
+ g_mutex_unlock (&v4l2xv->mutex);
}
return ret;
}
@@ -236,12 +236,12 @@ idle_refresh (gpointer data)
GST_LOG_OBJECT (v4l2object->element, "idle refresh");
if (v4l2xv) {
- g_mutex_lock (v4l2xv->mutex);
+ g_mutex_lock (&v4l2xv->mutex);
update_geometry (v4l2object);
v4l2xv->idle_id = 0;
- g_mutex_unlock (v4l2xv->mutex);
+ g_mutex_unlock (&v4l2xv->mutex);
}
/* once */
@@ -260,7 +260,7 @@ event_refresh (gpointer data)
if (v4l2xv) {
XEvent e;
- g_mutex_lock (v4l2xv->mutex);
+ g_mutex_lock (&v4l2xv->mutex);
/* If the element supports navigation, collect the relavent input
* events and push them upstream as navigation events
@@ -287,10 +287,10 @@ event_refresh (gpointer data)
if (pointer_moved) {
GST_DEBUG_OBJECT (v4l2object->element,
"pointer moved over window at %d,%d", pointer_x, pointer_y);
- g_mutex_unlock (v4l2xv->mutex);
+ g_mutex_unlock (&v4l2xv->mutex);
gst_navigation_send_mouse_event (GST_NAVIGATION (v4l2object->element),
"mouse-move", 0, e.xbutton.x, e.xbutton.y);
- g_mutex_lock (v4l2xv->mutex);
+ g_mutex_lock (&v4l2xv->mutex);
}
/* We get all events on our window to throw them upstream
@@ -301,7 +301,7 @@ event_refresh (gpointer data)
KeySym keysym;
const char *key_str = NULL;
- g_mutex_unlock (v4l2xv->mutex);
+ g_mutex_unlock (&v4l2xv->mutex);
switch (e.type) {
case ButtonPress:
@@ -322,14 +322,14 @@ event_refresh (gpointer data)
break;
case KeyPress:
case KeyRelease:
- g_mutex_lock (v4l2xv->mutex);
+ g_mutex_lock (&v4l2xv->mutex);
keysym = XKeycodeToKeysym (v4l2xv->dpy, e.xkey.keycode, 0);
if (keysym != NoSymbol) {
key_str = XKeysymToString (keysym);
} else {
key_str = "unknown";
}
- g_mutex_unlock (v4l2xv->mutex);
+ g_mutex_unlock (&v4l2xv->mutex);
GST_DEBUG_OBJECT (v4l2object->element,
"key %d pressed over window at %d,%d (%s)",
e.xkey.keycode, e.xkey.x, e.xkey.y, key_str);
@@ -341,7 +341,7 @@ event_refresh (gpointer data)
"unhandled X event (%d)", e.type);
}
- g_mutex_lock (v4l2xv->mutex);
+ g_mutex_lock (&v4l2xv->mutex);
}
}
@@ -356,7 +356,7 @@ event_refresh (gpointer data)
break;
}
}
- g_mutex_unlock (v4l2xv->mutex);
+ g_mutex_unlock (&v4l2xv->mutex);
}
/* repeat */
@@ -380,7 +380,7 @@ gst_v4l2_video_overlay_set_window_handle (GstV4l2Object * v4l2object,
v4l2xv = v4l2object->xv;
if (v4l2xv)
- g_mutex_lock (v4l2xv->mutex);
+ g_mutex_lock (&v4l2xv->mutex);
if (change) {
if (v4l2object->xwindow_id && v4l2xv) {
@@ -397,7 +397,7 @@ gst_v4l2_video_overlay_set_window_handle (GstV4l2Object * v4l2object,
if (!v4l2xv || xwindow_id == 0) {
if (v4l2xv)
- g_mutex_unlock (v4l2xv->mutex);
+ g_mutex_unlock (&v4l2xv->mutex);
return;
}
@@ -415,7 +415,7 @@ gst_v4l2_video_overlay_set_window_handle (GstV4l2Object * v4l2object,
if (v4l2xv->idle_id)
g_source_remove (v4l2xv->idle_id);
v4l2xv->idle_id = g_idle_add (idle_refresh, v4l2object);
- g_mutex_unlock (v4l2xv->mutex);
+ g_mutex_unlock (&v4l2xv->mutex);
}
/**
@@ -456,7 +456,7 @@ gst_v4l2_video_overlay_prepare_window_handle (GstV4l2Object * v4l2object,
/* video_overlay is supported, but we don't have a window.. so create one */
GST_DEBUG_OBJECT (v4l2object->element, "creating window");
- g_mutex_lock (v4l2xv->mutex);
+ g_mutex_lock (&v4l2xv->mutex);
width = XDisplayWidth (v4l2xv->dpy, DefaultScreen (v4l2xv->dpy));
height = XDisplayHeight (v4l2xv->dpy, DefaultScreen (v4l2xv->dpy));
@@ -481,7 +481,7 @@ gst_v4l2_video_overlay_prepare_window_handle (GstV4l2Object * v4l2object,
XSync (v4l2xv->dpy, FALSE);
- g_mutex_unlock (v4l2xv->mutex);
+ g_mutex_unlock (&v4l2xv->mutex);
GST_DEBUG_OBJECT (v4l2object->element, "got window");
diff --git a/sys/ximage/gstximagesrc.c b/sys/ximage/gstximagesrc.c
index 41559c5d5..6ed75ce87 100644
--- a/sys/ximage/gstximagesrc.c
+++ b/sys/ximage/gstximagesrc.c
@@ -94,18 +94,18 @@ gst_ximage_src_return_buf (GstXImageSrc * ximagesrc, GstBuffer * ximage)
GST_DEBUG_OBJECT (ximagesrc,
"destroy image %p as its size changed %dx%d vs current %dx%d",
ximage, meta->width, meta->height, ximagesrc->width, ximagesrc->height);
- g_mutex_lock (ximagesrc->x_lock);
+ g_mutex_lock (&ximagesrc->x_lock);
gst_ximageutil_ximage_destroy (ximagesrc->xcontext, ximage);
- g_mutex_unlock (ximagesrc->x_lock);
+ g_mutex_unlock (&ximagesrc->x_lock);
} else {
/* In that case we can reuse the image and add it to our image pool. */
GST_LOG_OBJECT (ximagesrc, "recycling image %p in pool", ximage);
/* need to increment the refcount again to recycle */
gst_buffer_ref (ximage);
- g_mutex_lock (ximagesrc->pool_lock);
+ g_mutex_lock (&ximagesrc->pool_lock);
GST_BUFFER_FLAGS (GST_BUFFER (ximage)) = 0; /* clear out any flags from the previous use */
ximagesrc->buffer_pool = g_slist_prepend (ximagesrc->buffer_pool, ximage);
- g_mutex_unlock (ximagesrc->pool_lock);
+ g_mutex_unlock (&ximagesrc->pool_lock);
}
}
@@ -146,10 +146,10 @@ gst_ximage_src_open_display (GstXImageSrc * s, const gchar * name)
if (s->xcontext != NULL)
return TRUE;
- g_mutex_lock (s->x_lock);
+ g_mutex_lock (&s->x_lock);
s->xcontext = ximageutil_xcontext_get (GST_ELEMENT (s), name);
if (s->xcontext == NULL) {
- g_mutex_unlock (s->x_lock);
+ g_mutex_unlock (&s->x_lock);
GST_ELEMENT_ERROR (s, RESOURCE, OPEN_READ,
("Could not open X display for reading"),
("NULL returned from getting xcontext"));
@@ -259,7 +259,7 @@ use_root_window:
#endif
#endif
- g_mutex_unlock (s->x_lock);
+ g_mutex_unlock (&s->x_lock);
if (s->xcontext == NULL)
return FALSE;
@@ -301,7 +301,7 @@ gst_ximage_src_stop (GstBaseSrc * basesrc)
#endif
if (src->xcontext) {
- g_mutex_lock (src->x_lock);
+ g_mutex_lock (&src->x_lock);
#ifdef HAVE_XDAMAGE
if (src->damage_copy_gc != None) {
@@ -320,7 +320,7 @@ gst_ximage_src_stop (GstBaseSrc * basesrc)
ximageutil_xcontext_clear (src->xcontext);
src->xcontext = NULL;
- g_mutex_unlock (src->x_lock);
+ g_mutex_unlock (&src->x_lock);
}
return TRUE;
@@ -454,7 +454,7 @@ gst_ximage_src_ximage_get (GstXImageSrc * ximagesrc)
GstBuffer *ximage = NULL;
GstMetaXImage *meta;
- g_mutex_lock (ximagesrc->pool_lock);
+ g_mutex_lock (&ximagesrc->pool_lock);
while (ximagesrc->buffer_pool != NULL) {
ximage = ximagesrc->buffer_pool->data;
@@ -468,16 +468,13 @@ gst_ximage_src_ximage_get (GstXImageSrc * ximagesrc)
ximagesrc->buffer_pool = g_slist_delete_link (ximagesrc->buffer_pool,
ximagesrc->buffer_pool);
}
- g_mutex_unlock (ximagesrc->pool_lock);
+ g_mutex_unlock (&ximagesrc->pool_lock);
if (ximage == NULL) {
- GstXContext *xcontext;
- GstCaps *caps = NULL;
-
GST_DEBUG_OBJECT (ximagesrc, "creating image (%dx%d)",
ximagesrc->width, ximagesrc->height);
- g_mutex_lock (ximagesrc->x_lock);
+ g_mutex_lock (&ximagesrc->x_lock);
ximage = gst_ximageutil_ximage_new (ximagesrc->xcontext,
GST_ELEMENT (ximagesrc), ximagesrc->width, ximagesrc->height,
(BufferReturnFunc) (gst_ximage_src_return_buf));
@@ -485,29 +482,11 @@ gst_ximage_src_ximage_get (GstXImageSrc * ximagesrc)
GST_ELEMENT_ERROR (ximagesrc, RESOURCE, WRITE, (NULL),
("could not create a %dx%d ximage", ximagesrc->width,
ximagesrc->height));
- g_mutex_unlock (ximagesrc->x_lock);
+ g_mutex_unlock (&ximagesrc->x_lock);
return NULL;
}
- xcontext = ximagesrc->xcontext;
-
- caps = gst_caps_new_simple ("video/x-raw-rgb",
- "bpp", G_TYPE_INT, xcontext->bpp,
- "depth", G_TYPE_INT, xcontext->depth,
- "endianness", G_TYPE_INT, xcontext->endianness,
- "red_mask", G_TYPE_INT, xcontext->r_mask_output,
- "green_mask", G_TYPE_INT, xcontext->g_mask_output,
- "blue_mask", G_TYPE_INT, xcontext->b_mask_output,
- "width", G_TYPE_INT, ximagesrc->width,
- "height", G_TYPE_INT, ximagesrc->height,
- "framerate", GST_TYPE_FRACTION, ximagesrc->fps_n, ximagesrc->fps_d,
- "pixel-aspect-ratio", GST_TYPE_FRACTION,
- gst_value_get_fraction_numerator (xcontext->par),
- gst_value_get_fraction_denominator (xcontext->par), NULL);
-
- g_mutex_unlock (ximagesrc->x_lock);
-
- gst_caps_unref (caps);
+ g_mutex_unlock (&ximagesrc->x_lock);
}
g_return_val_if_fail (GST_IS_XIMAGE_SRC (ximagesrc), NULL);
@@ -998,7 +977,7 @@ gst_ximage_src_get_property (GObject * object, guint prop_id, GValue * value,
static void
gst_ximage_src_clear_bufpool (GstXImageSrc * ximagesrc)
{
- g_mutex_lock (ximagesrc->pool_lock);
+ g_mutex_lock (&ximagesrc->pool_lock);
while (ximagesrc->buffer_pool != NULL) {
GstBuffer *ximage = ximagesrc->buffer_pool->data;
@@ -1007,7 +986,7 @@ gst_ximage_src_clear_bufpool (GstXImageSrc * ximagesrc)
ximagesrc->buffer_pool = g_slist_delete_link (ximagesrc->buffer_pool,
ximagesrc->buffer_pool);
}
- g_mutex_unlock (ximagesrc->pool_lock);
+ g_mutex_unlock (&ximagesrc->pool_lock);
}
static void
@@ -1028,8 +1007,8 @@ gst_ximage_src_finalize (GObject * object)
ximageutil_xcontext_clear (src->xcontext);
g_free (src->xname);
- g_mutex_free (src->pool_lock);
- g_mutex_free (src->x_lock);
+ g_mutex_clear (&src->pool_lock);
+ g_mutex_clear (&src->x_lock);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
@@ -1289,8 +1268,8 @@ gst_ximage_src_init (GstXImageSrc * ximagesrc)
gst_base_src_set_format (GST_BASE_SRC (ximagesrc), GST_FORMAT_TIME);
gst_base_src_set_live (GST_BASE_SRC (ximagesrc), TRUE);
- ximagesrc->pool_lock = g_mutex_new ();
- ximagesrc->x_lock = g_mutex_new ();
+ g_mutex_init (&ximagesrc->pool_lock);
+ g_mutex_init (&ximagesrc->x_lock);
ximagesrc->show_pointer = TRUE;
ximagesrc->use_damage = TRUE;
ximagesrc->startx = 0;
diff --git a/sys/ximage/gstximagesrc.h b/sys/ximage/gstximagesrc.h
index a5f9d7920..7f5275a85 100644
--- a/sys/ximage/gstximagesrc.h
+++ b/sys/ximage/gstximagesrc.h
@@ -69,10 +69,10 @@ struct _GstXImageSrc
gint64 last_frame_no;
/* Protect X Windows calls */
- GMutex *x_lock;
+ GMutex x_lock;
/* Gathered pool of emitted buffers */
- GMutex *pool_lock;
+ GMutex pool_lock;
GSList *buffer_pool;
/* XFixes and XDamage support */
diff --git a/tests/check/elements/deinterleave.c b/tests/check/elements/deinterleave.c
index f4cb201dd..cafe834fe 100644
--- a/tests/check/elements/deinterleave.c
+++ b/tests/check/elements/deinterleave.c
@@ -23,7 +23,6 @@
#include <stdio.h>
#include <gst/check/gstcheck.h>
-#include <gst/audio/multichannel.h>
GST_START_TEST (test_create_and_unref)
{