# VideoFrameProcessorTestRunner.SurfaceBitmapReader

# VideoFrameProcessorTestRunner.SurfaceBitmapReader

Artifact:[androidx.media3:media3-test-utils](https://developer.android.com/jetpack/androidx/releases/media3)  
[View Source](https://cs.android.com/search?q=file:androidx/media3/test/utils/VideoFrameProcessorTestRunner.java+class:androidx.media3.test.utils.VideoFrameProcessorTestRunner.SurfaceBitmapReader)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/media3/test/utils/VideoFrameProcessorTestRunner.SurfaceBitmapReader "View this page in Java")

<br />

```
class VideoFrameProcessorTestRunner.SurfaceBitmapReader : VideoFrameProcessorTestRunner.BitmapReader
```

<br />

*** ** * ** ***

Reads from a[Surface](https://developer.android.com/reference/android/view/Surface.html). Only supports SDR input.

## Summary

|                                                                                                                                               ### Public constructors                                                                                                                                               |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [SurfaceBitmapReader](https://developer.android.com/reference/kotlin/androidx/media3/test/utils/VideoFrameProcessorTestRunner.SurfaceBitmapReader#SurfaceBitmapReader(boolean))`(releaseOutputSurface: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`)` Creates an instance. |

|                               ### Public functions                                |
|-----------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Bitmap](https://developer.android.com/reference/android/graphics/Bitmap.html)`!` | [getBitmap](https://developer.android.com/reference/kotlin/androidx/media3/test/utils/VideoFrameProcessorTestRunner.SurfaceBitmapReader#getBitmap())`()` Returns the output[Bitmap](https://developer.android.com/reference/android/graphics/Bitmap.html).                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| [Surface](https://developer.android.com/reference/android/view/Surface.html)`?`   | [getSurface](https://developer.android.com/reference/kotlin/androidx/media3/test/utils/VideoFrameProcessorTestRunner.SurfaceBitmapReader#getSurface(int,int,boolean))`(` ` width: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`,` ` height: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`,` ` useHighPrecisionColorComponents: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) `)` Returns the[VideoFrameProcessor](https://developer.android.com/reference/kotlin/androidx/media3/common/VideoFrameProcessor)output[Surface](https://developer.android.com/reference/android/view/Surface.html), if one is needed. |

|                                ### Public properties                                |
|-------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | [releaseOutputSurface](https://developer.android.com/reference/kotlin/androidx/media3/test/utils/VideoFrameProcessorTestRunner.SurfaceBitmapReader#releaseOutputSurface()) |

## Public constructors

### SurfaceBitmapReader

```
SurfaceBitmapReader(releaseOutputSurface: Boolean)
```

Creates an instance.  

|                                                 Parameters                                                  |
|-------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `releaseOutputSurface: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | Whether the[VideoFrameProcessor](https://developer.android.com/reference/kotlin/androidx/media3/common/VideoFrameProcessor)output Surface must be released at calls to[getSurface](https://developer.android.com/reference/kotlin/androidx/media3/test/utils/VideoFrameProcessorTestRunner.SurfaceBitmapReader#getSurface(int,int,boolean)). |

## Public functions

### getBitmap

```
fun getBitmap(): Bitmap!
```

Returns the output[Bitmap](https://developer.android.com/reference/android/graphics/Bitmap.html).  

### getSurface

```
fun getSurface(
    width: Int,
    height: Int,
    useHighPrecisionColorComponents: Boolean
): Surface?
```

Returns the[VideoFrameProcessor](https://developer.android.com/reference/kotlin/androidx/media3/common/VideoFrameProcessor)output[Surface](https://developer.android.com/reference/android/view/Surface.html), if one is needed.  

## Public properties

### releaseOutputSurface

```
val releaseOutputSurface: Boolean
```