summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorWang Xin-yu (王昕宇) <comicfans44@gmail.com>2016-01-21 10:40:36 +0800
committerMatthew Waters <matthew@centricular.com>2016-02-17 10:30:45 +1100
commit5b1872e3873a2f27a61a2cfe01afc42996e27a0a (patch)
treeaa9dfd3870ad4d9e2ae15713bbb97a5d0f5abfa7 /ext
parentac690978f29c7addb90908fe2d597e8f8e0ba2b8 (diff)
downloadgstreamer-plugins-bad-5b1872e3873a2f27a61a2cfe01afc42996e27a0a.tar.gz
glvideomixer: don't leak pad's vertex buffer on release_pad
https://bugzilla.gnome.org/show_bug.cgi?id=760873
Diffstat (limited to 'ext')
-rw-r--r--ext/gl/gstglvideomixer.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/ext/gl/gstglvideomixer.c b/ext/gl/gstglvideomixer.c
index e0fd42775..e48151bd0 100644
--- a/ext/gl/gstglvideomixer.c
+++ b/ext/gl/gstglvideomixer.c
@@ -837,6 +837,26 @@ gst_gl_video_mixer_pad_set_property (GObject * object, guint prop_id,
}
static void
+_del_buffer (GstGLContext * context, GLuint * pBuffer)
+{
+ context->gl_vtable->DeleteBuffers (1, pBuffer);
+}
+
+static void
+gst_gl_video_mixer_release_pad (GstElement * element, GstPad * p)
+{
+ GstGLVideoMixerPad *pad = GST_GL_VIDEO_MIXER_PAD (p);
+ if (pad->vertex_buffer) {
+ GstGLBaseMixer *mix = GST_GL_BASE_MIXER (element);
+ gst_gl_context_thread_add (mix->context, (GstGLContextThreadFunc)
+ _del_buffer, &pad->vertex_buffer);
+ pad->vertex_buffer = 0;
+ }
+ GST_ELEMENT_CLASS (g_type_class_peek_parent (G_OBJECT_GET_CLASS (element)))
+ ->release_pad (element, p);
+}
+
+static void
gst_gl_video_mixer_class_init (GstGLVideoMixerClass * klass)
{
GObjectClass *gobject_class;
@@ -846,6 +866,7 @@ gst_gl_video_mixer_class_init (GstGLVideoMixerClass * klass)
gobject_class = (GObjectClass *) klass;
element_class = GST_ELEMENT_CLASS (klass);
+ element_class->release_pad = gst_gl_video_mixer_release_pad;
gobject_class->set_property = gst_gl_video_mixer_set_property;
gobject_class->get_property = gst_gl_video_mixer_get_property;