gpt4 book ai didi

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

转载 作者:塔克拉玛干 更新时间:2023-11-02 07:49:43 24 4
gpt4 key购买 nike

我正在尝试使用我的 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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com