From 28d3ab2922df0c4727ab82f73eeb00bcded2772f Mon Sep 17 00:00:00 2001 From: Matthew Waters Date: Tue, 15 Nov 2016 14:36:11 +1100 Subject: [PATCH] glbufferpool: introduce check for GLMemory allocators The last missing piece of EGLImage support has been pushed. --- gst-libs/gst/gl/gstglbufferpool.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/gst-libs/gst/gl/gstglbufferpool.c b/gst-libs/gst/gl/gstglbufferpool.c index 4b3cf28..a12f750 100644 --- a/gst-libs/gst/gl/gstglbufferpool.c +++ b/gst-libs/gst/gl/gstglbufferpool.c @@ -115,8 +115,13 @@ gst_gl_buffer_pool_set_config (GstBufferPool * pool, GstStructure * config) if (priv->allocator) gst_object_unref (priv->allocator); - if (allocator /* && GST_IS_GL_MEMORY_ALLOCATOR (allocator) FIXME EGLImage */ ) { - priv->allocator = gst_object_ref (allocator); + if (allocator) { + if (!GST_IS_GL_MEMORY_ALLOCATOR (allocator)) { + gst_object_unref (allocator); + goto wrong_allocator; + } else { + priv->allocator = gst_object_ref (allocator); + } } else { priv->allocator = GST_ALLOCATOR (gst_gl_memory_allocator_get_default (glpool->context)); @@ -241,6 +246,11 @@ wrong_caps: "failed getting geometry from caps %" GST_PTR_FORMAT, caps); return FALSE; } +wrong_allocator: + { + GST_WARNING_OBJECT (pool, "Incorrect allocator type for this pool"); + return FALSE; + } } static gboolean -- 2.7.4