I want to fill the ImageReader by openGl.
and my shader can convert rgbaToyuv
.
So here is my code:
ImageReader.newInstance(vConfig.width, vConfig.height, ImageFormat.YUV_420_888, 2, /*1 << 17*/);
eglSurface= eglCreateWindowSurface(xxx, imageReader.getSurface, xxx);
glBindTexture(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, textureOfCameraFrame);
eglSwapBuffers(eglDisplay, mEGLSurface);
But i got below error:
The producer output buffer format 0x1(RGBA) doesn't match the ImageReader's configured buffer format 0x23(YUV_420_888)
it says that imgReaderFmt != bufferFormat
.
But what can i do to make it work with YUV_420_888
format.
If you want the GPU to render YUV you'll need to use the EXT_YUV_target extension functionality to set up a YUV render pass.
https://www.khronos.org/registry/OpenGL/extensions/EXT/EXT_YUV_target.txt