Added in API level 29

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 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.

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 android.graphics.ImageFormat#PRIVATE and android.graphics.ImageFormat#YUV_420_888 output formats.

static 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.

static 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.

static 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.

static 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.

static 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.

Public methods
MutableSet<Size!>?

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!>?

Get the supported video sizes for an input high speed FPS range.

MutableSet<Int!>?

Get the image format input formats in this stream configuration.

MutableSet<Size!>?
getInputSizes(format: Int)

Get the supported input sizes for this input format.

MutableSet<Int!>

Get the image format output formats in this stream configuration.

Long

Get the minimum frame duration for the format/size combination (in nanoseconds).

Long

Get the minimum frame duration for the class/size combination (in nanoseconds).

MutableSet<Size!>?

Get a list of sizes compatible with the requested image format.

MutableSet<Size!>?
getOutputSizes(klass: Class<T>)

Get a list of sizes compatible with klass to use as an output.

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!>?

Get the image format output formats for a reprocessing input format.

Boolean

Determine whether or not output surfaces with a particular user-defined format can be passed createCaptureSession.

Boolean

Determine whether or not the surface in its current state is suitable to be included in a session as an output.

Constants

USECASE_10BIT_OUTPUT

Added in API level 33
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

Added in API level 29
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

Added in API level 29
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

Added in API level 29
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

Added in API level 29
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

Added in API level 29
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

Added in API level 29
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

Added in API level 29
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

Added in API level 29
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.

Parameters
format Int: Value is android.graphics.ImageFormat#UNKNOWN, android.graphics.PixelFormat#RGBA_8888, android.graphics.PixelFormat#RGBX_8888, android.graphics.PixelFormat#RGB_888, android.graphics.ImageFormat#RGB_565, android.graphics.ImageFormat#YV12, android.graphics.ImageFormat#Y8, android.graphics.ImageFormat.Y16, android.graphics.ImageFormat#YCBCR_P010, android.graphics.ImageFormat#NV16, android.graphics.ImageFormat#NV21, android.graphics.ImageFormat#YUY2, android.graphics.ImageFormat#JPEG, android.graphics.ImageFormat#DEPTH_JPEG, android.graphics.ImageFormat#YUV_420_888, android.graphics.ImageFormat#YUV_422_888, android.graphics.ImageFormat#YUV_444_888, android.graphics.ImageFormat#FLEX_RGB_888, android.graphics.ImageFormat#FLEX_RGBA_8888, android.graphics.ImageFormat#RAW_SENSOR, android.graphics.ImageFormat#RAW_PRIVATE, android.graphics.ImageFormat#RAW10, android.graphics.ImageFormat#RAW12, android.graphics.ImageFormat#DEPTH16, android.graphics.ImageFormat#DEPTH_POINT_CLOUD, android.graphics.ImageFormat.RAW_DEPTH, android.graphics.ImageFormat.RAW_DEPTH10, android.graphics.ImageFormat#PRIVATE, android.graphics.ImageFormat#HEIC, or android.graphics.ImageFormat#JPEG_R
Return
MutableSet<Size!>? a non-modifiable set of supported slower high-resolution sizes, or null if the BURST_CAPTURE capability is not supported

getHighSpeedVideoFpsRanges

Added in API level 29
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

Added in API level 29
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

Added in API level 29
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

Added in API level 29
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

Added in API level 29
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

Added in API level 29
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.

Parameters
format Int: a format from getInputFormats Value is android.graphics.ImageFormat#UNKNOWN, android.graphics.PixelFormat#RGBA_8888, android.graphics.PixelFormat#RGBX_8888, android.graphics.PixelFormat#RGB_888, android.graphics.ImageFormat#RGB_565, android.graphics.ImageFormat#YV12, android.graphics.ImageFormat#Y8, android.graphics.ImageFormat.Y16, android.graphics.ImageFormat#YCBCR_P010, android.graphics.ImageFormat#NV16, android.graphics.ImageFormat#NV21, android.graphics.ImageFormat#YUY2, android.graphics.ImageFormat#JPEG, android.graphics.ImageFormat#DEPTH_JPEG, android.graphics.ImageFormat#YUV_420_888, android.graphics.ImageFormat#YUV_422_888, android.graphics.ImageFormat#YUV_444_888, android.graphics.ImageFormat#FLEX_RGB_888, android.graphics.ImageFormat#FLEX_RGBA_8888, android.graphics.ImageFormat#RAW_SENSOR, android.graphics.ImageFormat#RAW_PRIVATE, android.graphics.ImageFormat#RAW10, android.graphics.ImageFormat#RAW12, android.graphics.ImageFormat#DEPTH16, android.graphics.ImageFormat#DEPTH_POINT_CLOUD, android.graphics.ImageFormat.RAW_DEPTH, android.graphics.ImageFormat.RAW_DEPTH10, android.graphics.ImageFormat#PRIVATE, android.graphics.ImageFormat#HEIC, or android.graphics.ImageFormat#JPEG_R
Return
MutableSet<Size!>? a non-modifiable set of sizes, or null if the format was not available.

