是否有可能使用正面和背面摄像头的同时在Android中 [英] Is it possible to use front and back Camera at same time in Android

查看:130
本文介绍了是否有可能使用正面和背面摄像头的同时在Android中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想无论是在同一时间使用设备的正面和背面的摄像头。在我的应用程序,在屏幕上半年将显示相机背面和屏幕的下半程的preVIEW将显示前置摄像头preVIEW。

I want to use front and back Camera of device both at same time. In my app, first half of the screen will display preview of back camera and next half of the screen will display front camera preview.

我曾试图与设置两个不同的摄像头previews但是当我打开我的应用程序,在屏幕前半(其中显示相机背面preVIEW)不显示preVIEW。而且屏幕(其中显示的前置摄像头)的第二部分显示背对着摄像头(怪)。

I have tried this with setting two different camera previews but when I open my app, first half of the screen(which displays back camera preview) does not display the preview. And second half of the screen(which displays front facing Camera) displays back facing Camera(strange).

据<一href="http://developer.android.com/reference/android/hardware/Camera.html#open%28int%29">Camera.open(int)文档:

您的应用程序只能有一次一个Camera对象主动   作为一个特定的硬件相机

Your application should only have one Camera object active at a time for a particular hardware camera.

此意味着如果两个摄像机硬件(正面和背面)是不同的,并且可以被打开,在同一时间。

This means if both camera hardware (front and back) are different and can be opened at same time.

在我的应用程序,我使用的是同一个以上的API。当我打开和呼叫 Camera.start preVIEW()这不会给任何异常或错误; 两个摄像头,在同一时间。但它仍然是行不通的。我只能看到一个摄像头preVIEW的时间。

In my application, I am using the same above api. This does not give any exception or error when I open and call Camera.startPreview(); for both cameras at same time. But still it is not working. I can see only one camera preview at a time.

这有什么,我很想念在这里同时使用这两款相机?

Is there anything which I am missing here to use both cameras at same time?

推荐答案

我得到了同步双摄像头接入工作的HTC ONE M8

I got simultaneous dual camera access working on the HTC ONE M8

视频: http://youtu.be/lt8N1Lpa9Zw
随意使用我的code从这里: http://goo.gl/9aBgQI

Video: http://youtu.be/lt8N1Lpa9Zw
Feel free to use my code from here: http://goo.gl/9aBgQI

最好的, 延斯

这篇关于是否有可能使用正面和背面摄像头的同时在Android中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