[720/906] examples: Stop using deprecated GLib thread API

This commit is contained in:
Sebastian Dröge 2013-06-28 11:00:46 +02:00 committed by Matthew Waters
parent 98cca97840
commit bef97ad03e
3 changed files with 3 additions and 10 deletions

View file

@ -71,7 +71,7 @@ create_window (GstBus * bus, GstMessage * message, gpointer data)
{ {
GstGLClutterActor **actor = (GstGLClutterActor **) data; GstGLClutterActor **actor = (GstGLClutterActor **) data;
static gint count = 0; static gint count = 0;
static GMutex *mutex = NULL; static GMutex mutex;
// ignore anything but 'prepare-window-handle' element messages // ignore anything but 'prepare-window-handle' element messages
if (GST_MESSAGE_TYPE (message) != GST_MESSAGE_ELEMENT) if (GST_MESSAGE_TYPE (message) != GST_MESSAGE_ELEMENT)
return GST_BUS_PASS; return GST_BUS_PASS;
@ -79,10 +79,7 @@ create_window (GstBus * bus, GstMessage * message, gpointer data)
if (!gst_is_video_overlay_prepare_window_handle_message (message)) if (!gst_is_video_overlay_prepare_window_handle_message (message))
return GST_BUS_PASS; return GST_BUS_PASS;
if (!mutex) g_mutex_lock (&mutex);
mutex = g_mutex_new ();
g_mutex_lock (mutex);
if (count < N_ACTORS) { if (count < N_ACTORS) {
g_message ("adding actor %d", count); g_message ("adding actor %d", count);
@ -92,7 +89,7 @@ create_window (GstBus * bus, GstMessage * message, gpointer data)
count++; count++;
} }
g_mutex_unlock (mutex); g_mutex_unlock (&mutex);
gst_message_unref (message); gst_message_unref (message);
return GST_BUS_DROP; return GST_BUS_DROP;

View file

@ -132,8 +132,6 @@ main (gint argc, gchar * argv[])
{NULL} {NULL}
}; };
g_thread_init (NULL);
context = g_option_context_new (NULL); context = g_option_context_new (NULL);
g_option_context_add_main_entries (context, options, NULL); g_option_context_add_main_entries (context, options, NULL);
g_option_context_add_group (context, gst_init_get_option_group ()); g_option_context_add_group (context, gst_init_get_option_group ());

View file

@ -213,8 +213,6 @@ main (gint argc, gchar * argv[])
{NULL} {NULL}
}; };
g_thread_init (NULL);
context = g_option_context_new (NULL); context = g_option_context_new (NULL);
g_option_context_add_main_entries (context, options, NULL); g_option_context_add_main_entries (context, options, NULL);
g_option_context_add_group (context, gst_init_get_option_group ()); g_option_context_add_group (context, gst_init_get_option_group ());