android.hardware.camera2.full 从何而来?
Where does android.hardware.camera2.full come from?
我正在尝试实现一个相机应用程序。和检查示例。一些示例包含以下明显特征:uses-feature android:name="android.hardware.camera2.full
。
我查看了官方文档和 google 示例,其中 none 提到了现有的此功能。 (或者我遗漏了一些)。
这个功能的来源是什么,有什么区别android.hardware.camera
?
编辑:
让我感到困惑的是 googlesamples
:
上的那些例子
还有这个
还有这个
他们正在使用新的 Camera2
API 和旧的清单 features
。我不知道两者如何组合在一起。
一如既往,最好查看 Android source code 本身:
* A given camera device may provide support at one of two levels: limited or
* full. If a device only supports the limited level, then Camera2 exposes a
* feature set that is roughly equivalent to the older
* {@link android.hardware.Camera Camera} API, although with a cleaner and more
* efficient interface. Devices that implement the full level of support
* provide substantially improved capabilities over the older camera
* API. Applications that target the limited level devices will run unchanged on
* the full-level devices; if your application requires a full-level device for
* proper operation, declare the "android.hardware.camera2.full" feature in your
* manifest.</p>
我希望这能阐明您提到的功能的性质。
至于 camera2
apis - introduced 在 Android 5(api 级别 21)中尝试创建更清洁的 apis 用于与相机交互,而不是旧的 camera
api.
Android 自 Android API 21 起引入了 Camera2 api,这个新的 Camera api 使其更易用且易于更改参数。以前的版本在功能上更受限制。
Android Camera2 有 4 个级别的实现,具体取决于制造商:
- Legacy:只是Camera2和Camera之间的转换。仅用于兼容性。只是 Camera2 的一些功能正常。
- 有限:有 Camera2 实现,但不是所有可用的方法。 (并非所有制造商都采用相同的方法,因此并非所有设备都适用于所有设备)
- Full:实现了Camera2的所有方法。通常制造商会在他们的旗舰设备上实现这一点。
- 级别 3:另外支持 YUV 重新处理和 RAW 图像捕获。 (最佳案例)
source here和个人经历。
功能标志和相机名称 API 实际上并不相关,即使它们看起来相同。
功能"android.hardware.camera" (PackageManager.FEATURE_CAMERA)表示该设备有一个后置摄像头。就这样;任何想要避免安装在没有后置摄像头的设备上的应用都需要列出该应用。
与Javaandroid.hardware.Camera
class无关。
通过 android.hardware.camera2
API 包使用时的功能 "android.hardware.camera.level.full" (PackageManager.FEATURE_CAMERA_LEVEL_FULL) says that at least one camera on the device supports the FULL hardware level。
因此带有后置摄像头的设备总是会列出 "android.hardware.camera"。如果它有一个好的相机,它会也会列出"android.hardware.camera.level.full"。
由于 camera2 的示例应用程序旨在 运行 在任何质量的相机上,它们只需要有一个相机设备,而不是它具有任何特定级别的功能。
我看到一些开发人员试图要求像 "android.hardware.camera2" 这样的功能; Android SDK 中没有定义此类功能,因此尝试要求它意味着您的应用程序无法安装在任何设备上。 camera2 API 从 Android 5.0 (Lollipop) 开始始终可用;这只是每个相机设备支持什么硬件级别的问题(LEGACY、LIMITED、FULL 或 LEVEL_3)。
如果我们在 Android studio 中直接导航至摘要 class,我们会更加清晰,它提供了以下信息
/**
*
CameraDevice class 表示连接到
* Android 设备,允许对图像捕获和
* post-以高帧率处理。
*
* 您的应用程序必须声明
* 其清单中的 {@link android.Manifest.permission#CAMERA Camera} 权限
* 为了访问相机设备。
*
* 给定的相机设备可以提供两个级别之一的支持:有限或
* 满的。如果设备仅支持有限级别,则 Camera2 公开一个
* 与旧版本大致相同的功能集
* {@link android.hardware.Camera Camera} API, 虽然有更干净的和更多
*高效的界面。实现全面支持的设备
* 提供比旧相机显着改进的功能
* API。以有限级别设备为目标的应用程序将 运行 不变
* 满级设备; 如果您的应用程序需要全级设备
* 正确操作,在你的中声明"android.hardware.camera.level.full"特性
*清单。
*
* @see CameraManager#openCamera
* @see android.Manifest.permission#CAMERA
*/
public 抽象 class CameraDevice 实现 AutoCloseable {
所以没有必要或者我不相信说 camera2 和其他人指出的一样。
我正在尝试实现一个相机应用程序。和检查示例。一些示例包含以下明显特征:uses-feature android:name="android.hardware.camera2.full
。
我查看了官方文档和 google 示例,其中 none 提到了现有的此功能。 (或者我遗漏了一些)。
这个功能的来源是什么,有什么区别android.hardware.camera
?
编辑:
让我感到困惑的是 googlesamples
:
还有这个
还有这个
他们正在使用新的 Camera2
API 和旧的清单 features
。我不知道两者如何组合在一起。
一如既往,最好查看 Android source code 本身:
* A given camera device may provide support at one of two levels: limited or
* full. If a device only supports the limited level, then Camera2 exposes a
* feature set that is roughly equivalent to the older
* {@link android.hardware.Camera Camera} API, although with a cleaner and more
* efficient interface. Devices that implement the full level of support
* provide substantially improved capabilities over the older camera
* API. Applications that target the limited level devices will run unchanged on
* the full-level devices; if your application requires a full-level device for
* proper operation, declare the "android.hardware.camera2.full" feature in your
* manifest.</p>
我希望这能阐明您提到的功能的性质。
至于 camera2
apis - introduced 在 Android 5(api 级别 21)中尝试创建更清洁的 apis 用于与相机交互,而不是旧的 camera
api.
Android 自 Android API 21 起引入了 Camera2 api,这个新的 Camera api 使其更易用且易于更改参数。以前的版本在功能上更受限制。
Android Camera2 有 4 个级别的实现,具体取决于制造商:
- Legacy:只是Camera2和Camera之间的转换。仅用于兼容性。只是 Camera2 的一些功能正常。
- 有限:有 Camera2 实现,但不是所有可用的方法。 (并非所有制造商都采用相同的方法,因此并非所有设备都适用于所有设备)
- Full:实现了Camera2的所有方法。通常制造商会在他们的旗舰设备上实现这一点。
- 级别 3:另外支持 YUV 重新处理和 RAW 图像捕获。 (最佳案例)
source here和个人经历。
功能标志和相机名称 API 实际上并不相关,即使它们看起来相同。
功能"android.hardware.camera" (PackageManager.FEATURE_CAMERA)表示该设备有一个后置摄像头。就这样;任何想要避免安装在没有后置摄像头的设备上的应用都需要列出该应用。
与Javaandroid.hardware.Camera
class无关。
通过 android.hardware.camera2
API 包使用时的功能 "android.hardware.camera.level.full" (PackageManager.FEATURE_CAMERA_LEVEL_FULL) says that at least one camera on the device supports the FULL hardware level。
因此带有后置摄像头的设备总是会列出 "android.hardware.camera"。如果它有一个好的相机,它会也会列出"android.hardware.camera.level.full"。
由于 camera2 的示例应用程序旨在 运行 在任何质量的相机上,它们只需要有一个相机设备,而不是它具有任何特定级别的功能。
我看到一些开发人员试图要求像 "android.hardware.camera2" 这样的功能; Android SDK 中没有定义此类功能,因此尝试要求它意味着您的应用程序无法安装在任何设备上。 camera2 API 从 Android 5.0 (Lollipop) 开始始终可用;这只是每个相机设备支持什么硬件级别的问题(LEGACY、LIMITED、FULL 或 LEVEL_3)。
如果我们在 Android studio 中直接导航至摘要 class,我们会更加清晰,它提供了以下信息
/** *
CameraDevice class 表示连接到 * Android 设备,允许对图像捕获和 * post-以高帧率处理。
* *您的应用程序必须声明 * 其清单中的 {@link android.Manifest.permission#CAMERA Camera} 权限 * 为了访问相机设备。
* *给定的相机设备可以提供两个级别之一的支持:有限或 * 满的。如果设备仅支持有限级别,则 Camera2 公开一个 * 与旧版本大致相同的功能集 * {@link android.hardware.Camera Camera} API, 虽然有更干净的和更多 *高效的界面。实现全面支持的设备 * 提供比旧相机显着改进的功能 * API。以有限级别设备为目标的应用程序将 运行 不变 * 满级设备; 如果您的应用程序需要全级设备 * 正确操作,在你的中声明"android.hardware.camera.level.full"特性 *清单。
* * @see CameraManager#openCamera * @see android.Manifest.permission#CAMERA */ public 抽象 class CameraDevice 实现 AutoCloseable {所以没有必要或者我不相信说 camera2 和其他人指出的一样。