public interface CameraAbility
Obtain a CameraAbility object by calling CameraKit.getCameraAbility(String).
The CameraAbility object is used to describe static abilities of a logical or physical camera.
SystemCapability.Multimedia#CAMERA| 限定符和类型 | 接口 | 说明 |
|---|---|---|
static interface |
CameraAbility.CameraRunningMode |
Describes camera running mode types.
|
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
long |
getMinCaptureDuration(int format,
Size size) |
Obtains the minimum capture interval for streams with a specified image format and resolution.
|
<T> long |
getMinCaptureDuration(Class<T> clazz,
Size size) |
Obtains the minimum capture interval for streams with a given resolution
based on a specified
Class object. |
<T> List<T> |
getParameterRange(ParameterKey.Key<T> parameter) |
Gets the value range of a specified parameter.
|
<T> T |
getPropertyValue(PropertyKey.Key<T> property) |
Gets the value of a specified property.
|
int[] |
getSupportedAeMode() |
Gets auto exposure (AE) modes supported by the camera.
|
int[] |
getSupportedAfMode() |
Gets autofocus (AF) modes supported by the camera.
|
int[] |
getSupportedAwbMode() |
Gets the auto white balance (AWB) modes supported by this camera.
|
int[] |
getSupportedFaceDetection() |
Gets the supported face detection types.
|
int[] |
getSupportedFlashMode() |
Gets the supported flash modes.
|
List<Integer> |
getSupportedFormats() |
Obtains the list of supported output image formats.
|
List<Scope<Integer>> |
getSupportedHighFrameRate(int format,
Size size) |
Obtains the range of high frame rates supported by a specified image format and resolution.
|
<T> List<Scope<Integer>> |
getSupportedHighFrameRate(Class<T> clazz,
Size size) |
Obtains the range of high frame rates supported by a specified
Class object and resolution. |
List<Size> |
getSupportedHighSizes(int format) |
Obtains the list of high resolutions at frame rates of less than 30 fps.
|
List<ParameterKey.Key<?>> |
getSupportedParameters() |
Gets parameters supported by the camera.
|
List<PropertyKey.Key<?>> |
getSupportedProperties() |
Gets camera properties.
|
List<ResultKey.Key<?>> |
getSupportedResults() |
Gets the keys of returnable results related to the parameter settings supported by the camera.
|
int[] |
getSupportedRunningModes() |
Obtains the running modes supported by the camera.
|
List<Size> |
getSupportedSizes(int format) |
Gets supported output image sizes based on a specified format.
|
<T> List<Size> |
getSupportedSizes(Class<T> clazz) |
Gets supported output image sizes based on a specified class type.
|
float[] |
getSupportedZoom() |
Gets the zoom range supported by the camera.
|
boolean |
isFormatSupported(int format) |
Checks whether a specified format is supported for image output.
|
<T> boolean |
isSurfaceClassSupported(Class<T> clazz) |
Checks whether the surface class is supported.
|
List<Integer> getSupportedFormats()
List<Size> getSupportedSizes(int format)
format - Indicates an output image format, which is defined by ImageFormat.
Note that not all the defined formats are supported.
ImageFormat<T> List<Size> getSupportedSizes(Class<T> clazz)
T - Indicates a class type.clazz - Indicates a referenced Class object that is not null.
Only SurfaceOps and Recorder are supported.
NullPointerException - Throws this exception if clazz is null.int[] getSupportedAfMode()
Check supported AF modes before setting an AF mode by calling
FrameConfig.Builder#setAfMode(int, Rect).
Metadata.AfMode,
FrameConfig.Builder.setAfMode(int, Rect)int[] getSupportedAeMode()
Check supported AE modes before setting an AE mode by calling FrameConfig.Builder#setAeMode(int,
Rect)
FrameConfig.Builder.setAeMode(int, Rect)int[] getSupportedAwbMode()
You should call this method before setting an AWB mode via FrameConfig.Builder#setAwbMode(int, Rect).
FrameConfig.Builder.setAwbMode(int, Rect)float[] getSupportedZoom()
Check the supported zoom range before setting a zoom value by calling
FrameConfig.Builder#setZoom(float).
If the camera supports zoom, the return value is array [minZoom, maxZoom], indicating the supported zoom
range. The array length is fixed at 2. If the camera does not support zoom, [1.0f, 1.0f] is returned.
The zoom value can be any floating-point number in the range. The larger the zoom value is, the higher times an image is zoomed.
If the camera supports long-focus zoom and the zoom value exceeds a certain threshold, such as 3.0f or 5.0f, the camera automatically switch to the long-focus lens.
FrameConfig.Builder.setZoom(float)int[] getSupportedFlashMode()
Check supported flash modes before setting a flash mode by calling
FrameConfig.Builder#setFlashMode(int).
The returned values indicate supported flash modes, {FLASH_OPEN, FLASH_CLOSE, FLASH_ALWAYS_OPEN}.
FrameConfig.Builder.setFlashMode(int),
Metadata.FlashModeint[] getSupportedFaceDetection()
Check the supported face detection types before setting the function by calling
FrameConfig.Builder#setFaceDetection(int, boolean).
The return value indicates supported face detection types. The array length is the number of supported types,
for example, {FACE_DETECTION, FACE_SMILE_DETECTION}.
FrameConfig.Builder.setFaceDetection(int, boolean),
Metadata.FaceDetectionTypeList<ParameterKey.Key<?>> getSupportedParameters()
Check supported parameters are before setting them by calling
FrameConfig.Builder#setParameter(ParameterKey.Key, Object).
FrameConfig.Builder.setParameter(ParameterKey.Key, Object)<T> List<T> getParameterRange(ParameterKey.Key<T> parameter)
Check valid values of the parameters before setting them by calling
FrameConfig.Builder#setParameter(ParameterKey.Key, Object).
T - Indicates a value type of the parameters.parameter - Indicates the parameters supported by the camera.FrameConfig.Builder.setParameter(ParameterKey.Key, Object)List<ResultKey.Key<?>> getSupportedResults()
List<PropertyKey.Key<?>> getSupportedProperties()
The properties are used to describe camera's inherent information, instead of controlling the camera, for
example, PropertyKey#SENSOR_ORIENTATION.
<T> T getPropertyValue(PropertyKey.Key<T> property)
Check supported properties by calling CameraAbility#getSupportedProperties() before this method.
T - Indicates the data type of the property.property - Indicates properties supported by the camera.NullPointerException - Throws this exception if property is null.int[] getSupportedRunningModes()
You should obtain the supported running modes before setting any mode
via CameraConfig.Builder#setRunningMode(int).
CameraConfig.Builder.setRunningMode(int)List<Scope<Integer>> getSupportedHighFrameRate(int format, Size size)
High frame rates refer to the frame rates greater than 30 fps. The range of them can be discontinuous.
format - Indicates the output image format, which is defined by ImageFormat.size - Indicates the image resolution.Scope list if there is any high frame rate supported; returns an
empty list if format or size is not supported.<T> List<Scope<Integer>> getSupportedHighFrameRate(Class<T> clazz, Size size)
Class object and resolution.
High frame rates refer to the frame rates greater than 30 fps. The range of them can be discontinuous.
T - Indicates a class type.clazz - Indicates a referenced Class object that is not null.Scope list if there is any high frame rate supported;
returns an empty list if clazz or size is not supported.List<Size> getSupportedHighSizes(int format)
format - Indicates the output image format, which is defined by ImageFormat.long getMinCaptureDuration(int format,
Size size)
format - Indicates the output image format, which is defined by ImageFormat.size - Indicates the image resolution.<T> long getMinCaptureDuration(Class<T> clazz, Size size)
Class object.T - Indicates a class type.clazz - Indicates a referenced Class object that is not null.size - Indicates the image resolution.boolean isFormatSupported(int format)
Not all formats defined in ImageFormat are supported.
format - Indicates an output image format, which is defined in ImageFormat.true if the format is supported; returns false otherwise.ImageFormat<T> boolean isSurfaceClassSupported(Class<T> clazz)
T - Indicates a generic type of the surface class.clazz - Indicates the class of the surface.true if the surface class is supported; returns false otherwise.