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

# StreamConfigurationMap

*** ** * ** ***

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

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

<br />

*** ** * ** ***

Immutable class to store the available stream `https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP` 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)`.

This is the authoritative list for all output formats (and sizes respectively for that format) that are supported by a camera device.

This also contains the minimum frame durations and stall durations 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 from `https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics` using the `https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP` key and the `https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics#get(android.hardware.camera2.CameraCharacteristics.Key<T>)` method.

    `CameraCharacteristics characteristics = cameraManager.getCameraCharacteristics(cameraId);
    StreamConfigurationMap configs = characteristics.get(
            CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP);
    `

<br />

**See also:**

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

## Summary

| ### Public methods ||
|---|---|
| ` boolean` | ` https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) ` Check if this `https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap` is equal to another `https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap`. |
| ` https://developer.android.com/reference/android/util/Size` | ` https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#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/android/util/Range<https://developer.android.com/reference/java/lang/Integer>` | ` https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#getHighSpeedVideoFpsRanges()() ` Get a list of supported high speed video recording FPS ranges. |
| ` 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/StreamConfigurationMap#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/android/util/Size` | ` https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#getHighSpeedVideoSizes()() ` Get a list of supported high speed video recording sizes. |
| ` https://developer.android.com/reference/android/util/Size` | ` https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#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. |
| ` int[]` | ` https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#getInputFormats()() ` Get the image `format` input formats in this stream configuration. |
| ` https://developer.android.com/reference/android/util/Size` | ` https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#getInputSizes(int)(int format) ` Get the supported input sizes for this input format. |
| ` int[]` | ` https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#getOutputFormats()() ` Get the image `format` output formats in this stream configuration. |
| ` <T> long` | ` https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#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/StreamConfigurationMap#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/android/util/Size` | ` https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#getOutputSizes(int)(int format) ` Get a list of sizes compatible with the requested image `format`. |
| ` <T> https://developer.android.com/reference/android/util/Size` | ` https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#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/StreamConfigurationMap#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/StreamConfigurationMap#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/StreamConfigurationMap#getValidOutputFormatsForInput(int)(int inputFormat) ` Get the image `format` output formats for a reprocessing input format. |
| ` int` | ` https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#hashCode()() ` Returns a hash code value for the object. |
| ` boolean` | ` https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#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/StreamConfigurationMap#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)`. |
| ` static <T> boolean` | ` https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#isOutputSupportedFor(java.lang.Class<T>)(https://developer.android.com/reference/java/lang/Class<T> klass) ` Determine whether or not output streams can be configured with a particular class as a consumer. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#toString()() ` Return this `https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap` as a string representation. |

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

## Public methods

### equals

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

```
public boolean equals (Object obj)
```

Check if this `https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap` is equal to another `https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap`.

Two vectors are only equal if and only if each of the respective elements is equal.

<br />

<br />

| Parameters ||
|---|---|
| `obj` | `Object`: the reference object with which to compare. <br /> |

| Returns ||
|---|---|
| `boolean` | `true` if the objects were equal, `false` otherwise <br /> |

### getHighResolutionOutputSizes

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

```
public Size[] getHighResolutionOutputSizes (int format)
```

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

This includes all output sizes that cannot meet the 20 fps frame rate requirements for the `https://developer.android.com/reference/android/hardware/camera2/CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_BURST_CAPTURE` capability. This does not include the stall duration, so for example, a JPEG or RAW16 output resolution with a large stall duration but a minimum frame duration that's above 20 fps will still be listed in the regular `https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#getOutputSizes(int)` list. All the sizes on this list that are less than 24 megapixels are still guaranteed to operate at a rate of at least 10 fps, not including stall duration. Sizes on this list that are at least 24 megapixels are allowed to operate at less than 10 fps.

