Using SurfaceTexture in combination with RenderScript

不想你离开。 提交于 2019-12-04 00:03:20

If I understand correctly, you already use SurfaceTexture. You can then register a callback with setOnFrameAvailableListener.

I see two solutions :

  1. Implements you own RSTextureView, which inherits from SurfaceTexture.OnFrameAvailableListener. Register your view as the SurfaceTexture callback. Every time your surface view is updated by the camera stream, your RSTextureView will be notified and you can handle it the way you want.

  2. Another solution would be to implement your own RenderScriptGL (still inheriting from SurfaceTexture.OnFrameAvailableListener) and call setSurfaceTexture when the callback is called.

You should be able to combine RenderScript with a SurfaceTexture with at least one of these two solutions.

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