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

# OnActiveOutputSurfacesListener

*** ** * ** ***

```
interface OnActiveOutputSurfacesListener
```

|---|
| [android.hardware.camera2.MultiResolutionImageReader.OnActiveOutputSurfacesListener](https://developer.android.com/reference/kotlin/android/hardware/camera2/MultiResolutionImageReader.OnActiveOutputSurfacesListener#) |

Callback interface for being notified of the surfaces used for the capture.

The onActiveOutputSurfaces is called per request on this MultiResolutionImageReader, to indicate which underlying ImageReader surfaces are outputting images.

## Summary

| Public methods ||
|---|---|
| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | `https://developer.android.com/reference/kotlin/android/hardware/camera2/MultiResolutionImageReader.OnActiveOutputSurfacesListener#onActiveOutputSurfaces(kotlin.collections.MutableList,%20kotlin.Long,%20kotlin.Long)(activeOutputSurfaces: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html<https://developer.android.com/reference/kotlin/android/view/Surface.html#!>, timestamp: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html, frameNumber: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)` Callback that is called to notify the active surfaces that the application should expect to receive images from. |

## Public methods

### onActiveOutputSurfaces

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

```
abstract fun onActiveOutputSurfaces(
    activeOutputSurfaces: MutableList<Surface!>, 
    timestamp: Long, 
    frameNumber: Long
): Unit
```

Callback that is called to notify the active surfaces that the application should expect to receive images from.

If the MultiResolutionImageReader is created with `enableConcurrency` set to `true`, multiple underlying readers may produce images for a single capture request. The application can listen to this callback to know which readers to expect an output image from.

If the MultiResolutionImageReader is created without `enableConcurrency` set to `true`, this callback will not the triggered.

For each of the `activeOutputSurfaces`, a ImageReader.onImageAvailableListener.onImageAvailable will be called. Or in rare cases, android.hardware.camera2.CameraCaptureSession#onCaptureBufferLost is called if the buffer is dropped.

The `timestamp` can be used to correlate between the `activeOutputSurfaces` and the images being output from those surfaces. The timestamp can be start of exposure or start of readout depending on whether `https://developer.android.com/reference/kotlin/android/hardware/camera2/params/OutputConfiguration#setReadoutTimestampEnabled(kotlin.Boolean)` was called on the outputs. Similarly, the timestamp can be either in the same time base as in `https://developer.android.com/reference/kotlin/android/os/SystemClock.html#uptimeMillis()` or `https://developer.android.com/reference/kotlin/android/os/SystemClock.html#elapsedRealtime()` depending on the timestamp base of the outputs. See `https://developer.android.com/reference/kotlin/android/hardware/camera2/params/OutputConfiguration#setTimestampBase(kotlin.Int)` for details.

| Parameters ||
|---|---|
| `activeOutputSurfaces` | [MutableList](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)\<[Surface](https://developer.android.com/reference/kotlin/android/view/Surface.html#)!\>: the active output surfaces to expect an output from. This value cannot be `null`. |
| `timestamp` | [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html): the timestamp of the capture. |
| `frameNumber` | [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html): the frame number of this capture. |

**See Also**

- `https://developer.android.com/reference/kotlin/android/media/ImageReader.html#`
- `https://developer.android.com/reference/kotlin/android/hardware/camera2/CameraCaptureSession`
- `https://developer.android.com/reference/kotlin/android/hardware/camera2/params/OutputConfiguration`