For a device that does not support the BURST_CAPTURE capability, this list will be `null`, since resolutions in the `https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#getOutputSizes(int)` list are already not guaranteed to meet \>= 20 fps rate requirements. For a device that does support the BURST_CAPTURE capability, this list may be empty, if all supported resolutions meet the 20 fps requirement.

<br />

<br />

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

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

### getHighSpeedVideoFpsRanges

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

```
public Range[]<Integer> getHighSpeedVideoFpsRanges ()
```

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

When `https://developer.android.com/reference/android/hardware/camera2/CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_CONSTRAINED_HIGH_SPEED_VIDEO` is supported in `https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES`, this method will list the supported high speed video FPS range configurations. Application can then use `https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#getHighSpeedVideoSizesFor(android.util.Range<java.lang.Integer>)` to query available sizes for one of returned FPS range.

To enable high speed video recording, application must create a constrained create high speed capture session via `https://developer.android.com/reference/android/hardware/camera2/CameraDevice#createConstrainedHighSpeedCaptureSession(java.util.List<android.view.Surface>,%20android.hardware.camera2.CameraCaptureSession.StateCallback,%20android.os.Handler)`, and submit a CaptureRequest list created by `https://developer.android.com/reference/android/hardware/camera2/CameraConstrainedHighSpeedCaptureSession#createHighSpeedRequestList(android.hardware.camera2.CaptureRequest)` to this session. The application must select the video size from this method and `https://developer.android.com/reference/android/hardware/camera2/CaptureRequest#CONTROL_AE_TARGET_FPS_RANGE` from `https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#getHighSpeedVideoFpsRangesFor(android.util.Size)` to configure the constrained high speed session and generate the high speed request list. For example, if the application intends to do high speed recording, it can select one FPS range reported by this method, query the video sizes corresponding to this FPS range by `https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#getHighSpeedVideoSizesFor(android.util.Range<java.lang.Integer>)` and use one of reported sizes to create a high speed capture session. Note that for the use case of multiple output streams, application must select one unique size from this method to use (e.g., preview and recording streams must have the same size). Otherwise, the high speed session creation will fail. Once the high speed capture session is created, the application can set the FPS range in the recording request lists via `https://developer.android.com/reference/android/hardware/camera2/CameraConstrainedHighSpeedCaptureSession#createHighSpeedRequestList(android.hardware.camera2.CaptureRequest)`.

The FPS ranges reported by this method will have below characteristics:
- The fpsMin and fpsMax will be a multiple 30fps.
- The fpsMin will be no less than 30fps, the fpsMax will be no less than 120fps.
- At least one range will be a fixed FPS range where fpsMin == fpsMax.
- For each fixed FPS range, there will be one corresponding variable FPS range \[30, fps_max\] or \[60, fps_max\]. These kinds of FPS ranges are suitable for preview-only use cases where the application doesn't want the camera device always produce higher frame rate than the display refresh rate. Both 30fps and 60fps preview rate will not be supported for the same recording rate.
- This function returns an empty array if `https://developer.android.com/reference/android/hardware/camera2/CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_CONSTRAINED_HIGH_SPEED_VIDEO` is not supported.

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/util/Range<https://developer.android.com/reference/java/lang/Integer>` | an array of supported high speed video recording FPS ranges The upper bound of returned ranges is guaranteed to be larger or equal to 120. <br /> |

**See also:**

- `https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#getHighSpeedVideoSizesFor(android.util.Range<java.lang.Integer>)`
- `https://developer.android.com/reference/android/hardware/camera2/CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_CONSTRAINED_HIGH_SPEED_VIDEO`
- `https://developer.android.com/reference/android/hardware/camera2/CameraDevice#createConstrainedHighSpeedCaptureSession(java.util.List<android.view.Surface>,%20android.hardware.camera2.CameraCaptureSession.StateCallback,%20android.os.Handler)`
- `https://developer.android.com/reference/android/hardware/camera2/CameraConstrainedHighSpeedCaptureSession#createHighSpeedRequestList(android.hardware.camera2.CaptureRequest)`

