summaryrefslogtreecommitdiffstats
path: root/recipes-multimedia/gstreamer/gst-plugins-gl/0002-remove-deprecated-glib-semaphores.patch
blob: d50290da1e0985fd888af187e66379abff5e6278 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
From 5b7e83390bbf87e67079c1dc8fcf12b321d7b0a0 Mon Sep 17 00:00:00 2001
From: Jeremy Stashluk <jstashluk@dekaresearch.com>
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 <jstashluk@dekaresearch.com>
---
 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