# DefaultVideoFrameProcessor.Factory.Builder

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/DefaultVideoFrameProcessor.java+class:androidx.media3.effect.DefaultVideoFrameProcessor.Factory.Builder)

*** ** * ** ***


```
class DefaultVideoFrameProcessor.Factory.Builder
```

<br />

*** ** * ** ***

A builder for `https://developer.android.com/reference/kotlin/androidx/media3/effect/DefaultVideoFrameProcessor.Factory` instances.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/effect/DefaultVideoFrameProcessor.Factory.Builder#Builder()()` Creates an instance. |

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/effect/DefaultVideoFrameProcessor.Factory!` | `https://developer.android.com/reference/kotlin/androidx/media3/effect/DefaultVideoFrameProcessor.Factory.Builder#build()()` Builds an `https://developer.android.com/reference/kotlin/androidx/media3/effect/DefaultVideoFrameProcessor.Factory` instance. |
| `https://developer.android.com/reference/kotlin/androidx/media3/effect/DefaultVideoFrameProcessor.Factory.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/effect/DefaultVideoFrameProcessor.Factory.Builder#setEnableReplayableCache(boolean)(enableReplayableCache: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Sets whether to use a frame cache to `https://developer.android.com/reference/kotlin/androidx/media3/effect/DefaultVideoFrameProcessor#redraw()` frames. |
| `https://developer.android.com/reference/kotlin/androidx/media3/effect/DefaultVideoFrameProcessor.Factory.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/effect/DefaultVideoFrameProcessor.Factory.Builder#setExecutorService(java.util.concurrent.ExecutorService)(executorService: https://developer.android.com/reference/java/util/concurrent/ExecutorService.html?)` Sets the `https://developer.android.com/reference/kotlin/androidx/media3/common/util/Util#newSingleThreadScheduledExecutor(java.lang.String)` to execute GL commands from. |
| `https://developer.android.com/reference/kotlin/androidx/media3/effect/DefaultVideoFrameProcessor.Factory.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html @https://developer.android.com/reference/kotlin/androidx/media3/common/util/ExperimentalApi [setExperimentalAdjustSurfaceTextureTransformationMatrix](https://developer.android.com/reference/kotlin/androidx/media3/effect/DefaultVideoFrameProcessor.Factory.Builder#setExperimentalAdjustSurfaceTextureTransformationMatrix(boolean))( experimentalAdjustSurfaceTextureTransformationMatrix: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html )` **This function is deprecated.** This experimental method will be removed in a future release. <br /> |
| `https://developer.android.com/reference/kotlin/androidx/media3/effect/DefaultVideoFrameProcessor.Factory.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html @https://developer.android.com/reference/kotlin/androidx/media3/common/util/ExperimentalApi [setExperimentalRepeatInputBitmapWithoutResampling](https://developer.android.com/reference/kotlin/androidx/media3/effect/DefaultVideoFrameProcessor.Factory.Builder#setExperimentalRepeatInputBitmapWithoutResampling(boolean))( experimentalRepeatInputBitmapWithoutResampling: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html )` **This function is deprecated.** This experimental method will be removed in a future release. <br /> |
| `https://developer.android.com/reference/kotlin/androidx/media3/effect/DefaultVideoFrameProcessor.Factory.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/effect/DefaultVideoFrameProcessor.Factory.Builder#setGlObjectsProvider(androidx.media3.common.GlObjectsProvider)(glObjectsProvider: https://developer.android.com/reference/kotlin/androidx/media3/common/GlObjectsProvider!)` Sets the `https://developer.android.com/reference/kotlin/androidx/media3/common/GlObjectsProvider`. |
| `https://developer.android.com/reference/kotlin/androidx/media3/effect/DefaultVideoFrameProcessor.Factory.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html [setRequireRegisteringAllInputFrames](https://developer.android.com/reference/kotlin/androidx/media3/effect/DefaultVideoFrameProcessor.Factory.Builder#setRequireRegisteringAllInputFrames(boolean))( requireRegisteringAllInputFrames: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html )` **This function is deprecated.** For automatic frame registration (` setRequireRegisteringAllInputFrames(false)`), use `https://developer.android.com/reference/kotlin/androidx/media3/common/VideoFrameProcessor#INPUT_TYPE_SURFACE_AUTOMATIC_FRAME_REGISTRATION()` instead. <br /> |
| `https://developer.android.com/reference/kotlin/androidx/media3/effect/DefaultVideoFrameProcessor.Factory.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/effect/DefaultVideoFrameProcessor.Factory.Builder#setSdrWorkingColorSpace(int)( @https://developer.android.com/reference/kotlin/androidx/media3/effect/DefaultVideoFrameProcessor.WorkingColorSpace sdrWorkingColorSpace: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` Sets the `https://developer.android.com/reference/kotlin/androidx/media3/effect/DefaultVideoFrameProcessor.WorkingColorSpace` in which frames passed to intermediate effects will be represented. |
| `https://developer.android.com/reference/kotlin/androidx/media3/effect/DefaultVideoFrameProcessor.Factory.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/effect/DefaultVideoFrameProcessor.Factory.Builder#setTextureOutput(androidx.media3.effect.GlTextureProducer.Listener,int)( textureOutputListener: https://developer.android.com/reference/kotlin/androidx/media3/effect/GlTextureProducer.Listener!, textureOutputCapacity: @https://developer.android.com/reference/kotlin/androidx/annotation/IntRange(from = 1) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` Sets texture output settings. |

