# DebugViewEffect

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

*** ** * ** ***


```
@UnstableApi
public final class DebugViewEffect implements GlEffect
```

<br />

*** ** * ** ***

`https://developer.android.com/reference/androidx/media3/effect/GlEffect` that renders to a `https://developer.android.com/reference/android/view/SurfaceView.html` provided by `https://developer.android.com/reference/androidx/media3/common/DebugViewProvider`.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/media3/effect/DebugViewEffect#DebugViewEffect(androidx.media3.common.DebugViewProvider,androidx.media3.common.ColorInfo)( https://developer.android.com/reference/androidx/media3/common/DebugViewProvider debugViewProvider, https://developer.android.com/reference/androidx/media3/common/ColorInfo outputColorInfo )` Creates a new instance. |

| ### Public methods |
|---|---|
| `https://developer.android.com/reference/androidx/media3/effect/GlShaderProgram` | `https://developer.android.com/reference/androidx/media3/effect/DebugViewEffect#toGlShaderProgram(android.content.Context,boolean)(https://developer.android.com/reference/android/content/Context.html context, boolean useHdr)` Returns a `https://developer.android.com/reference/androidx/media3/effect/GlShaderProgram` that applies the effect. |

| ### Inherited methods |
|---|
| From [androidx.media3.common.Effect](https://developer.android.com/reference/androidx/media3/common/Effect) |---|---| | `long` | `https://developer.android.com/reference/androidx/media3/common/Effect#getDurationAfterEffectApplied(long)(long durationUs)` Returns the expected duration of the output stream when the effect is applied given a input `durationUs`. | |
| From [androidx.media3.effect.GlEffect](https://developer.android.com/reference/androidx/media3/effect/GlEffect) |---|---| | `boolean` | `https://developer.android.com/reference/androidx/media3/effect/GlEffect#isNoOp(int,int)(int inputWidth, int inputHeight)` Returns whether a `https://developer.android.com/reference/androidx/media3/effect/GlEffect` applies no change at every timestamp. | |

## Public constructors

### DebugViewEffect

```
public DebugViewEffect(
    DebugViewProvider debugViewProvider,
    ColorInfo outputColorInfo
)
```

Creates a new instance.

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/media3/common/DebugViewProvider debugViewProvider` | The class that provides the `https://developer.android.com/reference/android/view/SurfaceView.html` that the debug preview will be rendered to. |
| `https://developer.android.com/reference/androidx/media3/common/ColorInfo outputColorInfo` | The `https://developer.android.com/reference/androidx/media3/common/ColorInfo` of the output preview. |

## Public methods

### toGlShaderProgram

```
public GlShaderProgram toGlShaderProgram(Context context, boolean useHdr)
```

Returns a `https://developer.android.com/reference/androidx/media3/effect/GlShaderProgram` that applies the effect.

| Parameters |
|---|---|
| `https://developer.android.com/reference/android/content/Context.html context` | A `https://developer.android.com/reference/android/content/Context.html`. |
| `boolean useHdr` | Whether input textures come from an HDR source. If `true`, colors will be in linear RGB BT.2020. If `false`, colors will be in linear RGB BT.709. |

| Throws |
|---|---|
| `https://developer.android.com/reference/androidx/media3/common/VideoFrameProcessingException` | If an error occurs while creating the `https://developer.android.com/reference/androidx/media3/effect/GlShaderProgram`. |