Imagination PowerVR SDK Blog

invalidEGLImage using samplerExternalOES on Android



I have an issue using samplerExternalOES on an Android all-in-one S900 VR device with G6230 GPU.
I need to display a video texture in openGL scene. To do this I specify a SurfaceTexture as the output of the Media Player (VLC in my case) and get the textureID which I want to bind in openGL.

Classic fragment shader code:
[scode lang="{language}"]#extension GL_OES_EGL_image_external : require
precision mediump float;
varying vec2 textureCoordinate;
uniform samplerExternalOES s_texture;
void main() {
vec2 texcoordC = mod(textureCoordinate.xy,1.0);
gl_FragColor = texture2D( s_texture, texcoordC );

I get the following error in the log:
[scode lang="{language}"]E/IMGSRV: :0: IsTextureConsistent: _EGLImage is not consistent[/scode]

On phones (Samsung S5 for example) this error doesn’t appear and all works fine.
if I replace by sampler2D the error disapears but the image is like random with a lot of white dots.

Is there an approach to make it work?


My bad: the problem was not here but in SurfaceView used as subtitles surface not being created.


Hi ,
Sorry for the delayed reply. i hope you every thing goes will and back to here if you have any problem.
Thank you.

Mark Z