getOutputFormats

Added in API level 29
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

Added in API level 29
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.

Parameters
format Int: an image format from ImageFormat or PixelFormat Value is android.graphics.ImageFormat#UNKNOWN, android.graphics.PixelFormat#RGBA_8888, android.graphics.PixelFormat#RGBX_8888, android.graphics.PixelFormat#RGB_888, android.graphics.ImageFormat#RGB_565, android.graphics.ImageFormat#YV12, android.graphics.ImageFormat#Y8, android.graphics.ImageFormat.Y16, android.graphics.ImageFormat#YCBCR_P010, android.graphics.ImageFormat#NV16, android.graphics.ImageFormat#NV21, android.graphics.ImageFormat#YUY2, android.graphics.ImageFormat#JPEG, android.graphics.ImageFormat#DEPTH_JPEG, android.graphics.ImageFormat#YUV_420_888, android.graphics.ImageFormat#YUV_422_888, android.graphics.ImageFormat#YUV_444_888, android.graphics.ImageFormat#FLEX_RGB_888, android.graphics.ImageFormat#FLEX_RGBA_8888, android.graphics.ImageFormat#RAW_SENSOR, android.graphics.ImageFormat#RAW_PRIVATE, android.graphics.ImageFormat#RAW10, android.graphics.ImageFormat#RAW12, android.graphics.ImageFormat#DEPTH16, android.graphics.ImageFormat#DEPTH_POINT_CLOUD, android.graphics.ImageFormat.RAW_DEPTH, android.graphics.ImageFormat.RAW_DEPTH10, android.graphics.ImageFormat#PRIVATE, android.graphics.ImageFormat#HEIC, or android.graphics.ImageFormat#JPEG_R
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 format or size was not supported

getOutputMinFrameDuration

Added in API level 29
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

Added in API level 29
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.

Parameters
format Int: an image format from ImageFormat or PixelFormat Value is android.graphics.ImageFormat#UNKNOWN, android.graphics.PixelFormat#RGBA_8888, android.graphics.PixelFormat#RGBX_8888, android.graphics.PixelFormat#RGB_888, android.graphics.ImageFormat#RGB_565, android.graphics.ImageFormat#YV12, android.graphics.ImageFormat#Y8, android.graphics.ImageFormat.Y16, android.graphics.ImageFormat#YCBCR_P010, android.graphics.ImageFormat#NV16, android.graphics.ImageFormat#NV21, android.graphics.ImageFormat#YUY2, android.graphics.ImageFormat#JPEG, android.graphics.ImageFormat#DEPTH_JPEG, android.graphics.ImageFormat#YUV_420_888, android.graphics.ImageFormat#YUV_422_888, android.graphics.ImageFormat#YUV_444_888, android.graphics.ImageFormat#FLEX_RGB_888, android.graphics.ImageFormat#FLEX_RGBA_8888, android.graphics.ImageFormat#RAW_SENSOR, android.graphics.ImageFormat#RAW_PRIVATE, android.graphics.ImageFormat#RAW10, android.graphics.ImageFormat#RAW12, android.graphics.ImageFormat#DEPTH16, android.graphics.ImageFormat#DEPTH_POINT_CLOUD, android.graphics.ImageFormat.RAW_DEPTH, android.graphics.ImageFormat.RAW_DEPTH10, android.graphics.ImageFormat#PRIVATE, android.graphics.ImageFormat#HEIC, or android.graphics.ImageFormat#JPEG_R
Return
MutableSet<Size!>? a non-modifiable set of supported sizes, or null if the format is not a supported output

getOutputSizes

Added in API level 29
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

Added in API level 29
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.

