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