projects
/
platform
/
upstream
/
gstreamer.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
88864ea
)
gl: allow to avoid calling glTexImage2D(w, h, NULL) when generating a texture
author
Julien Isorce
<julien.isorce@collabora.co.uk>
Tue, 6 May 2014 10:51:31 +0000
(11:51 +0100)
committer
Tim-Philipp Müller
<tim@centricular.com>
Sat, 9 Dec 2017 19:31:39 +0000
(19:31 +0000)
Just pass 0 as width or height to gst_gl_context_gen_texture.
gst-libs/gst/gl/gstglutils.c
patch
|
blob
|
history
diff --git
a/gst-libs/gst/gl/gstglutils.c
b/gst-libs/gst/gl/gstglutils.c
index
4976992
..
d5df84b
100644
(file)
--- a/
gst-libs/gst/gl/gstglutils.c
+++ b/
gst-libs/gst/gl/gstglutils.c
@@
-111,8
+111,10
@@
_gen_texture (GstGLContext * context, GenTexture * data)
gl->GenTextures (1, &data->result);
gl->BindTexture (GL_TEXTURE_2D, data->result);
- gl->TexImage2D (GL_TEXTURE_2D, 0, GL_RGBA8, data->width,
- data->height, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
+
+ if (data->width > 0 && data->height > 0)
+ gl->TexImage2D (GL_TEXTURE_2D, 0, GL_RGBA8, data->width,
+ data->height, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
gl->TexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
gl->TexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);