how to load android camera frame into opengl es texture via ndk?

…衆ロ難τιáo~ 提交于 2019-12-06 12:12:00

问题


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++.



来源:https://stackoverflow.com/questions/32972457/how-to-load-android-camera-frame-into-opengl-es-texture-via-ndk

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!