summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Isorce <j.isorce@samsung.com>2015-06-22 14:06:04 +0100
committerJulien Isorce <j.isorce@samsung.com>2015-06-22 15:12:11 +0100
commit2d62f1c47927a39a02e244e4c981434f08350904 (patch)
treeb78d27c2fe9bf2f1b923484b828409cec692d661
parent05198e2df1fa79b768bf009f3a053a7b04cc01cc (diff)
glmemory: fix consistency about pbo availability.
https://bugzilla.gnome.org/show_bug.cgi?id=751165
-rw-r--r--gst-libs/gst/gl/gstglmemory.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/gst-libs/gst/gl/gstglmemory.c b/gst-libs/gst/gl/gstglmemory.c
index 94da63c90..d2f768703 100644
--- a/gst-libs/gst/gl/gstglmemory.c
+++ b/gst-libs/gst/gl/gstglmemory.c
@@ -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);
- gl_mem->mem.target = GL_PIXEL_UNPACK_BUFFER;
- /* data -> pbo */
- alloc_class->map_buffer ((GstGLBaseBuffer *) gl_mem, info, maxsize);
+
+ 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,8 +1388,9 @@ gst_gl_memory_upload_transfer (GstGLMemory * gl_mem)
{
g_return_if_fail (gst_is_gl_memory ((GstMemory *) gl_mem));
- gst_gl_context_thread_add (gl_mem->mem.context,
- (GstGLContextThreadFunc) _upload_transfer, 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);
}
gint