### getHighSpeedVideoFpsRangesFor

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

```
public Range[]<Integer> getHighSpeedVideoFpsRangesFor (Size size)
```

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

See `https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#getHighSpeedVideoFpsRanges()` for how to enable high speed recording.

The `https://developer.android.com/reference/android/hardware/camera2/CaptureRequest#CONTROL_AE_TARGET_FPS_RANGE` reported in this method must not be used to setup capture requests that are submitted to unconstrained capture sessions, or it will result in `https://developer.android.com/reference/java/lang/IllegalArgumentException`.

See `https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#getHighSpeedVideoFpsRanges()` for the characteristics of the returned FPS ranges.

<br />

<br />

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

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/util/Range<https://developer.android.com/reference/java/lang/Integer>` | an array of supported high speed video recording FPS ranges The upper bound of returned ranges is guaranteed to be greater than or equal to 120. <br /> |

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

**See also:**

- `https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#getHighSpeedVideoSizes()`
- `https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#getHighSpeedVideoFpsRanges()`

### getHighSpeedVideoSizes

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

```
public Size[] getHighSpeedVideoSizes ()
```

Get a list of supported high speed video recording sizes.

When `https://developer.android.com/reference/android/hardware/camera2/CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_CONSTRAINED_HIGH_SPEED_VIDEO` is supported in `https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES`, this method will list the supported high speed video size configurations. All the sizes listed will be a subset of the sizes reported by `https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#getOutputSizes(int)` for processed non-stalling formats (typically `https://developer.android.com/reference/android/graphics/ImageFormat#PRIVATE` `https://developer.android.com/reference/android/graphics/ImageFormat#YUV_420_888`, etc.)

To enable high speed video recording, application must create a constrained create high speed capture session via `https://developer.android.com/reference/android/hardware/camera2/CameraDevice#createConstrainedHighSpeedCaptureSession(java.util.List<android.view.Surface>,%20android.hardware.camera2.CameraCaptureSession.StateCallback,%20android.os.Handler)`, and submit a CaptureRequest list created by `https://developer.android.com/reference/android/hardware/camera2/CameraConstrainedHighSpeedCaptureSession#createHighSpeedRequestList(android.hardware.camera2.CaptureRequest)` to this session. The application must select the video size from this method and `https://developer.android.com/reference/android/hardware/camera2/CaptureRequest#CONTROL_AE_TARGET_FPS_RANGE` from `https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#getHighSpeedVideoFpsRangesFor(android.util.Size)` to configure the constrained high speed session and generate the high speed request list. For example, if the application intends to do high speed recording, it can select the maximum size reported by this method to create high speed capture session. Note that for the use case of multiple output streams, application must select one unique size from this method to use (e.g., preview and recording streams must have the same size). Otherwise, the high speed session creation will fail. Once the size is selected, application can get the supported FPS ranges by `https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#getHighSpeedVideoFpsRangesFor(android.util.Size)`, and use these FPS ranges to setup the recording request lists via `https://developer.android.com/reference/android/hardware/camera2/CameraConstrainedHighSpeedCaptureSession#createHighSpeedRequestList(android.hardware.camera2.CaptureRequest)`.

This function returns an empty array if `https://developer.android.com/reference/android/hardware/camera2/CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_CONSTRAINED_HIGH_SPEED_VIDEO` is not supported.

<br />

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/util/Size` | an array of supported high speed video recording sizes <br /> |

**See also:**

- `https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#getHighSpeedVideoFpsRangesFor(android.util.Size)`
- `https://developer.android.com/reference/android/hardware/camera2/CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_CONSTRAINED_HIGH_SPEED_VIDEO`
- `https://developer.android.com/reference/android/hardware/camera2/CameraDevice#createConstrainedHighSpeedCaptureSession(java.util.List<android.view.Surface>,%20android.hardware.camera2.CameraCaptureSession.StateCallback,%20android.os.Handler)`
- `https://developer.android.com/reference/android/hardware/camera2/CameraConstrainedHighSpeedCaptureSession#createHighSpeedRequestList(android.hardware.camera2.CaptureRequest)`

