Is there any way to get YUV buffer from Android Camera with GLSurfaceView
? (Not from onPreviewFrame)
You get a YUV buffer from the Android Camera by using the Android Camera API. There's no reason to get OpenGL ES involved if you just want a single frame. Use ImageReader to avoid data copies.
OpenGL ES works with RGB, not YUV, so anything rendered by GLES has been color-space converted. You can do the conversion back to YUV in a fragment shader if you like.
In any event, the SurfaceView classes are not intended as intermediates in a processing pipeline; they are display endpoints. You can't get anything from them. See the arch doc for details.