glmemory: fix consistency about pbo availability.

https://bugzilla.gnome.org/show_bug.cgi?id=751165
This commit is contained in:
Julien Isorce 2015-06-22 14:06:04 +01:00 committed by Tim-Philipp Müller
parent 76983d4454
commit 1edc569069

View file

@ -843,9 +843,12 @@ _gl_mem_map_buffer (GstGLMemory * gl_mem, GstMapInfo * info, gsize maxsize)
if ((info->flags & GST_MAP_GL) == GST_MAP_GL) {
if ((info->flags & GST_MAP_READ) == GST_MAP_READ) {
GST_TRACE ("mapping GL texture:%u for reading", gl_mem->tex_id);
if (gl_mem->mem.id && CONTEXT_SUPPORTS_PBO_UPLOAD (gl_mem->mem.context)) {
gl_mem->mem.target = GL_PIXEL_UNPACK_BUFFER;
/* data -> pbo */
alloc_class->map_buffer ((GstGLBaseBuffer *) gl_mem, info, maxsize);
}
/* pbo -> texture */
_upload_memory (gl_mem, info, maxsize);
}
@ -1385,6 +1388,7 @@ gst_gl_memory_upload_transfer (GstGLMemory * gl_mem)
{
g_return_if_fail (gst_is_gl_memory ((GstMemory *) gl_mem));
if (CONTEXT_SUPPORTS_PBO_UPLOAD (gl_mem->mem.context))
gst_gl_context_thread_add (gl_mem->mem.context,
(GstGLContextThreadFunc) _upload_transfer, gl_mem);
}