### getHighSpeedVideoSizesFor

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

```
public Size[] getHighSpeedVideoSizesFor (Range<Integer> fpsRange)
```

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

See `https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#getHighSpeedVideoSizes()` for how to enable high speed recording.

<br />

<br />

| Parameters ||
|---|---|
| `fpsRange` | `Range`: one of the FPS range returned by `https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#getHighSpeedVideoFpsRanges()` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/util/Size` | An array of video sizes to create high speed capture sessions for high speed streaming use cases. <br /> |

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

**See also:**

- `https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#getHighSpeedVideoFpsRanges()`

### getInputFormats

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

```
public int[] 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 ||
|---|---|
| `int[]` | an array of integer format <br /> |

**See also:**

- `https://developer.android.com/reference/android/graphics/ImageFormat`
- `https://developer.android.com/reference/android/graphics/PixelFormat`

### getInputSizes

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

```
public 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/StreamConfigurationMap#getInputFormats()`; otherwise `null` is returned.

<br />

<br />

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

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

### getOutputFormats

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

```
public int[] getOutputFormats ()
```

Get the image `format` output 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).

Formats listed in this array are guaranteed to return true if queried with `https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#isOutputSupportedFor(int)`.

<br />

<br />

| Returns ||
|---|---|
| `int[]` | an array of integer format <br /> |

**See also:**

- `https://developer.android.com/reference/android/graphics/ImageFormat`
- `https://developer.android.com/reference/android/graphics/PixelFormat`

### getOutputMinFrameDuration

Added in [API level 21](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).

This assumes that the `klass` is set up to use `https://developer.android.com/reference/android/graphics/ImageFormat#PRIVATE`. For user-defined formats, use `https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#getOutputMinFrameDuration(int,%20android.util.Size)`.

`klass` should be one of the ones which is supported by `https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#isOutputSupportedFor(java.lang.Class<T>)`.

`size` should be one of the ones returned by `https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#getOutputSizes(int)`.

This corresponds to the minimum frame duration (maximum frame rate) possible when only that stream is configured in a session, with all processing (typically in `android.*.mode`) set to either `OFF` or `FAST`.

When multiple streams are used in a session, the minimum frame duration will be `max(individual stream min durations)`. See `https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#getOutputStallDuration(int,%20android.util.Size)` for details of timing for formats that may cause frame rate slowdown when they are targeted by a capture request.

For devices that do not support manual sensor control (`https://developer.android.com/reference/android/hardware/camera2/CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_MANUAL_SENSOR`), this function may return 0.

The minimum frame duration of a stream (of a particular format, size) is the same regardless of whether the stream is input or output.

<br />

<br />

| Parameters ||
|---|---|
| `klass` | `Class`: a class which is supported by `https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#isOutputSupportedFor(java.lang.Class<T>)` and has a non-empty array returned by `https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#getOutputSizes(java.lang.Class<T>)` <br /> |
| `size` | `Size`: an output-compatible size <br /> |

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

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

**See also:**

- `https://developer.android.com/reference/android/hardware/camera2/CaptureRequest#SENSOR_FRAME_DURATION`
- `https://developer.android.com/reference/android/graphics/ImageFormat`
- `https://developer.android.com/reference/android/graphics/PixelFormat`

### getOutputMinFrameDuration

Added in [API level 21](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).

`format` should be one of the ones returned by `https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#getOutputFormats()`.

`size` should be one of the ones returned by `https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#getOutputSizes(int)`.

This corresponds to the minimum frame duration (maximum frame rate) possible when only that stream is configured in a session, with all processing (typically in `android.*.mode`) set to either `OFF` or `FAST`.

