Android:如何检查设备是否实现了Camera2 api功能? [英] Android: How can I check if a device has Camera2 api features implemented or not?

查看:698
本文介绍了Android:如何检查设备是否实现了Camera2 api功能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

那么,如何检查android设备是否实现了Camera2 api功能? camera2 api中有许多新功能,例如手动控件.因此,我如何知道是否以编程方式实现了Camera2的哪些API功能?

Well, how can I check if an android device has Camera2 api features implemented or not? There are many new features in camera2 api such as manual controls. So how can I know whether, which Camera2 api features are implemented or not, programmatically?

推荐答案

实际上,可以检查API版本21+.包括CameraManager在内的camera2 API是系统的一部分,而不依赖于存在的硬件.因此,您始终可以向CameraManager索取CameraDevice的列表,然后可以单独查询.

Actually, checking for API version 21+ will work. The camera2 API, including CameraManager is part of the system, not dependent on the hardware present. So you can always ask the CameraManager for a list of CameraDevices, which you can then query individually.

但是,我认为您真正的意思是如何确定我是否可以使用camera2 API手动设置摄影参数?", 取决于您所拥有的设备.这取决于所需的控件,但是可以通过获取REQUEST_AVAILABLE_CAPABILITIES 元数据字段.提示:寻找MANUAL_SENSOR.

However, I think what you actually mean is "how can I tell if I can set photographic parameters manually using the camera2 API?", which is dependent on the device you have. It depends on what control you need, but the information you need can be gleaned by getting the REQUEST_AVAILABLE_CAPABILITIES metadata field. Hint: look for MANUAL_SENSOR.

这篇关于Android:如何检查设备是否实现了Camera2 api功能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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