I've been studying opengl es recently and trying to access the camera on android platform. All I need to do is to load camera data frame by frame through ndk and then load it into GL texture for further process. Is there any help or suggestion? It is highly appreciated if there is sample code! thank you!
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Send the camera output to a SurfaceTexture. Each frame will be available as an "external" GLES texture. This is significantly more efficient than receiving camera frames in a buffer and manually uploading them with glTexImage2D()
.
See Grafika (https://github.com/google/grafika) for multiple examples. The code there is written in the Java language, but GLES is essentially the same in Java or C/C++.