When multiple streams are used in a session, the minimum frame duration will be `max(individual stream min durations)`. See `https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#getOutputStallDuration(int,%20android.util.Size)` for details of timing for formats that may cause frame rate slowdown when they are targeted by a capture request.

For camera `https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP`, up until Android 11, for devices that do not support manual sensor control (`https://developer.android.com/reference/android/hardware/camera2/CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_MANUAL_SENSOR`), this function may return 0. From Android 12 onwards, this function always returns a positive value.

For `https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP_MAXIMUM_RESOLUTION` stream configuration map, this function always returns a positive value for OSes newer than Android 17.

The minimum frame duration of a stream (of a particular format, size) is the same regardless of whether the stream is input or output.

<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 <br /> |

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

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

**See also:**

- `https://developer.android.com/reference/android/hardware/camera2/CaptureRequest#SENSOR_FRAME_DURATION`
- `https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#getOutputStallDuration(int,%20android.util.Size)`
- `https://developer.android.com/reference/android/graphics/ImageFormat`
- `https://developer.android.com/reference/android/graphics/PixelFormat`

### getOutputSizes

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

```
public Size[] getOutputSizes (int format)
```

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

The `format` should be a supported format (one of the formats returned by `https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#getOutputFormats()`).
As of API level 23, the `https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#getHighResolutionOutputSizes(int)` method can be used on devices that support the `https://developer.android.com/reference/android/hardware/camera2/CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_BURST_CAPTURE` capability to get a list of high-resolution output sizes that cannot operate at the preferred 20fps rate. This means that for some supported formats, this method will return an empty list, if all the supported resolutions operate at below 20fps. For devices that do not support the BURST_CAPTURE capability, all output resolutions are listed through this method.

<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/android/util/Size` | an array of supported sizes, or `null` if the `format` is not a supported output <br /> |

**See also:**

- `https://developer.android.com/reference/android/graphics/ImageFormat`
- `https://developer.android.com/reference/android/graphics/PixelFormat`
- `https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#getOutputFormats()`

### getOutputSizes

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

```
public Size[] getOutputSizes (Class<T> klass)
```

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

Some of the supported classes may support additional formats beyond `https://developer.android.com/reference/android/graphics/ImageFormat#PRIVATE`; this function only returns sizes for `https://developer.android.com/reference/android/graphics/ImageFormat#PRIVATE`. For example, `https://developer.android.com/reference/android/media/ImageReader` supports `https://developer.android.com/reference/android/graphics/ImageFormat#YUV_420_888` and `https://developer.android.com/reference/android/graphics/ImageFormat#PRIVATE`, this method will only return the sizes for `https://developer.android.com/reference/android/graphics/ImageFormat#PRIVATE` for `https://developer.android.com/reference/android/media/ImageReader` class.

If a well-defined format such as `NV21` is required, use `https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#getOutputSizes(int)` instead.

The `klass` should be a supported output, that querying `#isOutputSupportedFor(Class)` should return `true`.

<br />

<br />

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

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/util/Size` | an array of supported sizes for `https://developer.android.com/reference/android/graphics/ImageFormat#PRIVATE` format, or `null` iff the `klass` is not a supported output. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/NullPointerException` | if `klass` was `null` |

**See also:**

- `https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#isOutputSupportedFor(java.lang.Class<T>)`

### getOutputStallDuration

Added in [API level 21](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).

`format` should be one of the ones returned by `https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#getOutputFormats()`.

`size` should be one of the ones returned by `https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#getOutputSizes(int)`.

A stall duration is how much extra time would get added to the normal minimum frame duration for a repeating request that has streams with non-zero stall.

For example, consider JPEG captures which have the following characteristics:

