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

*** ** * ** ***


```
public final class DefaultVideoFrameProcessor.Factory.Builder
```

<br />

*** ** * ** ***

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

## Summary

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

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

## Public constructors

### Builder

```
public Builder()
```

Creates an instance.

## Public methods

### build

```
public DefaultVideoFrameProcessor.Factory build()
```

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

### setEnableReplayableCache

```
@CanIgnoreReturnValue
public DefaultVideoFrameProcessor.Factory.Builder setEnableReplayableCache(boolean enableReplayableCache)
```

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

The default value is `false`, in this case calling `https://developer.android.com/reference/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 |
|---|---|
| `boolean enableReplayableCache` | Whether to use a frame cache. |

### setExecutorService

```
@CanIgnoreReturnValue
public DefaultVideoFrameProcessor.Factory.Builder setExecutorService(@Nullable ExecutorService executorService)
```

Sets the `https://developer.android.com/reference/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/androidx/media3/common/VideoFrameProcessor` using it have been `https://developer.android.com/reference/androidx/media3/effect/DefaultVideoFrameProcessor#release()`.

The default value is a new `https://developer.android.com/reference/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/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 |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/java/util/concurrent/ExecutorService.html executorService` | The `https://developer.android.com/reference/java/util/concurrent/ExecutorService.html`. |

### setExperimentalAdjustSurfaceTextureTransformationMatrix

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

> [!CAUTION]
> **This method 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
public DefaultVideoFrameProcessor.Factory.Builder [setExperimentalRepeatInputBitmapWithoutResampling](https://developer.android.com/reference/androidx/media3/effect/DefaultVideoFrameProcessor.Factory.Builder#setExperimentalRepeatInputBitmapWithoutResampling(boolean))(
    boolean experimentalRepeatInputBitmapWithoutResampling
)
```

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

Sets whether `https://developer.android.com/reference/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
public DefaultVideoFrameProcessor.Factory.Builder setGlObjectsProvider(GlObjectsProvider glObjectsProvider)
```

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

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

If both the `https://developer.android.com/reference/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/androidx/media3/common/GlObjectsProvider` on the `https://developer.android.com/reference/java/util/concurrent/ExecutorService.html`'s thread.

### setRequireRegisteringAllInputFrames

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

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

Sets whether `https://developer.android.com/reference/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/androidx/media3/common/VideoFrameProcessor`'s input `https://developer.android.com/reference/androidx/media3/effect/DefaultVideoFrameProcessor#getInputSurface()` must be `https://developer.android.com/reference/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/androidx/media3/effect/DefaultVideoFrameProcessor#registerInputFrame()` can be called only once for each `https://developer.android.com/reference/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/androidx/media3/effect/DefaultVideoFrameProcessor#getInputSurface()`. The same registered `https://developer.android.com/reference/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/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/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/androidx/media3/effect/DefaultVideoFrameProcessor#registerInputFrame()`.

| Parameters |
|---|---|
| `boolean requireRegisteringAllInputFrames` | Whether registering every input frame is required. |

### setSdrWorkingColorSpace

```
@CanIgnoreReturnValue
public DefaultVideoFrameProcessor.Factory.Builder setSdrWorkingColorSpace(
    @DefaultVideoFrameProcessor.WorkingColorSpace int sdrWorkingColorSpace
)
```

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

The default value is `https://developer.android.com/reference/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
public DefaultVideoFrameProcessor.Factory.Builder setTextureOutput(
    GlTextureProducer.Listener textureOutputListener,
    @IntRange(from = 1) int textureOutputCapacity
)
```

Sets texture output settings.

If set, the `https://developer.android.com/reference/androidx/media3/common/VideoFrameProcessor` will output to OpenGL textures, accessible via `https://developer.android.com/reference/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/androidx/media3/effect/DefaultVideoFrameProcessor.ReleaseOutputTextureCallback`.

If set, `https://developer.android.com/reference/androidx/media3/effect/DefaultVideoFrameProcessor#setOutputSurfaceInfo(androidx.media3.common.SurfaceInfo)` and `https://developer.android.com/reference/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 |
|---|---|
| `https://developer.android.com/reference/androidx/media3/effect/GlTextureProducer.Listener textureOutputListener` | The `https://developer.android.com/reference/androidx/media3/effect/GlTextureProducer.Listener`. |
| `@https://developer.android.com/reference/androidx/annotation/IntRange(from = 1) int textureOutputCapacity` | The amount of output textures that may be allocated at a time before texture output blocks. Must be greater than or equal to 1. |