Parameters
format Int: an image format from ImageFormat or PixelFormat Value is android.graphics.ImageFormat#UNKNOWN, android.graphics.PixelFormat#RGBA_8888, android.graphics.PixelFormat#RGBX_8888, android.graphics.PixelFormat#RGB_888, android.graphics.ImageFormat#RGB_565, android.graphics.ImageFormat#YV12, android.graphics.ImageFormat#Y8, android.graphics.ImageFormat.Y16, android.graphics.ImageFormat#YCBCR_P010, android.graphics.ImageFormat#NV16, android.graphics.ImageFormat#NV21, android.graphics.ImageFormat#YUY2, android.graphics.ImageFormat#JPEG, android.graphics.ImageFormat#DEPTH_JPEG, android.graphics.ImageFormat#YUV_420_888, android.graphics.ImageFormat#YUV_422_888, android.graphics.ImageFormat#YUV_444_888, android.graphics.ImageFormat#FLEX_RGB_888, android.graphics.ImageFormat#FLEX_RGBA_8888, android.graphics.ImageFormat#RAW_SENSOR, android.graphics.ImageFormat#RAW_PRIVATE, android.graphics.ImageFormat#RAW10, android.graphics.ImageFormat#RAW12, android.graphics.ImageFormat#DEPTH16, android.graphics.ImageFormat#DEPTH_POINT_CLOUD, android.graphics.ImageFormat.RAW_DEPTH, android.graphics.ImageFormat.RAW_DEPTH10, android.graphics.ImageFormat#PRIVATE, android.graphics.ImageFormat#HEIC, or android.graphics.ImageFormat#JPEG_R
size Size: an output-compatible size This value cannot be null.
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

Added in API level 29
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

getValidOutputFormatsForInput

Added in API level 29
fun getValidOutputFormatsForInput(inputFormat: Int): MutableSet<Int!>?

Get the image format output formats for a reprocessing input format.

For more information refer to StreamConfigurationMap#getValidOutputFormatsForInput.

Parameters
inputFormat Int: Value is android.graphics.ImageFormat#UNKNOWN, android.graphics.PixelFormat#RGBA_8888, android.graphics.PixelFormat#RGBX_8888, android.graphics.PixelFormat#RGB_888, android.graphics.ImageFormat#RGB_565, android.graphics.ImageFormat#YV12, android.graphics.ImageFormat#Y8, android.graphics.ImageFormat.Y16, android.graphics.ImageFormat#YCBCR_P010, android.graphics.ImageFormat#NV16, android.graphics.ImageFormat#NV21, android.graphics.ImageFormat#YUY2, android.graphics.ImageFormat#JPEG, android.graphics.ImageFormat#DEPTH_JPEG, android.graphics.ImageFormat#YUV_420_888, android.graphics.ImageFormat#YUV_422_888, android.graphics.ImageFormat#YUV_444_888, android.graphics.ImageFormat#FLEX_RGB_888, android.graphics.ImageFormat#FLEX_RGBA_8888, android.graphics.ImageFormat#RAW_SENSOR, android.graphics.ImageFormat#RAW_PRIVATE, android.graphics.ImageFormat#RAW10, android.graphics.ImageFormat#RAW12, android.graphics.ImageFormat#DEPTH16, android.graphics.ImageFormat#DEPTH_POINT_CLOUD, android.graphics.ImageFormat.RAW_DEPTH, android.graphics.ImageFormat.RAW_DEPTH10, android.graphics.ImageFormat#PRIVATE, android.graphics.ImageFormat#HEIC, or android.graphics.ImageFormat#JPEG_R
Return
MutableSet<Int!>? a non-modifiable set of Integer formats This value may be null.

isOutputSupportedFor

Added in API level 29
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.

Parameters
format Int: an image format from either ImageFormat or PixelFormat Value is android.graphics.ImageFormat#UNKNOWN, android.graphics.PixelFormat#RGBA_8888, android.graphics.PixelFormat#RGBX_8888, android.graphics.PixelFormat#RGB_888, android.graphics.ImageFormat#RGB_565, android.graphics.ImageFormat#YV12, android.graphics.ImageFormat#Y8, android.graphics.ImageFormat.Y16, android.graphics.ImageFormat#YCBCR_P010, android.graphics.ImageFormat#NV16, android.graphics.ImageFormat#NV21, android.graphics.ImageFormat#YUY2, android.graphics.ImageFormat#JPEG, android.graphics.ImageFormat#DEPTH_JPEG, android.graphics.ImageFormat#YUV_420_888, android.graphics.ImageFormat#YUV_422_888, android.graphics.ImageFormat#YUV_444_888, android.graphics.ImageFormat#FLEX_RGB_888, android.graphics.ImageFormat#FLEX_RGBA_8888, android.graphics.ImageFormat#RAW_SENSOR, android.graphics.ImageFormat#RAW_PRIVATE, android.graphics.ImageFormat#RAW10, android.graphics.ImageFormat#RAW12, android.graphics.ImageFormat#DEPTH16, android.graphics.ImageFormat#DEPTH_POINT_CLOUD, android.graphics.ImageFormat.RAW_DEPTH, android.graphics.ImageFormat.RAW_DEPTH10, android.graphics.ImageFormat#PRIVATE, android.graphics.ImageFormat#HEIC, or android.graphics.ImageFormat#JPEG_R
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

Added in API level 29
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