- JPEG streams act like processed YUV streams in requests for which they are not included; in requests in which they are directly referenced, they act as JPEG streams. This is because supporting a JPEG stream requires the underlying YUV data to always be ready for use by a JPEG encoder, but the encoder will only be used (and impact frame duration) on requests that actually reference a JPEG stream.
- The JPEG processor can run concurrently to the rest of the camera pipeline, but cannot process more than 1 capture at a time.

In other words, using a repeating YUV request would result in a steady frame rate (let's say it's 30 FPS). If a single JPEG request is submitted periodically, the frame rate will stay at 30 FPS (as long as we wait for the previous JPEG to return each time). If we try to submit a repeating YUV + JPEG request, then the frame rate will drop from 30 FPS.

In general, submitting a new request with a non-0 stall time stream will *not* cause a frame rate drop unless there are still outstanding buffers for that stream from previous requests.

Submitting a repeating request with streams (call this `S`) is the same as setting the minimum frame duration from the normal minimum frame duration corresponding to `S`, added with the maximum stall duration for `S`.

If interleaving requests with and without a stall duration, a request will stall by the maximum of the remaining times for each can-stall stream with outstanding buffers.

This means that a stalling request will not have an exposure start until the stall has completed.

This should correspond to the stall duration when only that stream is active, with all processing (typically in `android.*.mode`) set to `FAST` or `OFF`. Setting any of the processing modes to `HIGH_QUALITY` effectively results in an indeterminate stall duration for all streams in a request (the regular stall calculation rules are ignored).

The following formats may always have a stall duration:

- `https://developer.android.com/reference/android/graphics/ImageFormat#JPEG`
- `https://developer.android.com/reference/android/graphics/ImageFormat#RAW_SENSOR`
- `https://developer.android.com/reference/android/graphics/ImageFormat#RAW_PRIVATE`

<br />

The following formats will never have a stall duration:

- `https://developer.android.com/reference/android/graphics/ImageFormat#YUV_420_888`
- `https://developer.android.com/reference/android/graphics/ImageFormat#PRIVATE`

<br />

All other formats may or may not have an allowed stall duration on a per-capability basis; refer to `https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES` for more details.

<br />

See `https://developer.android.com/reference/android/hardware/camera2/CaptureRequest#SENSOR_FRAME_DURATION` for more information about calculating the max frame rate (absent stalls).

<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 <br /> |

| Returns ||
|---|---|
| `long` | a stall duration `>=` 0 in nanoseconds <br /> |

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

**See also:**

- `https://developer.android.com/reference/android/hardware/camera2/CaptureRequest#SENSOR_FRAME_DURATION`
- `https://developer.android.com/reference/android/graphics/ImageFormat`
- `https://developer.android.com/reference/android/graphics/PixelFormat`

### getOutputStallDuration

Added in [API level 21](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).

This assumes that the `klass` is set up to use `https://developer.android.com/reference/android/graphics/ImageFormat#PRIVATE`. For user-defined formats, use `https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#getOutputMinFrameDuration(int,%20android.util.Size)`.

`klass` should be one of the ones with a non-empty array returned by `https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#getOutputSizes(java.lang.Class<T>)`.

`size` should be one of the ones returned by `https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#getOutputSizes(java.lang.Class<T>)`.

See `https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#getOutputStallDuration(int,%20android.util.Size)` for a definition of a *stall duration*.

<br />

<br />

| Parameters ||
|---|---|
| `klass` | `Class`: a class which is supported by `https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#isOutputSupportedFor(java.lang.Class<T>)` and has a non-empty array returned by `https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#getOutputSizes(java.lang.Class<T>)` <br /> |
| `size` | `Size`: an output-compatible size <br /> |

| Returns ||
|---|---|
| `long` | a minimum frame duration `>=` 0 in nanoseconds <br /> |

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

**See also:**

- `https://developer.android.com/reference/android/hardware/camera2/CaptureRequest#SENSOR_FRAME_DURATION`
- `https://developer.android.com/reference/android/graphics/ImageFormat`
- `https://developer.android.com/reference/android/graphics/PixelFormat`

