diff options
author | Otavio Salvador <otavio@ossystems.com.br> | 2013-04-04 22:19:25 -0300 |
---|---|---|
committer | Otavio Salvador <otavio@ossystems.com.br> | 2013-04-05 10:43:38 -0300 |
commit | 680c6a38caff58a8f06df2f640e00671a1b1cca2 (patch) | |
tree | 75f429a71e0ae278c93ea56c1c9c00358f037746 /recipes-multimedia | |
parent | 0a9469a14c593d7fb2c2b17fa6c91e0e49e29158 (diff) | |
download | meta-fsl-arm-680c6a38caff58a8f06df2f640e00671a1b1cca2.tar.gz |
gst-plugins-gl: Avoid leaking memory
The previous patch used to rework the framebuffer backend to avoid
GLib deprecated calls leaked memory.
To reduce the amount of patches we need to maintain we are dropping
the patch completely and disabling the build warnings for deprecated
GLib calls allowing it to build for framebuffer and X11 without
problem.
Change-Id: Iaf289bc174b45c69ef6d0c590e12daef78e65a49
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Diffstat (limited to 'recipes-multimedia')
-rw-r--r-- | recipes-multimedia/gstreamer/gst-plugins-gl/0002-remove-deprecated-glib-semaphores.patch | 146 | ||||
-rw-r--r-- | recipes-multimedia/gstreamer/gst-plugins-gl_0.10.3.bbappend | 9 |
2 files changed, 4 insertions, 151 deletions
diff --git a/recipes-multimedia/gstreamer/gst-plugins-gl/0002-remove-deprecated-glib-semaphores.patch b/recipes-multimedia/gstreamer/gst-plugins-gl/0002-remove-deprecated-glib-semaphores.patch deleted file mode 100644 index d50290d..0000000 --- a/recipes-multimedia/gstreamer/gst-plugins-gl/0002-remove-deprecated-glib-semaphores.patch +++ /dev/null | |||
@@ -1,146 +0,0 @@ | |||
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 | |||
diff --git a/recipes-multimedia/gstreamer/gst-plugins-gl_0.10.3.bbappend b/recipes-multimedia/gstreamer/gst-plugins-gl_0.10.3.bbappend index 65257d5..912e040 100644 --- a/recipes-multimedia/gstreamer/gst-plugins-gl_0.10.3.bbappend +++ b/recipes-multimedia/gstreamer/gst-plugins-gl_0.10.3.bbappend | |||
@@ -1,11 +1,10 @@ | |||
1 | # gst-plugins-gl for imx6 Vivante | 1 | # gst-plugins-gl for imx6 Vivante |
2 | 2 | ||
3 | FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" | 3 | FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" |
4 | PRINC := "${@int(PRINC) + 2}" | 4 | PRINC := "${@int(PRINC) + 3}" |
5 | 5 | ||
6 | DEPENDS_append_mx6 = " gst-fsl-plugin gpu-viv-bin-mx6q" | 6 | DEPENDS_append_mx6 = " gst-fsl-plugin gpu-viv-bin-mx6q" |
7 | 7 | ||
8 | SRC_URI_append_mx6 = " \ | 8 | SRC_URI_append_mx6 = " file://0001-freescale-mx6-release-1.1.0.patch" |
9 | file://0001-freescale-mx6-release-1.1.0.patch \ | 9 | |
10 | file://0002-remove-deprecated-glib-semaphores.patch \ | 10 | CFLAGS_append_mx6 = " -DGLIB_DISABLE_DEPRECATION_WARNINGS" |
11 | " | ||