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

*** ** * ** ***


```
public final class VideoFrameProcessorTestRunner.SurfaceBitmapReader implements VideoFrameProcessorTestRunner.BitmapReader
```

<br />

*** ** * ** ***

Reads from a `https://developer.android.com/reference/android/view/Surface.html`. Only supports SDR input.

## Summary

| ### Public fields |
|---|---|
| `final boolean` | `https://developer.android.com/reference/androidx/media3/test/utils/VideoFrameProcessorTestRunner.SurfaceBitmapReader#releaseOutputSurface()` |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/media3/test/utils/VideoFrameProcessorTestRunner.SurfaceBitmapReader#SurfaceBitmapReader(boolean)(boolean releaseOutputSurface)` Creates an instance. |

| ### Public methods |
|---|---|
| `https://developer.android.com/reference/android/graphics/Bitmap.html` | `https://developer.android.com/reference/androidx/media3/test/utils/VideoFrameProcessorTestRunner.SurfaceBitmapReader#getBitmap()()` Returns the output `https://developer.android.com/reference/android/graphics/Bitmap.html`. |
| `@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/android/view/Surface.html` | `https://developer.android.com/reference/androidx/media3/test/utils/VideoFrameProcessorTestRunner.SurfaceBitmapReader#getSurface(int,int,boolean)( int width, int height, boolean useHighPrecisionColorComponents )` Returns the `https://developer.android.com/reference/androidx/media3/common/VideoFrameProcessor` output `https://developer.android.com/reference/android/view/Surface.html`, if one is needed. |

## Public fields

### releaseOutputSurface

```
public final boolean releaseOutputSurface
```

## Public constructors

### SurfaceBitmapReader

```
public SurfaceBitmapReader(boolean releaseOutputSurface)
```

Creates an instance.

| Parameters |
|---|---|
| `boolean releaseOutputSurface` | Whether the `https://developer.android.com/reference/androidx/media3/common/VideoFrameProcessor` output Surface must be released at calls to `https://developer.android.com/reference/androidx/media3/test/utils/VideoFrameProcessorTestRunner.SurfaceBitmapReader#getSurface(int,int,boolean)`. |

## Public methods

### getBitmap

```
public Bitmap getBitmap()
```

Returns the output `https://developer.android.com/reference/android/graphics/Bitmap.html`.

### getSurface

```
public @Nullable Surface getSurface(
    int width,
    int height,
    boolean useHighPrecisionColorComponents
)
```

Returns the `https://developer.android.com/reference/androidx/media3/common/VideoFrameProcessor` output `https://developer.android.com/reference/android/view/Surface.html`, if one is needed.