## Public constructors

### Builder

```
Builder()
```

Creates an instance.

## Public functions

### build

```
fun build(): DefaultVideoFrameProcessor.Factory!
```

Builds an `https://developer.android.com/reference/kotlin/androidx/media3/effect/DefaultVideoFrameProcessor.Factory` instance.

### setEnableReplayableCache

```
@CanIgnoreReturnValue
fun setEnableReplayableCache(enableReplayableCache: Boolean): DefaultVideoFrameProcessor.Factory.Builder!
```

Sets whether to use a frame cache to `https://developer.android.com/reference/kotlin/androidx/media3/effect/DefaultVideoFrameProcessor#redraw()` frames.

The default value is `false`, in this case calling `https://developer.android.com/reference/kotlin/androidx/media3/common/VideoFrameProcessor#redraw()` throws `https://developer.android.com/reference/java/lang/UnsupportedOperationException.html`.

Using a frame cache enables precise redrawing, but increases resource and power usages.

| Parameters |
|---|---|
| `enableReplayableCache: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | Whether to use a frame cache. |

### setExecutorService

```
@CanIgnoreReturnValue
fun setExecutorService(executorService: ExecutorService?): DefaultVideoFrameProcessor.Factory.Builder!
```

Sets the `https://developer.android.com/reference/kotlin/androidx/media3/common/util/Util#newSingleThreadScheduledExecutor(java.lang.String)` to execute GL commands from.

If set to a non-null value, the `https://developer.android.com/reference/java/util/concurrent/ExecutorService.html` must be `https://developer.android.com/reference/java/util/concurrent/ExecutorService.html#shutdown()` by the caller after all `https://developer.android.com/reference/kotlin/androidx/media3/common/VideoFrameProcessor` using it have been `https://developer.android.com/reference/kotlin/androidx/media3/effect/DefaultVideoFrameProcessor#release()`.

The default value is a new `https://developer.android.com/reference/kotlin/androidx/media3/common/util/Util#newSingleThreadScheduledExecutor(java.lang.String)`, owned and `https://developer.android.com/reference/java/util/concurrent/ExecutorService.html#shutdown()` by the created `https://developer.android.com/reference/kotlin/androidx/media3/effect/DefaultVideoFrameProcessor`. Setting a `null``https://developer.android.com/reference/java/util/concurrent/ExecutorService.html` is equivalent to using the default value.

| Parameters |
|---|---|
| `executorService: https://developer.android.com/reference/java/util/concurrent/ExecutorService.html?` | The `https://developer.android.com/reference/java/util/concurrent/ExecutorService.html`. |

### setExperimentalAdjustSurfaceTextureTransformationMatrix

