RecommendedStreamConfigurationMap
class RecommendedStreamConfigurationMap
kotlin.Any | |
↳ | android.hardware.camera2.params.RecommendedStreamConfigurationMap |
Immutable class to store the recommended stream configurations to set up Surfaces
for creating a capture session
with android.hardware.camera2.CameraDevice#createCaptureSession(SessionConfiguration)
.
The recommended list does not replace or deprecate the exhaustive complete list found in StreamConfigurationMap
. It is a suggestion about available power and performance efficient stream configurations for a specific use case. Per definition it is only a subset of StreamConfigurationMap
and can be considered by developers for optimization purposes.
This also duplicates the minimum frame durations and stall durations from the StreamConfigurationMap
for each format/size combination that can be used to calculate effective frame rate when submitting multiple captures.
An instance of this object is available by invoking CameraCharacteristics#getRecommendedStreamConfigurationMap
and passing a respective usecase id. For more information about supported use case constants see USECASE_PREVIEW
.
<code><code>CameraCharacteristics characteristics = cameraManager.getCameraCharacteristics(cameraId); RecommendedStreamConfigurationMap configs = characteristics.getRecommendedStreamConfigurationMap( RecommendedStreamConfigurationMap.USECASE_PREVIEW); </code></code>
Summary
Constants | |
---|---|
static Int |
If supported, the recommended 10-bit output stream configurations must include a subset of the advertised |
static Int |
The recommended stream configuration map for use case low latency snapshot must contain subset of configurations with end-to-end latency that does not exceed 200 ms. |
static Int |
The recommended stream configuration map for use case preview must contain a subset of efficient, non-stalling configurations that must include both |
static Int |
In case the device supports |
static Int |
The recommended stream configuration map for recording must contain a subset of efficient video configurations that include |
static Int |
The recommended stream configuration map for use case snapshot must contain a subset of efficient still capture configurations that must include |
static Int |
The recommended stream configuration map for use case video snapshot must only contain a subset of efficient liveshot configurations that include |
static Int |
In case the device supports |
Public methods | |
---|---|
MutableSet<Size!>? |
getHighResolutionOutputSizes(format: Int) Get a list of supported high resolution sizes, which cannot operate at full BURST_CAPTURE rate. |
MutableSet<Range<Int!>!>? |
Get a list of supported high speed video recording FPS ranges. |
MutableSet<Range<Int!>!>? |
Get the frame per second ranges (fpsMin, fpsMax) for input high speed video size. |
MutableSet<Size!>? |
Get a list of supported high speed video recording sizes. |
MutableSet<Size!>? |
getHighSpeedVideoSizesFor(fpsRange: Range<Int!>) Get the supported video sizes for an input high speed FPS range. |
MutableSet<Int!>? |
Get the image |
MutableSet<Size!>? |
getInputSizes(format: Int) Get the supported input sizes for this input format. |
MutableSet<Int!> |
Get the image |
Long |
getOutputMinFrameDuration(format: Int, size: Size) Get the minimum |
Long |
getOutputMinFrameDuration(klass: Class<T>, size: Size) Get the minimum |
MutableSet<Size!>? |
getOutputSizes(format: Int) Get a list of sizes compatible with the requested image |
MutableSet<Size!>? |
getOutputSizes(klass: Class<T>) Get a list of sizes compatible with |
Long |
getOutputStallDuration(format: Int, size: Size) Get the stall duration for the format/size combination (in nanoseconds). |
Long |
getOutputStallDuration(klass: Class<T>, size: Size) Get the stall duration for the class/size combination (in nanoseconds). |
Int |
Get the use case value for the recommended stream configurations. |
MutableSet<Int!>? |
getValidOutputFormatsForInput(inputFormat: Int) Get the image |
Boolean |
isOutputSupportedFor(format: Int) Determine whether or not output surfaces with a particular user-defined format can be passed |
Boolean |
isOutputSupportedFor(surface: Surface) Determine whether or not the |
Constants
USECASE_10BIT_OUTPUT
static val USECASE_10BIT_OUTPUT: Int
If supported, the recommended 10-bit output stream configurations must include a subset of the advertised android.graphics.ImageFormat#YCBCR_P010
and android.graphics.ImageFormat#PRIVATE
outputs that are optimized for power and performance when registered along with a supported 10-bit dynamic range profile. {@see android.hardware.camera2.params.OutputConfiguration#setDynamicRangeProfile} for details.
Value: 8
USECASE_LOW_LATENCY_SNAPSHOT
static val USECASE_LOW_LATENCY_SNAPSHOT: Int
The recommended stream configuration map for use case low latency snapshot must contain subset of configurations with end-to-end latency that does not exceed 200 ms. under standard operating conditions (reasonable light levels, not loaded system). The expected output format will be primarily android.graphics.ImageFormat#JPEG
however other image formats can be present as well. Even if available for the camera device, high speed and input configurations will be absent. This suggested configuration map may be absent on some devices that can not support any low latency requests.
Value: 6
USECASE_PREVIEW
static val USECASE_PREVIEW: Int
The recommended stream configuration map for use case preview must contain a subset of efficient, non-stalling configurations that must include both android.graphics.ImageFormat#PRIVATE
and android.graphics.ImageFormat#YUV_420_888
output formats. Even if available for the camera device, high speed or input configurations will be absent.
Value: 0
USECASE_RAW
static val USECASE_RAW: Int
In case the device supports android.hardware.camera2.CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_RAW
, the recommended stream configuration map for use case RAW must contain a subset of efficient configurations that include the android.graphics.ImageFormat#RAW_SENSOR
and other RAW output formats. Even if available for the camera device, high speed and input configurations will be absent.
Value: 5
USECASE_RECORD
static val USECASE_RECORD: Int
The recommended stream configuration map for recording must contain a subset of efficient video configurations that include android.graphics.ImageFormat#PRIVATE
output format for at least all supported profiles
. High speed configurations if supported will be available as well. Even if available for the camera device, input configurations will be absent.
Value: 1
USECASE_SNAPSHOT
static val USECASE_SNAPSHOT: Int
The recommended stream configuration map for use case snapshot must contain a subset of efficient still capture configurations that must include android.graphics.ImageFormat#JPEG
output format and at least one configuration with size approximately equal to the sensor pixel array size CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
. Even if available for the camera device, high speed or input configurations will be absent.
Value: 3
USECASE_VIDEO_SNAPSHOT
static val USECASE_VIDEO_SNAPSHOT: Int
The recommended stream configuration map for use case video snapshot must only contain a subset of efficient liveshot configurations that include android.graphics.ImageFormat#JPEG
output format. The sizes will match at least the maximum resolution of usecase record and will not cause any preview glitches. Even if available for the camera device, high speed or input configurations will be absent.
Value: 2
USECASE_ZSL
static val USECASE_ZSL: Int
In case the device supports CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_YUV_REPROCESSING
and/or CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_PRIVATE_REPROCESSING
, the recommended stream configuration map for use case ZSL must contain a subset of efficient configurations that include the suggested input and output format mappings. Even if available for the camera device, high speed configurations will be absent.
Value: 4
Public methods
getHighResolutionOutputSizes
fun getHighResolutionOutputSizes(format: Int): MutableSet<Size!>?
Get a list of supported high resolution sizes, which cannot operate at full BURST_CAPTURE rate.
For further information refer to StreamConfigurationMap#getHighResolutionOutputSizes
.
Return | |
---|---|
MutableSet<Size!>? |
a non-modifiable set of supported slower high-resolution sizes, or null if the BURST_CAPTURE capability is not supported |
getHighSpeedVideoFpsRanges
fun getHighSpeedVideoFpsRanges(): MutableSet<Range<Int!>!>?
Get a list of supported high speed video recording FPS ranges.
For further information refer to StreamConfigurationMap#getHighSpeedVideoFpsRanges
.
Return | |
---|---|
MutableSet<Range<Int!>!>? |
a non-modifiable set of supported high speed video recording FPS ranges The upper bound of returned ranges is guaranteed to be larger or equal to 120. This value may be null . |
getHighSpeedVideoFpsRangesFor
fun getHighSpeedVideoFpsRangesFor(size: Size): MutableSet<Range<Int!>!>?
Get the frame per second ranges (fpsMin, fpsMax) for input high speed video size.
For further information refer to StreamConfigurationMap#getHighSpeedVideoFpsRangesFor
.
Parameters | |
---|---|
size |
Size: one of the sizes returned by getHighSpeedVideoSizes() This value cannot be null . |
Return | |
---|---|
MutableSet<Range<Int!>!>? |
a non-modifiable set of supported high speed video recording FPS ranges The upper bound of returned ranges is guaranteed to be greater than or equal to 120. This value may be null . |
Exceptions | |
---|---|
java.lang.IllegalArgumentException |
if input size does not exist in the return value of getHighSpeedVideoSizes |
getHighSpeedVideoSizes
fun getHighSpeedVideoSizes(): MutableSet<Size!>?
Get a list of supported high speed video recording sizes.
For more information refer to StreamConfigurationMap#getHighSpeedVideoSizes
.
Return | |
---|---|
MutableSet<Size!>? |
a non-modifiable set of supported high speed video recording sizes This value may be null . |
getHighSpeedVideoSizesFor
fun getHighSpeedVideoSizesFor(fpsRange: Range<Int!>): MutableSet<Size!>?
Get the supported video sizes for an input high speed FPS range.
For further information refer to StreamConfigurationMap#getHighSpeedVideoSizesFor
.
Parameters | |
---|---|
fpsRange |
Range<Int!>: one of the FPS ranges returned by getHighSpeedVideoFpsRanges() This value cannot be null . |
Return | |
---|---|
MutableSet<Size!>? |
A non-modifiable set of video sizes to create high speed capture sessions for high speed streaming use cases. This value may be null . |
Exceptions | |
---|---|
java.lang.IllegalArgumentException |
if input FPS range does not exist in the return value of getHighSpeedVideoFpsRanges |
getInputFormats
fun getInputFormats(): MutableSet<Int!>?
Get the image format
input formats in this stream configuration.
All image formats returned by this function will be defined in either ImageFormat
or in PixelFormat
(and there is no possibility of collision).
Return | |
---|---|
MutableSet<Int!>? |
a non-modifiable set of Integer formats This value may be null . |
getInputSizes
fun getInputSizes(format: Int): MutableSet<Size!>?
Get the supported input sizes for this input format.
The format must have come from getInputFormats
; otherwise null
is returned.
Return | |
---|---|
MutableSet<Size!>? |
a non-modifiable set of sizes, or null if the format was not available. |
getOutputFormats
fun getOutputFormats(): MutableSet<Int!>
Get the image format
output formats in this stream configuration.
For more information refer to StreamConfigurationMap#getOutputFormats
.
Return | |
---|---|
MutableSet<Int!> |
a non-modifiable set of Integer formats This value cannot be null . |
getOutputMinFrameDuration
fun getOutputMinFrameDuration(
format: Int,
size: Size
): Long
Get the minimum frame duration
for the format/size combination (in nanoseconds).
For further information refer to android.hardware.camera2.params.StreamConfigurationMap#getOutputMinFrameDuration.
Return | |
---|---|
Long |
a minimum frame duration > 0 in nanoseconds, or 0 if the minimum frame duration is not available. Value is 0 or greater |
Exceptions | |
---|---|
java.lang.IllegalArgumentException |
if format or size was not supported |
getOutputMinFrameDuration
fun <T : Any!> getOutputMinFrameDuration(
klass: Class<T>,
size: Size
): Long
Get the minimum frame duration
for the class/size combination (in nanoseconds).
For more information refer to StreamConfigurationMap#getOutputMinFrameDuration(Class, Size)
.
Parameters | |
---|---|
klass |
Class<T>: a class which has a non-empty array returned by getOutputSizes(java.lang.Class) This value cannot be null . |
size |
Size: an output-compatible size This value cannot be null . |
Return | |
---|---|
Long |
a minimum frame duration > 0 in nanoseconds, or 0 if the minimum frame duration is not available. Value is 0 or greater |
Exceptions | |
---|---|
java.lang.IllegalArgumentException |
if klass or size was not supported |
getOutputSizes
fun getOutputSizes(format: Int): MutableSet<Size!>?
Get a list of sizes compatible with the requested image format
.
For more information refer to android.hardware.camera2.params.StreamConfigurationMap#getOutputSizes.
Return | |
---|---|
MutableSet<Size!>? |
a non-modifiable set of supported sizes, or null if the format is not a supported output |
getOutputSizes
fun <T : Any!> getOutputSizes(klass: Class<T>): MutableSet<Size!>?
Get a list of sizes compatible with klass
to use as an output.
For further information refer to StreamConfigurationMap#getOutputSizes(Class)
.
Parameters | |
---|---|
klass |
Class<T>: a Class object reference This value cannot be null . |
Return | |
---|---|
MutableSet<Size!>? |
a non-modifiable set of supported sizes for ImageFormat#PRIVATE format, or null if the klass is not a supported output. |
getOutputStallDuration
fun getOutputStallDuration(
format: Int,
size: Size
): Long
Get the stall duration for the format/size combination (in nanoseconds).
For further information refer to android.hardware.camera2.params.StreamConfigurationMap#getOutputStallDuration.
Return | |
---|---|
Long |
a stall duration >= 0 in nanoseconds Value is 0 or greater |
Exceptions | |
---|---|
java.lang.IllegalArgumentException |
if format or size was not supported |
getOutputStallDuration
fun <T : Any!> getOutputStallDuration(
klass: Class<T>,
size: Size
): Long
Get the stall duration for the class/size combination (in nanoseconds).
For more information refer to StreamConfigurationMap#getOutputStallDuration(Class, Size)
.
Parameters | |
---|---|
klass |
Class<T>: a class which has a non-empty array returned by getOutputSizes(java.lang.Class) . This value cannot be null . |
size |
Size: an output-compatible size This value cannot be null . |
Return | |
---|---|
Long |
a minimum frame duration > 0 in nanoseconds, or 0 if the stall duration is not available. Value is 0 or greater |
Exceptions | |
---|---|
java.lang.IllegalArgumentException |
if klass or size was not supported |
getRecommendedUseCase
fun getRecommendedUseCase(): Int
Get the use case value for the recommended stream configurations.
getValidOutputFormatsForInput
fun getValidOutputFormatsForInput(inputFormat: Int): MutableSet<Int!>?
Get the image format
output formats for a reprocessing input format.
For more information refer to StreamConfigurationMap#getValidOutputFormatsForInput
.
Return | |
---|---|
MutableSet<Int!>? |
a non-modifiable set of Integer formats This value may be null . |
isOutputSupportedFor
fun isOutputSupportedFor(format: Int): Boolean
Determine whether or not output surfaces with a particular user-defined format can be passed createCaptureSession
.
For further information refer to android.hardware.camera2.params.StreamConfigurationMap#isOutputSupportedFor.
Return | |
---|---|
Boolean |
true if using a surface with this format will be supported with CameraDevice#createCaptureSession(SessionConfiguration) |
Exceptions | |
---|---|
java.lang.IllegalArgumentException |
if the image format was not a defined named constant from either ImageFormat or PixelFormat |
isOutputSupportedFor
fun isOutputSupportedFor(surface: Surface): Boolean
Determine whether or not the surface
in its current state is suitable to be included in a session
as an output.
For more information refer to android.hardware.camera2.params.StreamConfigurationMap#isOutputSupportedFor.
Parameters | |
---|---|
surface |
Surface: a Surface object reference This value cannot be null . |
Return | |
---|---|
Boolean |
true if this is supported, false otherwise |
Exceptions | |
---|---|
java.lang.IllegalArgumentException |
if the Surface endpoint is no longer valid |