Android的multuple相机preVIEW相机、Android、multuple、preVIEW

2023-09-07 15:08:55 作者:大爱三班

是否可以播放Android摄像头preVIEW到2个不同的SurfaceView控制在同一时间?我已经看到,显示效果为不同的previews实时一些应用程序,他们是如何做到这一点?我看了一下TextureView,这是要使用的视图?我在哪里可以找到多个同时相机previews例子?

Is it possible to broadcast the android camera preview into 2 different SurfaceView controls at the same time? I have seen some apps that show effects into different previews in real-time, how do they achieve that? I read about the TextureView, is this the view to use? where can I find examples of multiple simultaneous camera previews?

感谢

推荐答案

好了,因为他们在回答this的问题,我下载了 grafika 项目,从摄像头的质感的例子修改了。

Well, as they answered in this question, I downloaded the grafika project and revised the "texture from camera" example.

在 RenderThread 是 Sprite2d 属性附加伤害叫mRect。 我只是让所谓mRect2另一个实例,并与mRect具有相同的参数configuired它,除了旋转,我把它放到双:

In the RenderThread is a Sprite2d atribute called mRect. I just make another instance called mRect2, and configuired it with the same parameters that mRect has, except the rotation, I put it to the double:

mRect.setRotation(rotAngle); mRect2.setRotation(rotAngle * 2);

mRect.setRotation(rotAngle); mRect2.setRotation(rotAngle*2);

这是结果

还有很多code理解,但它的工作原理,并似乎是一个非常有前途的道路继续。

There is still a lot of code to understand, but it works and seems a very promising path to continue by.