Merge "Camera: hardware level related doc update" into pi-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
3d3c6531e1
@@ -3136,12 +3136,26 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri
|
|||||||
* the following code snippet can be used:</p>
|
* the following code snippet can be used:</p>
|
||||||
* <pre><code>// Returns true if the device supports the required hardware level, or better.
|
* <pre><code>// Returns true if the device supports the required hardware level, or better.
|
||||||
* boolean isHardwareLevelSupported(CameraCharacteristics c, int requiredLevel) {
|
* boolean isHardwareLevelSupported(CameraCharacteristics c, int requiredLevel) {
|
||||||
|
* final int[] sortedHwLevels = {
|
||||||
|
* CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY,
|
||||||
|
* CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_EXTERNAL,
|
||||||
|
* CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED,
|
||||||
|
* CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_FULL,
|
||||||
|
* CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_3
|
||||||
|
* };
|
||||||
* int deviceLevel = c.get(CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL);
|
* int deviceLevel = c.get(CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL);
|
||||||
* if (deviceLevel == CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY) {
|
* if (requiredLevel == deviceLevel) {
|
||||||
* return requiredLevel == deviceLevel;
|
* return true;
|
||||||
* }
|
* }
|
||||||
* // deviceLevel is not LEGACY, can use numerical sort
|
*
|
||||||
* return requiredLevel <= deviceLevel;
|
* for (int sortedlevel : sortedHwLevels) {
|
||||||
|
* if (sortedlevel == requiredLevel) {
|
||||||
|
* return true;
|
||||||
|
* } else if (sortedlevel == deviceLevel) {
|
||||||
|
* return false;
|
||||||
|
* }
|
||||||
|
* }
|
||||||
|
* return false; // Should never reach here
|
||||||
* }
|
* }
|
||||||
* </code></pre>
|
* </code></pre>
|
||||||
* <p>At a high level, the levels are:</p>
|
* <p>At a high level, the levels are:</p>
|
||||||
@@ -3155,6 +3169,8 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri
|
|||||||
* post-processing settings, and image capture at a high rate.</li>
|
* post-processing settings, and image capture at a high rate.</li>
|
||||||
* <li><code>LEVEL_3</code> devices additionally support YUV reprocessing and RAW image capture, along
|
* <li><code>LEVEL_3</code> devices additionally support YUV reprocessing and RAW image capture, along
|
||||||
* with additional output stream configurations.</li>
|
* with additional output stream configurations.</li>
|
||||||
|
* <li><code>EXTERNAL</code> devices are similar to <code>LIMITED</code> devices with exceptions like some sensor or
|
||||||
|
* lens information not reorted or less stable framerates.</li>
|
||||||
* </ul>
|
* </ul>
|
||||||
* <p>See the individual level enums for full descriptions of the supported capabilities. The
|
* <p>See the individual level enums for full descriptions of the supported capabilities. The
|
||||||
* {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} entry describes the device's capabilities at a
|
* {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} entry describes the device's capabilities at a
|
||||||
|
|||||||
@@ -44,19 +44,27 @@ import java.lang.annotation.RetentionPolicy;
|
|||||||
* {@link android.Manifest.permission#CAMERA Camera} permission in its manifest
|
* {@link android.Manifest.permission#CAMERA Camera} permission in its manifest
|
||||||
* in order to access camera devices.</p>
|
* in order to access camera devices.</p>
|
||||||
*
|
*
|
||||||
* <p>A given camera device may provide support at one of two levels: limited or
|
* <p>A given camera device may provide support at one of several levels defined
|
||||||
* full. If a device only supports the limited level, then Camera2 exposes a
|
* in {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL}.
|
||||||
* feature set that is roughly equivalent to the older
|
* If a device supports {@link CameraMetadata#INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY LEGACY} level,
|
||||||
|
* the camera device is running in backward compatibility mode and has minimum camera2 API support.
|
||||||
|
* If a device supports the {@link CameraMetadata#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED 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
|
* {@link android.hardware.Camera Camera} API, although with a cleaner and more
|
||||||
* efficient interface. Devices that implement the full level of support
|
* efficient interface.
|
||||||
|
* If a device supports the {@link CameraMetadata#INFO_SUPPORTED_HARDWARE_LEVEL_EXTERNAL EXTERNAL}
|
||||||
|
* level, then the device is a removable camera that provides similar but slightly less features
|
||||||
|
* as the {@link CameraMetadata#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED LIMITED} level.
|
||||||
|
* Devices that implement the {@link CameraMetadata#INFO_SUPPORTED_HARDWARE_LEVEL_FULL FULL} or
|
||||||
|
* {@link CameraMetadata#INFO_SUPPORTED_HARDWARE_LEVEL_3 LEVEL3} level of support
|
||||||
* provide substantially improved capabilities over the older camera
|
* provide substantially improved capabilities over the older camera
|
||||||
* API. Applications that target the limited level devices will run unchanged on
|
* API. If your application requires a full-level device for
|
||||||
* the full-level devices; if your application requires a full-level device for
|
|
||||||
* proper operation, declare the "android.hardware.camera.level.full" feature in your
|
* proper operation, declare the "android.hardware.camera.level.full" feature in your
|
||||||
* manifest.</p>
|
* manifest.</p>
|
||||||
*
|
*
|
||||||
* @see CameraManager#openCamera
|
* @see CameraManager#openCamera
|
||||||
* @see android.Manifest.permission#CAMERA
|
* @see android.Manifest.permission#CAMERA
|
||||||
|
* @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
|
||||||
*/
|
*/
|
||||||
public abstract class CameraDevice implements AutoCloseable {
|
public abstract class CameraDevice implements AutoCloseable {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user