```
@CanIgnoreReturnValue
@ExperimentalApi
fun [setExperimentalAdjustSurfaceTextureTransformationMatrix](https://developer.android.com/reference/kotlin/androidx/media3/effect/DefaultVideoFrameProcessor.Factory.Builder#setExperimentalAdjustSurfaceTextureTransformationMatrix(boolean))(
    experimentalAdjustSurfaceTextureTransformationMatrix: Boolean
): DefaultVideoFrameProcessor.Factory.Builder!
```

> [!CAUTION]
> **This function is deprecated.**   
>
> This experimental method will be removed in a future release.

Sets whether the `https://developer.android.com/reference/android/graphics/SurfaceTexture.html#getTransformMatrix(float[])` is adjusted to remove the scale that cuts off a 1- or 2-texel border around the edge of a crop.

When set, programs sampling GL_TEXTURE_EXTERNAL_OES from `https://developer.android.com/reference/android/graphics/SurfaceTexture.html` must not attempt to access data in any cropped region, including via GL_LINEAR resampling filter.

Defaults to `true`.

### setExperimentalRepeatInputBitmapWithoutResampling

```
@CanIgnoreReturnValue
@ExperimentalApi
fun [setExperimentalRepeatInputBitmapWithoutResampling](https://developer.android.com/reference/kotlin/androidx/media3/effect/DefaultVideoFrameProcessor.Factory.Builder#setExperimentalRepeatInputBitmapWithoutResampling(boolean))(
    experimentalRepeatInputBitmapWithoutResampling: Boolean
): DefaultVideoFrameProcessor.Factory.Builder!
```

> [!CAUTION]
> **This function is deprecated.**   
>
> This experimental method will be removed in a future release.

Sets whether `https://developer.android.com/reference/kotlin/androidx/media3/effect/BitmapTextureManager` will sample from the input bitmap only once for a sequence of output frames.

Defaults to `true`. That is, each output frame will sample from the full resolution input bitmap.

### setGlObjectsProvider

```
@CanIgnoreReturnValue
fun setGlObjectsProvider(glObjectsProvider: GlObjectsProvider!): DefaultVideoFrameProcessor.Factory.Builder!
```

Sets the `https://developer.android.com/reference/kotlin/androidx/media3/common/GlObjectsProvider`.

The default value is a `https://developer.android.com/reference/kotlin/androidx/media3/effect/DefaultGlObjectsProvider`.

If both the `https://developer.android.com/reference/kotlin/androidx/media3/common/GlObjectsProvider` and the `https://developer.android.com/reference/java/util/concurrent/ExecutorService.html` are set, it's the caller's responsibility to release the `https://developer.android.com/reference/kotlin/androidx/media3/common/GlObjectsProvider` on the `https://developer.android.com/reference/java/util/concurrent/ExecutorService.html`'s thread.

### setRequireRegisteringAllInputFrames

```
@CanIgnoreReturnValue
fun [setRequireRegisteringAllInputFrames](https://developer.android.com/reference/kotlin/androidx/media3/effect/DefaultVideoFrameProcessor.Factory.Builder#setRequireRegisteringAllInputFrames(boolean))(
    requireRegisteringAllInputFrames: Boolean
): DefaultVideoFrameProcessor.Factory.Builder!
```

> [!CAUTION]
> **This function is deprecated.**   
>
> For automatic frame registration (`
> setRequireRegisteringAllInputFrames(false)`), use `https://developer.android.com/reference/kotlin/androidx/media3/common/VideoFrameProcessor#INPUT_TYPE_SURFACE_AUTOMATIC_FRAME_REGISTRATION()` instead. This call can be removed otherwise.

Sets whether `https://developer.android.com/reference/kotlin/androidx/media3/common/VideoFrameProcessor#registerInputFrame()` every input frame is required.