### getValidOutputFormatsForInput

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

```
public int[] getValidOutputFormatsForInput (int inputFormat)
```

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

When submitting a `https://developer.android.com/reference/android/hardware/camera2/CaptureRequest` with an input Surface of a given format, the only allowed target outputs of the `https://developer.android.com/reference/android/hardware/camera2/CaptureRequest` are the ones with a format listed in the return value of this method. Including any other output Surface as a target will throw an IllegalArgumentException. If no output format is supported given the input format, an empty int\[\] will be returned.

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

Formats listed in this array are guaranteed to return true if queried with `https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#isOutputSupportedFor(int)`.

<br />

<br />

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

| Returns ||
|---|---|
| `int[]` | an array of integer format <br /> |

**See also:**

- `https://developer.android.com/reference/android/graphics/ImageFormat`
- `https://developer.android.com/reference/android/graphics/PixelFormat`

### hashCode

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

```
public int hashCode ()
```

Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by `https://developer.android.com/reference/java/util/HashMap`.

The general contract of `hashCode` is:

- Whenever it is invoked on the same object more than once during an execution of a Java application, the `hashCode` method must consistently return the same integer, provided no information used in `equals` comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
- If two objects are equal according to the `https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)` method, then calling the `hashCode` method on each of the two objects must produce the same integer result.
- It is *not* required that if two objects are unequal according to the `https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)` method, then calling the `hashCode` method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.

<br />

<br />

| Returns ||
|---|---|
| `int` | a hash code value for this object. <br /> |

### isOutputSupportedFor

