Patchwork [meta-fsl-arm] gst-plugins-gl: Avoid leaking memory

login
register
mail settings
Submitter Otavio Salvador
Date April 5, 2013, 1:54 p.m.
Message ID <1365170082-15965-1-git-send-email-otavio@ossystems.com.br>
Download mbox | patch
Permalink /patch/47495/
State Accepted
Delegated to: Otavio Salvador
Headers show

Comments

Otavio Salvador - April 5, 2013, 1:54 p.m.
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>
---
 .../0002-remove-deprecated-glib-semaphores.patch   | 146 ---------------------
 .../gstreamer/gst-plugins-gl_0.10.3.bbappend       |   9 +-
 2 files changed, 4 insertions(+), 151 deletions(-)
 delete mode 100644 recipes-multimedia/gstreamer/gst-plugins-gl/0002-remove-deprecated-glib-semaphores.patch

Patch

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 @@ 
-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
-
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 @@ 
 # gst-plugins-gl for imx6 Vivante
 
 FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
-PRINC := "${@int(PRINC) + 2}"
+PRINC := "${@int(PRINC) + 3}"
 
 DEPENDS_append_mx6 = " gst-fsl-plugin gpu-viv-bin-mx6q"
 
-SRC_URI_append_mx6 = " \
-   file://0001-freescale-mx6-release-1.1.0.patch \
-   file://0002-remove-deprecated-glib-semaphores.patch \
-   "
+SRC_URI_append_mx6 = " file://0001-freescale-mx6-release-1.1.0.patch"
+
+CFLAGS_append_mx6 = " -DGLIB_DISABLE_DEPRECATION_WARNINGS"