本文介绍了Android的multuple相机preVIEW的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以播放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?

感谢

推荐答案

好了,因为他们在回答<一href="http://stackoverflow.com/questions/22529981/android-camera-$p$pview-on-two-views-multi-lenses-camera-$p$pview">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.

这篇关于Android的multuple相机preVIEW的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-18 01:00