我可以渲染 YUVI420
框架上 GLSurfaceView
使用 openGL,但我的要求是在 SurfaceTexture
上渲染帧.
基本上我想为 SurfaceTexture
制作框架不像渲染到 TextureView
等等,我有来自 WebRTC 的 YUV 数据流,我希望这个流位于 SurfaceTexture
以便稍后我可以在 EXTERNAL_TEXTURE_OES
中访问它在消费者层面。
我找不到任何关于在 SurfaceTexture 上生成帧的来源。是否可以将 YUV 帧生成到 SurfaceTexure?
最佳答案
可以将YUVI420帧转成byteArray,画在canvas上,放到TextureView上
val canvas: Canvas = textureView.lockCanvas()
canvas.drawBitmap(sourceBitmap, 200f, 100f, Paint())
textureView.unlockCanvasAndPost(canvas)
关于android - 如何以类似于相机为 SurfaceTexture 生成帧的方式生成 YUVI420 帧到 SurfaceTexture?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58723859/