Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Constants](https://developer.android.com/reference/android/hardware/camera2/params/RecommendedStreamConfigurationMap#constants) \| [Methods](https://developer.android.com/reference/android/hardware/camera2/params/RecommendedStreamConfigurationMap#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/hardware/camera2/params/RecommendedStreamConfigurationMap#inhmethods)

# RecommendedStreamConfigurationMap

*** ** * ** ***

` public final class RecommendedStreamConfigurationMap `   
` extends https://developer.android.com/reference/java/lang/Object ` ` `

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.hardware.camera2.params.RecommendedStreamConfigurationMap |

<br />

*** ** * ** ***

Immutable class to store the recommended stream configurations to set up `https://developer.android.com/reference/android/view/Surface` for creating a `https://developer.android.com/reference/android/hardware/camera2/CameraCaptureSession` with `https://developer.android.com/reference/android/hardware/camera2/CameraDevice#createCaptureSession(android.hardware.camera2.params.SessionConfiguration)`.

The recommended list does not replace or deprecate the exhaustive complete list found in `https://developer.android.com/reference/android/hardware/camera2/params/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 `https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap` and can be considered by developers for optimization purposes.

This also duplicates the minimum frame durations and stall durations from the `https://developer.android.com/reference/android/hardware/camera2/params/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 `https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics#getRecommendedStreamConfigurationMap(int)` and passing a respective usecase id. For more information about supported use case constants see `https://developer.android.com/reference/android/hardware/camera2/params/RecommendedStreamConfigurationMap#USECASE_PREVIEW`.

    `CameraCharacteristics characteristics = cameraManager.getCameraCharacteristics(cameraId);
    RecommendedStreamConfigurationMap configs = characteristics.getRecommendedStreamConfigurationMap(
            RecommendedStreamConfigurationMap.USECASE_PREVIEW);
    `

<br />

**See also:**

- `https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics#getRecommendedStreamConfigurationMap(int)`
- `https://developer.android.com/reference/android/hardware/camera2/CameraDevice#createCaptureSession(android.hardware.camera2.params.SessionConfiguration)`

## Summary

| ### Constants ||
|---|---|
| `int` | `https://developer.android.com/reference/android/hardware/camera2/params/RecommendedStreamConfigurationMap#USECASE_10BIT_OUTPUT` If supported, the recommended 10-bit output stream configurations must include a subset of the advertised `https://developer.android.com/reference/android/graphics/ImageFormat#YCBCR_P010` and `https://developer.android.com/reference/android/graphics/ImageFormat#PRIVATE` outputs that are optimized for power and performance when registered along with a supported 10-bit dynamic range profile. |
| `int` | `https://developer.android.com/reference/android/hardware/camera2/params/RecommendedStreamConfigurationMap#USECASE_LOW_LATENCY_SNAPSHOT` 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. |
| `int` | `https://developer.android.com/reference/android/hardware/camera2/params/RecommendedStreamConfigurationMap#USECASE_PREVIEW` The recommended stream configuration map for use case preview must contain a subset of efficient, non-stalling configurations that must include both `https://developer.android.com/reference/android/graphics/ImageFormat#PRIVATE` and `https://developer.android.com/reference/android/graphics/ImageFormat#YUV_420_888` output formats. |
| `int` | `https://developer.android.com/reference/android/hardware/camera2/params/RecommendedStreamConfigurationMap#USECASE_RAW` In case the device supports `https://developer.android.com/reference/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 `https://developer.android.com/reference/android/graphics/ImageFormat#RAW_SENSOR` and other RAW output formats. |
| `int` | `https://developer.android.com/reference/android/hardware/camera2/params/RecommendedStreamConfigurationMap#USECASE_RECORD` The recommended stream configuration map for recording must contain a subset of efficient video configurations that include `https://developer.android.com/reference/android/graphics/ImageFormat#PRIVATE` output format for at least all supported `https://developer.android.com/reference/android/media/CamcorderProfile`. |
| `int` | `https://developer.android.com/reference/android/hardware/camera2/params/RecommendedStreamConfigurationMap#USECASE_SNAPSHOT` The recommended stream configuration map for use case snapshot must contain a subset of efficient still capture configurations that must include `https://developer.android.com/reference/android/graphics/ImageFormat#JPEG` output format and at least one configuration with size approximately equal to the sensor pixel array size `https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE`. |
| `int` | `https://developer.android.com/reference/android/hardware/camera2/params/RecommendedStreamConfigurationMap#USECASE_VIDEO_SNAPSHOT` The recommended stream configuration map for use case video snapshot must only contain a subset of efficient liveshot configurations that include `https://developer.android.com/reference/android/graphics/ImageFormat#JPEG` output format. |
| `int` | `https://developer.android.com/reference/android/hardware/camera2/params/RecommendedStreamConfigurationMap#USECASE_ZSL` In case the device supports `https://developer.android.com/reference/android/hardware/camera2/CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_YUV_REPROCESSING` and/or `https://developer.android.com/reference/android/hardware/camera2/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 ||
|---|---|
| ` https://developer.android.com/reference/java/util/Set<https://developer.android.com/reference/android/util/Size>` | ` https://developer.android.com/reference/android/hardware/camera2/params/RecommendedStreamConfigurationMap#getHighResolutionOutputSizes(int)(int format) ` Get a list of supported high resolution sizes, which cannot operate at full BURST_CAPTURE rate. |
| ` https://developer.android.com/reference/java/util/Set<https://developer.android.com/reference/android/util/Range<https://developer.android.com/reference/java/lang/Integer>>` | ` https://developer.android.com/reference/android/hardware/camera2/params/RecommendedStreamConfigurationMap#getHighSpeedVideoFpsRanges()() ` Get a list of supported high speed video recording FPS ranges. |
| ` https://developer.android.com/reference/java/util/Set<https://developer.android.com/reference/android/util/Range<https://developer.android.com/reference/java/lang/Integer>>` | ` https://developer.android.com/reference/android/hardware/camera2/params/RecommendedStreamConfigurationMap#getHighSpeedVideoFpsRangesFor(android.util.Size)(https://developer.android.com/reference/android/util/Size size) ` Get the frame per second ranges (fpsMin, fpsMax) for input high speed video size. |
| ` https://developer.android.com/reference/java/util/Set<https://developer.android.com/reference/android/util/Size>` | ` https://developer.android.com/reference/android/hardware/camera2/params/RecommendedStreamConfigurationMap#getHighSpeedVideoSizes()() ` Get a list of supported high speed video recording sizes. |
| ` https://developer.android.com/reference/java/util/Set<https://developer.android.com/reference/android/util/Size>` | ` https://developer.android.com/reference/android/hardware/camera2/params/RecommendedStreamConfigurationMap#getHighSpeedVideoSizesFor(android.util.Range<java.lang.Integer>)(https://developer.android.com/reference/android/util/Range<https://developer.android.com/reference/java/lang/Integer> fpsRange) ` Get the supported video sizes for an input high speed FPS range. |
| ` https://developer.android.com/reference/java/util/Set<https://developer.android.com/reference/java/lang/Integer>` | ` https://developer.android.com/reference/android/hardware/camera2/params/RecommendedStreamConfigurationMap#getInputFormats()() ` Get the image `format` input formats in this stream configuration. |
| ` https://developer.android.com/reference/java/util/Set<https://developer.android.com/reference/android/util/Size>` | ` https://developer.android.com/reference/android/hardware/camera2/params/RecommendedStreamConfigurationMap#getInputSizes(int)(int format) ` Get the supported input sizes for this input format. |
| ` https://developer.android.com/reference/java/util/Set<https://developer.android.com/reference/java/lang/Integer>` | ` https://developer.android.com/reference/android/hardware/camera2/params/RecommendedStreamConfigurationMap#getOutputFormats()() ` Get the image `format` output formats in this stream configuration. |
| ` <T> long` | ` https://developer.android.com/reference/android/hardware/camera2/params/RecommendedStreamConfigurationMap#getOutputMinFrameDuration(java.lang.Class<T>,%20android.util.Size)(https://developer.android.com/reference/java/lang/Class<T> klass, https://developer.android.com/reference/android/util/Size size) ` Get the minimum `https://developer.android.com/reference/android/hardware/camera2/CaptureRequest#SENSOR_FRAME_DURATION` for the class/size combination (in nanoseconds). |
| ` long` | ` https://developer.android.com/reference/android/hardware/camera2/params/RecommendedStreamConfigurationMap#getOutputMinFrameDuration(int,%20android.util.Size)(int format, https://developer.android.com/reference/android/util/Size size) ` Get the minimum `https://developer.android.com/reference/android/hardware/camera2/CaptureRequest#SENSOR_FRAME_DURATION` for the format/size combination (in nanoseconds). |
| ` https://developer.android.com/reference/java/util/Set<https://developer.android.com/reference/android/util/Size>` | ` https://developer.android.com/reference/android/hardware/camera2/params/RecommendedStreamConfigurationMap#getOutputSizes(int)(int format) ` Get a list of sizes compatible with the requested image `format`. |
| ` <T> https://developer.android.com/reference/java/util/Set<https://developer.android.com/reference/android/util/Size>` | ` https://developer.android.com/reference/android/hardware/camera2/params/RecommendedStreamConfigurationMap#getOutputSizes(java.lang.Class<T>)(https://developer.android.com/reference/java/lang/Class<T> klass) ` Get a list of sizes compatible with `klass` to use as an output. |
| ` long` | ` https://developer.android.com/reference/android/hardware/camera2/params/RecommendedStreamConfigurationMap#getOutputStallDuration(int,%20android.util.Size)(int format, https://developer.android.com/reference/android/util/Size size) ` Get the stall duration for the format/size combination (in nanoseconds). |
| ` <T> long` | ` https://developer.android.com/reference/android/hardware/camera2/params/RecommendedStreamConfigurationMap#getOutputStallDuration(java.lang.Class<T>,%20android.util.Size)(https://developer.android.com/reference/java/lang/Class<T> klass, https://developer.android.com/reference/android/util/Size size) ` Get the stall duration for the class/size combination (in nanoseconds). |
| ` int` | ` https://developer.android.com/reference/android/hardware/camera2/params/RecommendedStreamConfigurationMap#getRecommendedUseCase()() ` Get the use case value for the recommended stream configurations. |
| ` https://developer.android.com/reference/java/util/Set<https://developer.android.com/reference/java/lang/Integer>` | ` https://developer.android.com/reference/android/hardware/camera2/params/RecommendedStreamConfigurationMap#getValidOutputFormatsForInput(int)(int inputFormat) ` Get the image `format` output formats for a reprocessing input format. |
| ` boolean` | ` https://developer.android.com/reference/android/hardware/camera2/params/RecommendedStreamConfigurationMap#isOutputSupportedFor(android.view.Surface)(https://developer.android.com/reference/android/view/Surface surface) ` Determine whether or not the `surface` in its current state is suitable to be included in a `https://developer.android.com/reference/android/hardware/camera2/CameraDevice#createCaptureSession(android.hardware.camera2.params.SessionConfiguration)` as an output. |
| ` boolean` | ` https://developer.android.com/reference/android/hardware/camera2/params/RecommendedStreamConfigurationMap#isOutputSupportedFor(int)(int format) ` Determine whether or not output surfaces with a particular user-defined format can be passed `https://developer.android.com/reference/android/hardware/camera2/CameraDevice#createCaptureSession(android.hardware.camera2.params.SessionConfiguration)`. |

### Inherited methods

From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` https://developer.android.com/reference/java/lang/Object#finalize()() `

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
` final https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait()() `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.

## Constants

### USECASE_10BIT_OUTPUT

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int USECASE_10BIT_OUTPUT
```

If supported, the recommended 10-bit output stream configurations must include a subset of the advertised `https://developer.android.com/reference/android/graphics/ImageFormat#YCBCR_P010` and `https://developer.android.com/reference/android/graphics/ImageFormat#PRIVATE` outputs that are optimized for power and performance when registered along with a supported 10-bit dynamic range profile. See `https://developer.android.com/reference/android/hardware/camera2/params/OutputConfiguration#setDynamicRangeProfile(long)` for details.

<br />

Constant Value: 8 (0x00000008)

### USECASE_LOW_LATENCY_SNAPSHOT

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int USECASE_LOW_LATENCY_SNAPSHOT
```

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 `https://developer.android.com/reference/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.

<br />

Constant Value: 6 (0x00000006)

### USECASE_PREVIEW

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int USECASE_PREVIEW
```

The recommended stream configuration map for use case preview must contain a subset of efficient, non-stalling configurations that must include both `https://developer.android.com/reference/android/graphics/ImageFormat#PRIVATE` and `https://developer.android.com/reference/android/graphics/ImageFormat#YUV_420_888` output formats. Even if available for the camera device, high speed or input configurations will be absent.

<br />

Constant Value: 0 (0x00000000)

### USECASE_RAW

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int USECASE_RAW
```

In case the device supports `https://developer.android.com/reference/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 `https://developer.android.com/reference/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.

<br />

Constant Value: 5 (0x00000005)

### USECASE_RECORD

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int USECASE_RECORD
```

The recommended stream configuration map for recording must contain a subset of efficient video configurations that include `https://developer.android.com/reference/android/graphics/ImageFormat#PRIVATE` output format for at least all supported `https://developer.android.com/reference/android/media/CamcorderProfile`. High speed configurations if supported will be available as well. Even if available for the camera device, input configurations will be absent.

<br />

Constant Value: 1 (0x00000001)

### USECASE_SNAPSHOT

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int USECASE_SNAPSHOT
```

The recommended stream configuration map for use case snapshot must contain a subset of efficient still capture configurations that must include `https://developer.android.com/reference/android/graphics/ImageFormat#JPEG` output format and at least one configuration with size approximately equal to the sensor pixel array size `https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE`. Even if available for the camera device, high speed or input configurations will be absent.

<br />

Constant Value: 3 (0x00000003)

### USECASE_VIDEO_SNAPSHOT

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int USECASE_VIDEO_SNAPSHOT
```

The recommended stream configuration map for use case video snapshot must only contain a subset of efficient liveshot configurations that include `https://developer.android.com/reference/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.

<br />

Constant Value: 2 (0x00000002)

### USECASE_ZSL

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int USECASE_ZSL
```

In case the device supports `https://developer.android.com/reference/android/hardware/camera2/CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_YUV_REPROCESSING` and/or `https://developer.android.com/reference/android/hardware/camera2/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.

<br />

Constant Value: 4 (0x00000004)

## Public methods

### getHighResolutionOutputSizes

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Set<Size> getHighResolutionOutputSizes (int format)
```

Get a list of supported high resolution sizes, which cannot operate at full BURST_CAPTURE rate.

For further information refer to `https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#getHighResolutionOutputSizes(int)`.

<br />

<br />

| Parameters ||
|---|---|
| `format` | `int` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/Set<https://developer.android.com/reference/android/util/Size>` | a non-modifiable set of supported slower high-resolution sizes, or `null` if the BURST_CAPTURE capability is not supported <br /> |

### getHighSpeedVideoFpsRanges

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Set<Range<Integer>> getHighSpeedVideoFpsRanges ()
```

Get a list of supported high speed video recording FPS ranges.

For further information refer to `https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#getHighSpeedVideoFpsRanges()`.

<br />

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/Set<https://developer.android.com/reference/android/util/Range<https://developer.android.com/reference/java/lang/Integer>>` | 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`. <br /> |

### getHighSpeedVideoFpsRangesFor

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Set<Range<Integer>> getHighSpeedVideoFpsRangesFor (Size size)
```

Get the frame per second ranges (fpsMin, fpsMax) for input high speed video size.

For further information refer to `https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#getHighSpeedVideoFpsRangesFor(android.util.Size)`.

<br />

<br />

| Parameters ||
|---|---|
| `size` | `Size`: one of the sizes returned by `https://developer.android.com/reference/android/hardware/camera2/params/RecommendedStreamConfigurationMap#getHighSpeedVideoSizes()` This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/Set<https://developer.android.com/reference/android/util/Range<https://developer.android.com/reference/java/lang/Integer>>` | 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`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if input size does not exist in the return value of getHighSpeedVideoSizes |

### getHighSpeedVideoSizes

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Set<Size> getHighSpeedVideoSizes ()
```

Get a list of supported high speed video recording sizes.

For more information refer to `https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#getHighSpeedVideoSizes()`.

<br />

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/Set<https://developer.android.com/reference/android/util/Size>` | a non-modifiable set of supported high speed video recording sizes. This value may be `null`. <br /> |

### getHighSpeedVideoSizesFor

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Set<Size> getHighSpeedVideoSizesFor (Range<Integer> fpsRange)
```

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

For further information refer to `https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#getHighSpeedVideoSizesFor(android.util.Range<java.lang.Integer>)`.

<br />

<br />

| Parameters ||
|---|---|
| `fpsRange` | `Range`: one of the FPS ranges returned by `https://developer.android.com/reference/android/hardware/camera2/params/RecommendedStreamConfigurationMap#getHighSpeedVideoFpsRanges()` This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/Set<https://developer.android.com/reference/android/util/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`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if input FPS range does not exist in the return value of getHighSpeedVideoFpsRanges |

### getInputFormats

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Set<Integer> getInputFormats ()
```

Get the image `format` input formats in this stream configuration.

All image formats returned by this function will be defined in either `https://developer.android.com/reference/android/graphics/ImageFormat` or in `https://developer.android.com/reference/android/graphics/PixelFormat` (and there is no possibility of collision).

<br />

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/Set<https://developer.android.com/reference/java/lang/Integer>` | a non-modifiable set of Integer formats. This value may be `null`. <br /> |

### getInputSizes

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Set<Size> getInputSizes (int format)
```

Get the supported input sizes for this input format.

The format must have come from `https://developer.android.com/reference/android/hardware/camera2/params/RecommendedStreamConfigurationMap#getInputFormats()`; otherwise `null` is returned.

<br />

<br />

| Parameters ||
|---|---|
| `format` | `int`: a format from `https://developer.android.com/reference/android/hardware/camera2/params/RecommendedStreamConfigurationMap#getInputFormats()` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/Set<https://developer.android.com/reference/android/util/Size>` | a non-modifiable set of sizes, or `null` if the format was not available. <br /> |

### getOutputFormats

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Set<Integer> getOutputFormats ()
```

Get the image `format` output formats in this stream configuration.

For more information refer to `https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#getOutputFormats()`.

<br />

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/Set<https://developer.android.com/reference/java/lang/Integer>` | a non-modifiable set of Integer formats. This value cannot be `null`. <br /> |

### getOutputMinFrameDuration

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public long getOutputMinFrameDuration (Class<T> klass, 
                Size size)
```

Get the minimum `https://developer.android.com/reference/android/hardware/camera2/CaptureRequest#SENSOR_FRAME_DURATION` for the class/size combination (in nanoseconds).

For more information refer to `https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#getOutputMinFrameDuration(java.lang.Class<T>,%20android.util.Size)`.

<br />

<br />

| Parameters ||
|---|---|
| `klass` | `Class`: a class which has a non-empty array returned by `https://developer.android.com/reference/android/hardware/camera2/params/RecommendedStreamConfigurationMap#getOutputSizes(java.lang.Class<T>)` This value cannot be `null`. <br /> |
| `size` | `Size`: an output-compatible size. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `long` | a minimum frame duration `>` 0 in nanoseconds, or 0 if the minimum frame duration is not available. Value is 0 or greater <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if `klass` or `size` was not supported |

### getOutputMinFrameDuration

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public long getOutputMinFrameDuration (int format, 
                Size size)
```

Get the minimum `https://developer.android.com/reference/android/hardware/camera2/CaptureRequest#SENSOR_FRAME_DURATION` for the format/size combination (in nanoseconds).

For further information refer to `https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#getOutputMinFrameDuration(int,%20android.util.Size)`.

<br />

<br />

| Parameters ||
|---|---|
| `format` | `int`: an image format from `https://developer.android.com/reference/android/graphics/ImageFormat` or `https://developer.android.com/reference/android/graphics/PixelFormat` <br /> |
| `size` | `Size`: an output-compatible size. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `long` | a minimum frame duration `>` 0 in nanoseconds, or 0 if the minimum frame duration is not available. Value is 0 or greater <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if `format` or `size` was not supported |

### getOutputSizes

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Set<Size> getOutputSizes (int format)
```

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

For more information refer to `https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#getOutputSizes(int)`.

<br />

<br />

| Parameters ||
|---|---|
| `format` | `int`: an image format from `https://developer.android.com/reference/android/graphics/ImageFormat` or `https://developer.android.com/reference/android/graphics/PixelFormat` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/Set<https://developer.android.com/reference/android/util/Size>` | a non-modifiable set of supported sizes, or `null` if the `format` is not a supported output <br /> |

### getOutputSizes

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Set<Size> getOutputSizes (Class<T> klass)
```

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

For further information refer to `https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#getOutputSizes(java.lang.Class<T>)`.

<br />

<br />

| Parameters ||
|---|---|
| `klass` | `Class`: a `https://developer.android.com/reference/java/lang/Class` object reference. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/Set<https://developer.android.com/reference/android/util/Size>` | a non-modifiable set of supported sizes for `https://developer.android.com/reference/android/graphics/ImageFormat#PRIVATE` format, or `null` if the `klass` is not a supported output. <br /> |

### getOutputStallDuration

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public long getOutputStallDuration (int format, 
                Size size)
```

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

For further information refer to `https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#getOutputStallDuration(int,%20android.util.Size)`.

<br />

<br />

| Parameters ||
|---|---|
| `format` | `int`: an image format from `https://developer.android.com/reference/android/graphics/ImageFormat` or `https://developer.android.com/reference/android/graphics/PixelFormat` <br /> |
| `size` | `Size`: an output-compatible size. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `long` | a stall duration `>=` 0 in nanoseconds. Value is 0 or greater <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if `format` or `size` was not supported |

### getOutputStallDuration

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public long getOutputStallDuration (Class<T> klass, 
                Size size)
```

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

For more information refer to `https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#getOutputStallDuration(java.lang.Class<T>,%20android.util.Size)`.

<br />

| Parameters ||
|---|---|
| `klass` | `Class`: a class which has a non-empty array returned by `https://developer.android.com/reference/android/hardware/camera2/params/RecommendedStreamConfigurationMap#getOutputSizes(java.lang.Class<T>)`. This value cannot be `null`. <br /> |
| `size` | `Size`: an output-compatible size. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `long` | a minimum frame duration `>` 0 in nanoseconds, or 0 if the stall duration is not available. Value is 0 or greater <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if `klass` or `size` was not supported |

### getRecommendedUseCase

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getRecommendedUseCase ()
```

Get the use case value for the recommended stream configurations.

<br />

| Returns ||
|---|---|
| `int` | Use case id. Value is one of the following: - `https://developer.android.com/reference/android/hardware/camera2/params/RecommendedStreamConfigurationMap#USECASE_PREVIEW` - `https://developer.android.com/reference/android/hardware/camera2/params/RecommendedStreamConfigurationMap#USECASE_RECORD` - `https://developer.android.com/reference/android/hardware/camera2/params/RecommendedStreamConfigurationMap#USECASE_VIDEO_SNAPSHOT` - `https://developer.android.com/reference/android/hardware/camera2/params/RecommendedStreamConfigurationMap#USECASE_SNAPSHOT` - `https://developer.android.com/reference/android/hardware/camera2/params/RecommendedStreamConfigurationMap#USECASE_ZSL` - `https://developer.android.com/reference/android/hardware/camera2/params/RecommendedStreamConfigurationMap#USECASE_RAW` - `https://developer.android.com/reference/android/hardware/camera2/params/RecommendedStreamConfigurationMap#USECASE_LOW_LATENCY_SNAPSHOT` - `https://developer.android.com/reference/android/hardware/camera2/params/RecommendedStreamConfigurationMap#USECASE_10BIT_OUTPUT` |

### getValidOutputFormatsForInput

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Set<Integer> getValidOutputFormatsForInput (int inputFormat)
```

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

For more information refer to `https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#getValidOutputFormatsForInput(int)`.

<br />

<br />

| Parameters ||
|---|---|
| `inputFormat` | `int` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/Set<https://developer.android.com/reference/java/lang/Integer>` | a non-modifiable set of Integer formats. This value may be `null`. <br /> |

### isOutputSupportedFor

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isOutputSupportedFor (Surface surface)
```

Determine whether or not the `surface` in its current state is suitable to be included in a `https://developer.android.com/reference/android/hardware/camera2/CameraDevice#createCaptureSession(android.hardware.camera2.params.SessionConfiguration)` as an output.

For more information refer to `https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#isOutputSupportedFor(android.view.Surface)`.

<br />

<br />

| Parameters ||
|---|---|
| `surface` | `Surface`: a `https://developer.android.com/reference/android/view/Surface` object reference. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `boolean` | `true` if this is supported, `false` otherwise <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if the Surface endpoint is no longer valid |

### isOutputSupportedFor

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isOutputSupportedFor (int format)
```

Determine whether or not output surfaces with a particular user-defined format can be passed `https://developer.android.com/reference/android/hardware/camera2/CameraDevice#createCaptureSession(android.hardware.camera2.params.SessionConfiguration)`.

For further information refer to `https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#isOutputSupportedFor(android.view.Surface)`.

<br />

<br />

| Parameters ||
|---|---|
| `format` | `int`: an image format from either `https://developer.android.com/reference/android/graphics/ImageFormat` or `https://developer.android.com/reference/android/graphics/PixelFormat` <br /> |

| Returns ||
|---|---|
| `boolean` | `true` if using a `surface` with this `format` will be supported with `https://developer.android.com/reference/android/hardware/camera2/CameraDevice#createCaptureSession(android.hardware.camera2.params.SessionConfiguration)` <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if the image format was not a defined named constant from either `https://developer.android.com/reference/android/graphics/ImageFormat` or `https://developer.android.com/reference/android/graphics/PixelFormat` |