glmemorypbo: don't double read pixels
authorMatthew Waters <matthew@centricular.com>
Thu, 7 Jan 2016 09:54:41 +0000 (20:54 +1100)
committerTim-Philipp Müller <tim@centricular.com>
Sat, 9 Dec 2017 19:32:14 +0000 (19:32 +0000)
The optimistic download_transfer was not setting the required flag to not
perform glReadPixels on subsequent map (READ). resulting in glReadPixels
happening twice.

gst-libs/gst/gl/gstglmemorypbo.c

index 9649c6abf818b28e5af911c7f84cb83ece6603d6..37fe85a724c282adcbd8f43f287751c81ded9689 100644 (file)
@@ -792,6 +792,7 @@ _download_transfer (GstGLContext * context, GstGLMemoryPBO * gl_mem)
   if (_read_pixels_to_pbo (gl_mem))
     GST_CAT_TRACE (GST_CAT_GL_MEMORY, "optimistic download of texture %u "
         "using pbo %u", gl_mem->mem.tex_id, gl_mem->pbo->id);
+  GST_MEMORY_FLAG_UNSET (gl_mem, GST_GL_BASE_MEMORY_TRANSFER_NEED_DOWNLOAD);
   g_mutex_unlock (&mem->lock);
 }