使用视频流作为开放GL ES 2.0纹理

时间:2022-04-12 18:53:49

I'm trying to capture video and display it to the screen by setting an Open GL ES texture to an android surfaceTexture. I can't use a TextureView and implement SurfaceTextureListener as per this tutorial since I am using Google Cardboard.

我正在尝试通过将Open GL ES纹理设置为android surfaceTexture来捕获视频并将其显示在屏幕上。因为我使用的是Google Cardboard,所以我不能使用TextureView并按照本教程实现SurfaceTextureListener。

I have followed the Android documentation on how to initialise Open GL ES 2.0 and use it, and also this tutorial on texturing.

我已经按照Android文档介绍了如何初始化Open GL ES 2.0并使用它,以及本教程中的纹理。

Putting the 2 together I get a blank screen and occasionally get <core_glBindTexture:572>: GL_INVALID_OPERATION in the console window.

把2放在一起我得到一个空白的屏幕,偶尔在控制台窗口中得到 <572>