glmemorypbo: only create a pbo memory if the context actually supports it
authorMatthew Waters <matthew@centricular.com>
Wed, 30 Dec 2015 01:11:09 +0000 (12:11 +1100)
committerMatthew Waters <matthew@centricular.com>
Wed, 30 Dec 2015 01:16:29 +0000 (12:16 +1100)
e.g. GL <= 2.0 does not support pbo usage and GL 2.1 only supports pbo upload.

gst-libs/gst/gl/gstglmemorypbo.c

index 8318212d6f7dfb92e2b9d2421466384cd50117e0..15e9110c9b9f6aad66a9c1673c1745b721dbca38 100644 (file)
@@ -239,8 +239,8 @@ _gl_mem_create (GstGLMemoryPBO * gl_mem, GError ** error)
   if (!alloc_class->create ((GstGLBaseMemory *) gl_mem, error))
     return FALSE;
 
-  if (USING_OPENGL (context) || USING_OPENGL3 (context)
-      || USING_GLES3 (context)) {
+  if (CONTEXT_SUPPORTS_PBO_DOWNLOAD (context)
+      || CONTEXT_SUPPORTS_PBO_UPLOAD (context)) {
     GstAllocationParams alloc_params =
         { 0, GST_MEMORY_CAST (gl_mem)->align, 0, 0 };
     GstGLBaseMemoryAllocator *buf_allocator;