Added in [API level 21](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.

Not all surfaces are usable with the `https://developer.android.com/reference/android/hardware/camera2/CameraDevice`, and not all configurations of that `surface` are compatible. Some classes that provide the `surface` are compatible with the `https://developer.android.com/reference/android/hardware/camera2/CameraDevice` in general (see `https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#isOutputSupportedFor(java.lang.Class<T>)`, but it is the caller's responsibility to put the `surface` into a state that will be compatible with the `https://developer.android.com/reference/android/hardware/camera2/CameraDevice`.

Reasons for a `surface` being specifically incompatible might be:

- Using a format that's not listed by `https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#getOutputFormats()`
- Using a format/size combination that's not listed by `https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#getOutputSizes(int)`
- The `surface` itself is not in a state where it can service a new producer.

  <br />

Surfaces from flexible sources will return true even if the exact size of the Surface does not match a camera-supported size, as long as the format (or class) is supported and the camera device supports a size that is equal to or less than 1080p in that format. If such as Surface is used to create a capture session, it will have its size rounded to the nearest supported size, below or equal to 1080p. Flexible sources include SurfaceView, SurfaceTexture, and ImageReader.

This is not an exhaustive list; see the particular class's documentation for further possible reasons of incompatibility.

<br />

<br />

| Parameters ||
|---|---|
| `surface` | `Surface`: a non-`null` `https://developer.android.com/reference/android/view/Surface` object reference <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 |
| `https://developer.android.com/reference/java/lang/NullPointerException` | if `surface` was `null` |

**See also:**

- `https://developer.android.com/reference/android/hardware/camera2/CameraDevice#createCaptureSession(android.hardware.camera2.params.SessionConfiguration)`
- `https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#isOutputSupportedFor(java.lang.Class<T>)`

### isOutputSupportedFor

Added in [API level 21](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)`.

This method determines that the output `format` is supported by the camera device; each output `surface` target may or may not itself support that `format`. Refer to the class which provides the surface for additional documentation.

Formats for which this returns `true` are guaranteed to exist in the result returned by `https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#getOutputSizes(int)`.

<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` iff 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` |

**See also:**

- `https://developer.android.com/reference/android/graphics/ImageFormat`
- `https://developer.android.com/reference/android/graphics/PixelFormat`
- `https://developer.android.com/reference/android/hardware/camera2/CameraDevice#createCaptureSession(android.hardware.camera2.params.SessionConfiguration)`

### isOutputSupportedFor

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

```
public static boolean isOutputSupportedFor (Class<T> klass)
```

Determine whether or not output streams can be configured with a particular class as a consumer.

The following list is generally usable for outputs:

- `https://developer.android.com/reference/android/media/ImageReader` - Recommended for image processing or streaming to external resources (such as a file or network)
- `https://developer.android.com/reference/android/media/MediaRecorder` - Recommended for recording video (simple to use)
- `https://developer.android.com/reference/android/media/MediaCodec` - Recommended for recording video (more complicated to use, with more flexibility)
- `https://developer.android.com/reference/android/view/SurfaceHolder` - Recommended for low-power camera preview with `https://developer.android.com/reference/android/view/SurfaceView`
- `https://developer.android.com/reference/android/graphics/SurfaceTexture` - Recommended for OpenGL-accelerated preview processing or compositing with `https://developer.android.com/reference/android/view/TextureView`

<br />

Generally speaking this means that creating a `https://developer.android.com/reference/android/view/Surface` from that class *may* provide a producer endpoint that is suitable to be used with `https://developer.android.com/reference/android/hardware/camera2/CameraDevice#createCaptureSession(android.hardware.camera2.params.SessionConfiguration)`.

Since not all of the above classes support output of all format and size combinations, the particular combination should be queried with `https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#isOutputSupportedFor(android.view.Surface)`.

<br />

<br />

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

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

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/NullPointerException` | if `klass` was `null` |

**See also:**

- `https://developer.android.com/reference/android/hardware/camera2/CameraDevice#createCaptureSession(android.hardware.camera2.params.SessionConfiguration)`
- `https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#isOutputSupportedFor(android.view.Surface)`

### toString

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

```
public String toString ()
```

Return this `https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap` as a string representation.

`"StreamConfigurationMap(Outputs([w:%d, h:%d, format:%s(%d), min_duration:%d, stall:%d], ... [w:%d, h:%d, format:%s(%d), min_duration:%d, stall:%d]), Inputs([w:%d, h:%d, format:%s(%d)], ... [w:%d, h:%d, format:%s(%d)]), ValidOutputFormatsForInput( [in:%d, out:%d, ... %d], ... [in:%d, out:%d, ... %d]), HighSpeedVideoConfigurations( [w:%d, h:%d, min_fps:%d, max_fps:%d], ... [w:%d, h:%d, min_fps:%d, max_fps:%d]))"`.

`Outputs([w:%d, h:%d, format:%s(%d), min_duration:%d, stall:%d], ... [w:%d, h:%d, format:%s(%d), min_duration:%d, stall:%d])`, where `[w:%d, h:%d, format:%s(%d), min_duration:%d, stall:%d]` represents an output configuration's width, height, format, minimal frame duration in nanoseconds, and stall duration in nanoseconds.

`Inputs([w:%d, h:%d, format:%s(%d)], ... [w:%d, h:%d, format:%s(%d)])`, where `[w:%d, h:%d, format:%s(%d)]` represents an input configuration's width, height, and format.

`ValidOutputFormatsForInput([in:%s(%d), out:%s(%d), ... %s(%d)], ... [in:%s(%d), out:%s(%d), ... %s(%d)])`, where `[in:%s(%d), out:%s(%d), ... %s(%d)]` represents an input format and its valid output formats.

`HighSpeedVideoConfigurations([w:%d, h:%d, min_fps:%d, max_fps:%d], ... [w:%d, h:%d, min_fps:%d, max_fps:%d])`, where `[w:%d, h:%d, min_fps:%d, max_fps:%d]` represents a high speed video output configuration's width, height, minimal frame rate, and maximal frame rate.

<br />

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | string representation of `https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap` <br /> |