The default value is `true`, meaning that all frames input to the `https://developer.android.com/reference/kotlin/androidx/media3/common/VideoFrameProcessor`'s input `https://developer.android.com/reference/kotlin/androidx/media3/effect/DefaultVideoFrameProcessor#getInputSurface()` must be `https://developer.android.com/reference/kotlin/androidx/media3/effect/DefaultVideoFrameProcessor#registerInputFrame()` before they are rendered. In this mode the input format change between input streams is handled frame-exactly. If `false`, `https://developer.android.com/reference/kotlin/androidx/media3/effect/DefaultVideoFrameProcessor#registerInputFrame()` can be called only once for each `https://developer.android.com/reference/kotlin/androidx/media3/effect/DefaultVideoFrameProcessor#registerInputStream(int,androidx.media3.common.Format,java.util.List<androidx.media3.common.Effect>,long)` before rendering the first frame to the input `https://developer.android.com/reference/kotlin/androidx/media3/effect/DefaultVideoFrameProcessor#getInputSurface()`. The same registered `https://developer.android.com/reference/kotlin/androidx/media3/common/Format` is repeated for the subsequent frames. To ensure the format change between input streams is applied on the right frame, the caller needs to `https://developer.android.com/reference/kotlin/androidx/media3/effect/DefaultVideoFrameProcessor#registerInputStream(int,androidx.media3.common.Format,java.util.List<androidx.media3.common.Effect>,long)` the new input stream strictly after rendering all frames from the previous input stream. This mode should be used in streams where users don't have direct control over rendering frames, like in a camera feed.

Regardless of the value set, `https://developer.android.com/reference/kotlin/androidx/media3/effect/DefaultVideoFrameProcessor#registerInputStream(int,androidx.media3.common.Format,java.util.List<androidx.media3.common.Effect>,long)` must be called for each input stream to specify the format for upcoming frames before calling `https://developer.android.com/reference/kotlin/androidx/media3/effect/DefaultVideoFrameProcessor#registerInputFrame()`.

| Parameters |
|---|---|
| `requireRegisteringAllInputFrames: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | Whether registering every input frame is required. |

### setSdrWorkingColorSpace

```
@CanIgnoreReturnValue
fun setSdrWorkingColorSpace(
    @DefaultVideoFrameProcessor.WorkingColorSpace sdrWorkingColorSpace: Int
): DefaultVideoFrameProcessor.Factory.Builder!
```

Sets the `https://developer.android.com/reference/kotlin/androidx/media3/effect/DefaultVideoFrameProcessor.WorkingColorSpace` in which frames passed to intermediate effects will be represented.

The default value is `https://developer.android.com/reference/kotlin/androidx/media3/effect/DefaultVideoFrameProcessor#WORKING_COLOR_SPACE_LINEAR()`.

This setter doesn't affect the working color space for HDR output, since the working color space must have a linear transfer function for HDR output.

### setTextureOutput

```
@CanIgnoreReturnValue
fun setTextureOutput(
    textureOutputListener: GlTextureProducer.Listener!,
    textureOutputCapacity: @IntRange(from = 1) Int
): DefaultVideoFrameProcessor.Factory.Builder!
```

Sets texture output settings.

If set, the `https://developer.android.com/reference/kotlin/androidx/media3/common/VideoFrameProcessor` will output to OpenGL textures, accessible via `https://developer.android.com/reference/kotlin/androidx/media3/effect/GlTextureProducer.Listener#onTextureRendered(androidx.media3.effect.GlTextureProducer,androidx.media3.common.GlTextureInfo,long,long)`. Textures will stop being outputted when the number of output textures available reaches the `textureOutputCapacity`. To regain capacity, output textures must be released using `https://developer.android.com/reference/kotlin/androidx/media3/effect/DefaultVideoFrameProcessor.ReleaseOutputTextureCallback`.

If set, `https://developer.android.com/reference/kotlin/androidx/media3/effect/DefaultVideoFrameProcessor#setOutputSurfaceInfo(androidx.media3.common.SurfaceInfo)` and `https://developer.android.com/reference/kotlin/androidx/media3/effect/DefaultVideoFrameProcessor#renderOutputFrame(long)` will be no-ops, and `renderFramesAutomatically` will behave as if it is set to `true`.

If not set, there will be no texture output.

| Parameters |
|---|---|
| `textureOutputListener: https://developer.android.com/reference/kotlin/androidx/media3/effect/GlTextureProducer.Listener!` | The `https://developer.android.com/reference/kotlin/androidx/media3/effect/GlTextureProducer.Listener`. |
| `textureOutputCapacity: @https://developer.android.com/reference/kotlin/androidx/annotation/IntRange(from = 1) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The amount of output textures that may be allocated at a time before texture output blocks. Must be greater than or equal to 1. |