From e620cf32cfa2ab8f500e51a0641cb721d6f111b0 Mon Sep 17 00:00:00 2001 From: Matthew Waters Date: Wed, 17 Jan 2018 15:24:20 +1100 Subject: [PATCH] glmemory: fixup GL_RGB565 usage when performing texsubimage An additional change for the texsubimage use case on top of https://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=c2b2c68beaddbea0ec4fe7b099507cc492f6dd7c https://cgit.freedesktop.org/gstreamer/gst-plugins-base/commit/?id=ea6bed111bab9b394d787f7760c6a3b953630d3a https://bugzilla.gnome.org/show_bug.cgi?id=783066 https://bugzilla.gnome.org/show_bug.cgi?id=792584 --- gst-libs/gst/gl/gstglmemory.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gst-libs/gst/gl/gstglmemory.c b/gst-libs/gst/gl/gstglmemory.c index a4a137233b..f811c7347c 100644 --- a/gst-libs/gst/gl/gstglmemory.c +++ b/gst-libs/gst/gl/gstglmemory.c @@ -525,10 +525,12 @@ gst_gl_memory_texsubimage (GstGLMemory * gl_mem, gpointer read_pointer) gl = context->gl_vtable; gl_type = GL_UNSIGNED_BYTE; - if (gl_mem->tex_format == GST_GL_RGB565) - gl_type = GL_UNSIGNED_SHORT_5_6_5; - gl_format = gl_mem->tex_format; + if (gl_mem->tex_format == GST_GL_RGB565) { + gl_format = GST_GL_RGB; + gl_type = GL_UNSIGNED_SHORT_5_6_5; + } + gl_target = gst_gl_texture_target_to_gl (gl_mem->tex_target); if (USING_OPENGL (context) || USING_GLES3 (context)