From 5b7e83390bbf87e67079c1dc8fcf12b321d7b0a0 Mon Sep 17 00:00:00 2001 From: Jeremy Stashluk Date: Tue, 19 Feb 2013 09:46:29 -0500 Subject: remove deprecated glib semaphores glib deprecated g_{mutex|cond}_new calls since version 3.32. Replace with the updated g_{mutex|cond}_init calls. =================================================================== Upstream-Status: Pending Signed-off-by: Jeremy Stashluk --- gst-libs/gst/gl/gstgldisplay.c | 20 +++++++++++--------- gst-libs/gst/gl/gstglmixer.c | 5 +++-- gst-libs/gst/gl/gstglwindow_fbES2.c | 15 +++++++++------ 3 files changed, 23 insertions(+), 17 deletions(-) diff --git a/gst-libs/gst/gl/gstgldisplay.c b/gst-libs/gst/gl/gstgldisplay.c index a2589cb..1beac40 100644 --- a/gst-libs/gst/gl/gstgldisplay.c +++ b/gst-libs/gst/gl/gstgldisplay.c @@ -124,7 +124,8 @@ static void gst_gl_display_init (GstGLDisplay * display, GstGLDisplayClass * klass) { //thread safe - display->mutex = g_mutex_new (); + display->mutex = g_new (GMutex, 1); + g_mutex_init (display->mutex); //gl context display->gl_thread = NULL; @@ -133,8 +134,10 @@ gst_gl_display_init (GstGLDisplay * display, GstGLDisplayClass * klass) display->texture_pool = g_hash_table_new (g_direct_hash, g_direct_equal); //conditions - display->cond_create_context = g_cond_new (); - display->cond_destroy_context = g_cond_new (); + display->cond_create_context = g_new (GCond, 1); + g_cond_init (display->cond_create_context); + display->cond_destroy_context = g_new (GCond, 1); + g_cond_init (display->cond_destroy_context); //action redisplay display->redisplay_texture = 0; @@ -518,15 +521,15 @@ gst_gl_display_finalize (GObject * object) display->texture_pool = NULL; } if (display->mutex) { - g_mutex_free (display->mutex); + g_mutex_clear (display->mutex); display->mutex = NULL; } if (display->cond_destroy_context) { - g_cond_free (display->cond_destroy_context); + g_cond_clear (display->cond_destroy_context); display->cond_destroy_context = NULL; } if (display->cond_create_context) { - g_cond_free (display->cond_create_context); + g_cond_clear (display->cond_create_context); display->cond_create_context = NULL; } if (display->clientReshapeCallback) @@ -2257,9 +2260,8 @@ gst_gl_display_create_context (GstGLDisplay * display, if (!display->gl_window) { display->external_gl_context = external_gl_context; - display->gl_thread = g_thread_create ( - (GThreadFunc) gst_gl_display_thread_create_context, display, TRUE, - NULL); + display->gl_thread = g_thread_new ("", + (GThreadFunc) gst_gl_display_thread_create_context, display); g_cond_wait (display->cond_create_context, display->mutex); diff --git a/gst-libs/gst/gl/gstglmixer.c b/gst-libs/gst/gl/gstglmixer.c index 745ca1d..105b7c9 100644 --- a/gst-libs/gst/gl/gstglmixer.c +++ b/gst-libs/gst/gl/gstglmixer.c @@ -376,7 +376,8 @@ gst_gl_mixer_init (GstGLMixer * mix, GstGLMixerClass * g_class) gst_collect_pads_set_function (mix->collect, (GstCollectPadsFunction) GST_DEBUG_FUNCPTR (gst_gl_mixer_collected), mix); - mix->state_lock = g_mutex_new (); + mix->state_lock = g_new (GMutex, 1); + g_mutex_init (mix->state_lock); mix->array_buffers = 0; mix->display = NULL; @@ -393,7 +394,7 @@ gst_gl_mixer_finalize (GObject * object) GstGLMixer *mix = GST_GL_MIXER (object); gst_object_unref (mix->collect); - g_mutex_free (mix->state_lock); + g_mutex_clear (mix->state_lock); G_OBJECT_CLASS (parent_class)->finalize (object); } diff --git a/gst-libs/gst/gl/gstglwindow_fbES2.c b/gst-libs/gst/gl/gstglwindow_fbES2.c index 57c02e1..d73cada 100644 --- a/gst-libs/gst/gl/gstglwindow_fbES2.c +++ b/gst-libs/gst/gl/gstglwindow_fbES2.c @@ -143,19 +143,19 @@ gst_gl_window_finalize (GObject * object) priv->queue = NULL; if (priv->cond_send_message) { - g_cond_free (priv->cond_send_message); + g_cond_clear (priv->cond_send_message); priv->cond_send_message = NULL; } if (priv->cond_queue_message) { - g_cond_free (priv->cond_queue_message); + g_cond_clear (priv->cond_queue_message); priv->cond_queue_message = NULL; } g_mutex_unlock (priv->lock); if (priv->lock) { - g_mutex_free (priv->lock); + g_mutex_clear (priv->lock); priv->lock = NULL; } @@ -300,9 +300,12 @@ gst_gl_window_new (gulong external_gl_context) setlocale (LC_NUMERIC, "C"); - priv->lock = g_mutex_new (); - priv->cond_send_message = g_cond_new (); - priv->cond_queue_message = g_cond_new (); + priv->lock = g_new (GMutex, 1); + g_mutex_init (priv->lock); + priv->cond_send_message = g_new (GCond, 1); + g_cond_init (priv->cond_send_message); + priv->cond_queue_message = g_new (GCond, 1); + g_cond_init (priv->cond_queue_message); priv->running = TRUE; priv->allow_extra_expose_events = TRUE; -- 1.7.9.5