android - 在 Android 中使用后置双摄像头

标签 android api camera2

我正在尝试使用我的 xiaomi mi 5s plus 上的两个后置摄像头进行拍摄。 当我尝试使用 camera2 api 遍历相机的 ID 时,我只得到 2 个 ID,一个用于前置摄像头,一个用于后置摄像头。 我查看了 lg 开发示例 ( http://mobile.developer.lge.com/develop/sdks/lg-dual-camera/ ),他们使用了 3 个 ID。运行他们的示例时,应用程序崩溃了。

用于获取 id 的代码是:

CameraManager manager = (CameraManager) getSystemService(Context.CAMERA_SERVICE);
for(String id: manager.getCameraIdList())
    Log.e("test", id);

最佳答案

在 Android P 之前,原生不支持从双摄像头捕获图像。Android P 现在支持多摄像头捕获 -> https://developer.android.com/preview/features#camera

Different vendors provide dual cameras for their Android devices in hope to improve the photo quality for average user, more often than not, specifically tuned for special conditions like challenging illumination or distortions of selfie mode. Each vendor uses proprietary technologies to handle dual cameras, and they are not interested to disclose the implementation details. The only public interface they support is a virtual single camera which is more or less compliant with Google specs.

Courtesy of this Stack Overflow answer

关于android - 在 Android 中使用后置双摄像头,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42932213/

相关文章:

android - 三星note 2和note 3屏幕桶

javascript - 谷歌分析 API Javascript : 403 Forbidden Error

Android Camera2 预览正在拉伸(stretch)

java - Android 按钮背景图像更改回 XML 中的状态

android - Cocos2dx Android : getFileData failed to get . 来自 Assets 的json文件

java - 如何在 If Else 语句 Android 中声明和初始化变量?

android - 从drawable/assets android 将图片发布到Facebook 墙上

java - 对于这种情况,是单例,工厂还是其他更好的东西?

android - camera2,android中的手动对焦

android - Camera2 PNG捕获