1

SurfaceTexture is a very convenient way to direct Android's Camera output to a texture in GLSurfaceView. But I need the pixel data of the surface and the only way I found is via GLES20.glReadPixels which is slow.

Some information says a SurfaceTexture is backed by an external texture which realted to EGLImage.But it seems that Android NDK and SDK dosen't provide too much api about it.

lirui
  • 1,433
  • 1
  • 12
  • 19
  • Related: http://stackoverflow.com/a/32727163/295004 – Morrison Chang Nov 01 '16 at 03:58
  • On NDK side, I tried to AImageReader with NDK Camera API, which has interface to read out pixels ( still WIP, follow function PresentImage() ): https://github.com/googlesamples/android-ndk/blob/camera-sample/camera/read-image/read-image/src/main/cpp/image_reader.cpp. – Gerry Feb 17 '17 at 05:33

0 Answers0