Android Camera 2 API镜头切换 [英] Android Camera 2 API Lens switching
问题描述
我正在尝试实现与小米MI8上默认相机应用程序相同的镜头切换功能.附有屏幕截图.
I'm trying to achieve the same functionality for lens switching as default camera app has on Xiaomi MI8. Screenshot attached.
硬件设置:小米MI8 [API 29],带有带广角和远摄镜头的后置摄像头
Hardware setup: Xiaomi MI8 [API 29] with back-facing camera with wide angle and telephoto lenses
软件设置:只能通过API访问一台背面逻辑照相机,并且其physicalCameraIds列表为空.
Software setup: there is only one back-facing logical camera accessible through API and its physicalCameraIds list is empty.
从理论上讲,我们可以创建一堆OutputConfiguration对象,设置物理摄像机ID并创建捕获会话,但是由于小米MI8上缺少physicalCameraId,因此这是不可能的.
In theory we could create a bunch of OutputConfiguration objects, set a physical camera id and create capture session but it's not possible due to lack of physicalCameraIds on Xiaomi MI8.
是否有人对如何在小米MI8上实现镜头切换和检索physicalCameraIds有任何想法?还是有人试图在其他设备上检查physicalCameraId?
Does anyone has some ideas how to implement lens switching and retrieve physicalCameraIds on Xiaomi MI8? Or maybe someone tried to check physicalCameraIds on some other devices?
与镜头相关的所有领域的后置摄像头特性(如果对进一步研究有用):
Back-facing camera characteristics for the all lens related fields (if it's useful for further research):
physicalCameraIds: []
availablePhysicalCameraRequestKeys: null
LENS_DISTORTION: null
LENS_FACING: 1
LENS_INFO_AVAILABLE_APERTURES: [1.8]
LENS_INFO_AVAILABLE_FILTER_DENSITIES: [0.0]
LENS_INFO_AVAILABLE_FOCAL_LENGTHS: [4.216]
LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION: [0, 1]
LENS_INFO_FOCUS_DISTANCE_CALIBRATION: 1
LENS_INFO_HYPERFOCAL_DISTANCE: 0.2835498
LENS_INFO_MINIMUM_FOCUS_DISTANCE: 10.0
LENS_INTRINSIC_CALIBRATION: null
LENS_POSE_REFERENCE: null
LENS_POSE_ROTATION: null
LENS_POSE_TRANSLATION: null
推荐答案
您可以在调试ROM上通过其ID访问广角摄像机.相机ID和ROM可以由供应商的移动部门提供.
You can access the wide-angle camera by its id on debug ROMs. Camera id and ROM can be provided by vendor's mobile department.
这篇关于Android Camera 2 API镜头切换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!