我有一些OpenGL ES代码已经渲染到了GLSurfaceView,我正在修改它以使用SurfaceView和TextureView.
我在本机代码中需要的共同元素是:ANativeWindow.
因为SurfaceView我通过传递Surface到:
m_jwindow = ANativeWindow_fromSurface(env, surface);
Run Code Online (Sandbox Code Playgroud)
对于TextureView,我接受SurfaceTexture,在API 14中,我可以使用:
m_jwindow = ANativeWindow_fromSurfaceTexture(env, surface);
Run Code Online (Sandbox Code Playgroud)
但是,在Jellybean中删除了该功能.我想留下,我怎样才能ANativeWindow从SurfaceTexture在API 16+?