]> code.ossystems Code Review - meta-freescale.git/blob
d50290da1e0985fd888af187e66379abff5e6278
[meta-freescale.git] /
1 From 5b7e83390bbf87e67079c1dc8fcf12b321d7b0a0 Mon Sep 17 00:00:00 2001
2 From: Jeremy Stashluk <jstashluk@dekaresearch.com>
3 Date: Tue, 19 Feb 2013 09:46:29 -0500
4 Subject: remove deprecated glib semaphores
5
6 glib deprecated g_{mutex|cond}_new calls since version 3.32. Replace
7 with the updated g_{mutex|cond}_init calls.
8
9 ===================================================================
10
11 Upstream-Status: Pending
12
13 Signed-off-by: Jeremy Stashluk <jstashluk@dekaresearch.com>
14 ---
15  gst-libs/gst/gl/gstgldisplay.c      |   20 +++++++++++---------
16  gst-libs/gst/gl/gstglmixer.c        |    5 +++--
17  gst-libs/gst/gl/gstglwindow_fbES2.c |   15 +++++++++------
18  3 files changed, 23 insertions(+), 17 deletions(-)
19
20 diff --git a/gst-libs/gst/gl/gstgldisplay.c b/gst-libs/gst/gl/gstgldisplay.c
21 index a2589cb..1beac40 100644
22 --- a/gst-libs/gst/gl/gstgldisplay.c
23 +++ b/gst-libs/gst/gl/gstgldisplay.c
24 @@ -124,7 +124,8 @@ static void
25  gst_gl_display_init (GstGLDisplay * display, GstGLDisplayClass * klass)
26  {
27    //thread safe
28 -  display->mutex = g_mutex_new ();
29 +  display->mutex = g_new (GMutex, 1);
30 +  g_mutex_init (display->mutex);
31  
32    //gl context
33    display->gl_thread = NULL;
34 @@ -133,8 +134,10 @@ gst_gl_display_init (GstGLDisplay * display, GstGLDisplayClass * klass)
35    display->texture_pool = g_hash_table_new (g_direct_hash, g_direct_equal);
36  
37    //conditions
38 -  display->cond_create_context = g_cond_new ();
39 -  display->cond_destroy_context = g_cond_new ();
40 +  display->cond_create_context = g_new (GCond, 1);
41 +  g_cond_init (display->cond_create_context);
42 +  display->cond_destroy_context = g_new (GCond, 1);
43 +  g_cond_init (display->cond_destroy_context);
44  
45    //action redisplay
46    display->redisplay_texture = 0;
47 @@ -518,15 +521,15 @@ gst_gl_display_finalize (GObject * object)
48      display->texture_pool = NULL;
49    }
50    if (display->mutex) {
51 -    g_mutex_free (display->mutex);
52 +    g_mutex_clear (display->mutex);
53      display->mutex = NULL;
54    }
55    if (display->cond_destroy_context) {
56 -    g_cond_free (display->cond_destroy_context);
57 +    g_cond_clear (display->cond_destroy_context);
58      display->cond_destroy_context = NULL;
59    }
60    if (display->cond_create_context) {
61 -    g_cond_free (display->cond_create_context);
62 +    g_cond_clear (display->cond_create_context);
63      display->cond_create_context = NULL;
64    }
65    if (display->clientReshapeCallback)
66 @@ -2257,9 +2260,8 @@ gst_gl_display_create_context (GstGLDisplay * display,
67    if (!display->gl_window) {
68      display->external_gl_context = external_gl_context;
69  
70 -    display->gl_thread = g_thread_create (
71 -        (GThreadFunc) gst_gl_display_thread_create_context, display, TRUE,
72 -        NULL);
73 +    display->gl_thread = g_thread_new ("",
74 +        (GThreadFunc) gst_gl_display_thread_create_context, display);
75  
76      g_cond_wait (display->cond_create_context, display->mutex);
77  
78 diff --git a/gst-libs/gst/gl/gstglmixer.c b/gst-libs/gst/gl/gstglmixer.c
79 index 745ca1d..105b7c9 100644
80 --- a/gst-libs/gst/gl/gstglmixer.c
81 +++ b/gst-libs/gst/gl/gstglmixer.c
82 @@ -376,7 +376,8 @@ gst_gl_mixer_init (GstGLMixer * mix, GstGLMixerClass * g_class)
83    gst_collect_pads_set_function (mix->collect,
84        (GstCollectPadsFunction) GST_DEBUG_FUNCPTR (gst_gl_mixer_collected), mix);
85  
86 -  mix->state_lock = g_mutex_new ();
87 +  mix->state_lock = g_new (GMutex, 1);
88 +  g_mutex_init (mix->state_lock);
89  
90    mix->array_buffers = 0;
91    mix->display = NULL;
92 @@ -393,7 +394,7 @@ gst_gl_mixer_finalize (GObject * object)
93    GstGLMixer *mix = GST_GL_MIXER (object);
94  
95    gst_object_unref (mix->collect);
96 -  g_mutex_free (mix->state_lock);
97 +  g_mutex_clear (mix->state_lock);
98  
99    G_OBJECT_CLASS (parent_class)->finalize (object);
100  }
101 diff --git a/gst-libs/gst/gl/gstglwindow_fbES2.c b/gst-libs/gst/gl/gstglwindow_fbES2.c
102 index 57c02e1..d73cada 100644
103 --- a/gst-libs/gst/gl/gstglwindow_fbES2.c
104 +++ b/gst-libs/gst/gl/gstglwindow_fbES2.c
105 @@ -143,19 +143,19 @@ gst_gl_window_finalize (GObject * object)
106    priv->queue = NULL;
107  
108    if (priv->cond_send_message) {
109 -    g_cond_free (priv->cond_send_message);
110 +    g_cond_clear (priv->cond_send_message);
111      priv->cond_send_message = NULL;
112    }
113  
114    if (priv->cond_queue_message) {
115 -    g_cond_free (priv->cond_queue_message);
116 +    g_cond_clear (priv->cond_queue_message);
117      priv->cond_queue_message = NULL;
118    }
119  
120    g_mutex_unlock (priv->lock);
121  
122    if (priv->lock) {
123 -    g_mutex_free (priv->lock);
124 +    g_mutex_clear (priv->lock);
125      priv->lock = NULL;
126    }
127  
128 @@ -300,9 +300,12 @@ gst_gl_window_new (gulong external_gl_context)
129  
130    setlocale (LC_NUMERIC, "C");
131  
132 -  priv->lock = g_mutex_new ();
133 -  priv->cond_send_message = g_cond_new ();
134 -  priv->cond_queue_message = g_cond_new ();
135 +  priv->lock = g_new (GMutex, 1);
136 +  g_mutex_init (priv->lock);
137 +  priv->cond_send_message = g_new (GCond, 1);
138 +  g_cond_init (priv->cond_send_message);
139 +  priv->cond_queue_message = g_new (GCond, 1);
140 +  g_cond_init (priv->cond_queue_message);
141    priv->running = TRUE;
142    priv->allow_extra_expose_events = TRUE;
143  
144 -- 
145 1.7.9.5
146