# DefaultVideoFrameProcessor

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)

*** ** * ** ***

<br />

```
@UnstableApi
public final class DefaultVideoFrameProcessor implements VideoFrameProcessor
```

<br />

*** ** * ** ***

A `https://developer.android.com/reference/androidx/media3/common/VideoFrameProcessor` implementation that applies `https://developer.android.com/reference/androidx/media3/effect/GlEffect` instances using OpenGL on a background thread.

When using surface input (`https://developer.android.com/reference/androidx/media3/common/VideoFrameProcessor#INPUT_TYPE_SURFACE()` or `https://developer.android.com/reference/androidx/media3/common/VideoFrameProcessor#INPUT_TYPE_SURFACE_AUTOMATIC_FRAME_REGISTRATION()`) the surface's format must be supported for sampling as an external texture in OpenGL. When a `https://developer.android.com/reference/android/media/MediaCodec.html` decoder is writing to the input surface, the default SDR color format is supported. When an `https://developer.android.com/reference/android/media/ImageWriter.html` is writing to the input surface, `https://developer.android.com/reference/android/graphics/PixelFormat.html#RGBA_8888` is supported for SDR data. Support for other formats may be device-dependent.

## Summary

| ### Nested types |
|---|
| `public final class https://developer.android.com/reference/androidx/media3/effect/DefaultVideoFrameProcessor.Factory implements https://developer.android.com/reference/androidx/media3/common/VideoFrameProcessor.Factory` A factory for `https://developer.android.com/reference/androidx/media3/effect/DefaultVideoFrameProcessor` instances. |
| `public final class https://developer.android.com/reference/androidx/media3/effect/DefaultVideoFrameProcessor.Factory.Builder` A builder for `https://developer.android.com/reference/androidx/media3/effect/DefaultVideoFrameProcessor.Factory` instances. |
| `public interface https://developer.android.com/reference/androidx/media3/effect/DefaultVideoFrameProcessor.ReleaseOutputTextureCallback` Releases the output information stored for textures before and at `presentationTimeUs`. |
| `@https://developer.android.com/reference/java/lang/annotation/Documented.html @https://developer.android.com/reference/java/lang/annotation/Retention.html(value = https://developer.android.com/reference/java/lang/annotation/RetentionPolicy.html#SOURCE) @https://developer.android.com/reference/java/lang/annotation/Target.html(value = https://developer.android.com/reference/java/lang/annotation/ElementType.html#TYPE_USE) @https://developer.android.com/reference/androidx/annotation/IntDef(value = ) public annotation https://developer.android.com/reference/androidx/media3/effect/DefaultVideoFrameProcessor.WorkingColorSpace` Specifies the color space that frames passed to intermediate `https://developer.android.com/reference/androidx/media3/effect/GlShaderProgram`s will be represented in. |

| ### Constants |
|---|---|
| `static final int` | `https://developer.android.com/reference/androidx/media3/effect/DefaultVideoFrameProcessor#WORKING_COLOR_SPACE_DEFAULT() = 0` For SDR content, uses the input color space as the working color space if the color transfer is `https://developer.android.com/reference/androidx/media3/common/C#COLOR_TRANSFER_SRGB()` or `https://developer.android.com/reference/androidx/media3/common/C#COLOR_TRANSFER_SDR()`. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/effect/DefaultVideoFrameProcessor#WORKING_COLOR_SPACE_LINEAR() = 2` The working color space will have the same primaries as the input and a linear transfer function. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/effect/DefaultVideoFrameProcessor#WORKING_COLOR_SPACE_ORIGINAL() = 1` Use the original color space of the input as the working color space when the input is SDR. |

| ### Public methods |
|---|---|
| `void` | `https://developer.android.com/reference/androidx/media3/effect/DefaultVideoFrameProcessor#flush()()` Flushes the VideoFrameProcessor}. |
| `https://developer.android.com/reference/android/view/Surface.html` | `https://developer.android.com/reference/androidx/media3/effect/DefaultVideoFrameProcessor#getInputSurface()()` Returns the input `https://developer.android.com/reference/android/view/Surface.html`, where `https://developer.android.com/reference/androidx/media3/common/VideoFrameProcessor` consumes input frames from. |
| `int` | `https://developer.android.com/reference/androidx/media3/effect/DefaultVideoFrameProcessor#getPendingInputFrameCount()()` Returns the number of input frames that have been made available to the ` VideoFrameProcessor` but have not been processed yet. |
| `boolean` | `https://developer.android.com/reference/androidx/media3/effect/DefaultVideoFrameProcessor#queueInputBitmap(android.graphics.Bitmap,androidx.media3.common.util.TimestampIterator)( https://developer.android.com/reference/android/graphics/Bitmap.html inputBitmap, https://developer.android.com/reference/androidx/media3/common/util/TimestampIterator timestampIterator )` Provides an input to the . |
| `boolean` | `https://developer.android.com/reference/androidx/media3/effect/DefaultVideoFrameProcessor#queueInputTexture(int,long)(int textureId, long presentationTimeUs)` Provides an input texture ID to the `VideoFrameProcessor`. |
| `void` | `https://developer.android.com/reference/androidx/media3/effect/DefaultVideoFrameProcessor#redraw()()` Updates an Listener#onOutputFrameAvailableForRendering available frame with the modified effects. |
| `boolean` | `https://developer.android.com/reference/androidx/media3/effect/DefaultVideoFrameProcessor#registerInputFrame()()` Informs the `VideoFrameProcessor` that a frame will be queued to its `https://developer.android.com/reference/androidx/media3/common/VideoFrameProcessor#getInputSurface()`. |
| `void` | `https://developer.android.com/reference/androidx/media3/effect/DefaultVideoFrameProcessor#registerInputStream(int,androidx.media3.common.Format,java.util.List<androidx.media3.common.Effect>,long)( @https://developer.android.com/reference/androidx/media3/common/VideoFrameProcessor.InputType int inputType, https://developer.android.com/reference/androidx/media3/common/Format format, https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/androidx/media3/common/Effect> effects, long offsetToAddUs )` Informs the VideoFrameProcessor} that a new input stream will be queued with the list of Effects to apply to the new input stream. |
| `void` | `https://developer.android.com/reference/androidx/media3/effect/DefaultVideoFrameProcessor#release()()` Releases all resources. |
| `void` | `https://developer.android.com/reference/androidx/media3/effect/DefaultVideoFrameProcessor#renderOutputFrame(long)(long renderTimeNs)` Renders the oldest unrendered output frame that has become \* Listener#onOutputFrameAvailableForRendering(long, boolean) available for rendering at the given renderTimeNs}. |
| `void` | `[setInputDefaultBufferSize](https://developer.android.com/reference/androidx/media3/effect/DefaultVideoFrameProcessor#setInputDefaultBufferSize(int,int))(int width, int height)` **This method is deprecated.** Set the input type to `https://developer.android.com/reference/androidx/media3/common/VideoFrameProcessor#INPUT_TYPE_SURFACE_AUTOMATIC_FRAME_REGISTRATION()` instead, which sets the default buffer size automatically based on the registered frame info. <br /> |
| `void` | `https://developer.android.com/reference/androidx/media3/effect/DefaultVideoFrameProcessor#setOnInputFrameProcessedListener(androidx.media3.common.OnInputFrameProcessedListener)( https://developer.android.com/reference/androidx/media3/common/OnInputFrameProcessedListener listener )` Sets the `https://developer.android.com/reference/androidx/media3/common/OnInputFrameProcessedListener`. |
| `void` | `https://developer.android.com/reference/androidx/media3/effect/DefaultVideoFrameProcessor#setOnInputSurfaceReadyListener(java.lang.Runnable)(https://developer.android.com/reference/java/lang/Runnable.html listener)` Sets a listener that's called when the `https://developer.android.com/reference/androidx/media3/common/VideoFrameProcessor#getInputSurface()` is ready to use. |
| `void` | `https://developer.android.com/reference/androidx/media3/effect/DefaultVideoFrameProcessor#setOutputSurfaceInfo(androidx.media3.common.SurfaceInfo)(@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/common/SurfaceInfo outputSurfaceInfo)` Sets the output surface and supporting information. |
| `void` | `https://developer.android.com/reference/androidx/media3/effect/DefaultVideoFrameProcessor#signalEndOfInput()()` Informs the `VideoFrameProcessor` that no further input frames should be accepted. |

### Inherited Constants

From [androidx.media3.common.VideoFrameProcessor](https://developer.android.com/reference/androidx/media3/common/VideoFrameProcessor) `static final long` `https://developer.android.com/reference/androidx/media3/common/VideoFrameProcessor#DROP_OUTPUT_FRAME() = -2`

Indicates the frame should be dropped after `https://developer.android.com/reference/androidx/media3/common/VideoFrameProcessor#renderOutputFrame(long)` is invoked.
`static final int` `https://developer.android.com/reference/androidx/media3/common/VideoFrameProcessor#INPUT_TYPE_BITMAP() = 2`

Input frames come from a `https://developer.android.com/reference/android/graphics/Bitmap.html`.
`static final int` `https://developer.android.com/reference/androidx/media3/common/VideoFrameProcessor#INPUT_TYPE_SURFACE() = 1`

Input frames come from a `https://developer.android.com/reference/androidx/media3/common/VideoFrameProcessor#getInputSurface()`.
`static final int` `https://developer.android.com/reference/androidx/media3/common/VideoFrameProcessor#INPUT_TYPE_SURFACE_AUTOMATIC_FRAME_REGISTRATION() = 4`

Input frames come from the `https://developer.android.com/reference/androidx/media3/common/VideoFrameProcessor#getInputSurface()` and don't need to be `https://developer.android.com/reference/androidx/media3/common/VideoFrameProcessor#registerInputFrame()` (unlike with `https://developer.android.com/reference/androidx/media3/common/VideoFrameProcessor#INPUT_TYPE_SURFACE()`).
`static final int` `https://developer.android.com/reference/androidx/media3/common/VideoFrameProcessor#INPUT_TYPE_TEXTURE_ID() = 3`

Input frames come from a `https://developer.android.com/reference/android/opengl/GLES10.html#GL_TEXTURE_2D`.
`static final https://guava.dev/releases/snapshot-android/api/docs/com/google/common/collect/ImmutableList.html<https://developer.android.com/reference/androidx/media3/common/Effect>` `https://developer.android.com/reference/androidx/media3/common/VideoFrameProcessor#REDRAW()`

A marker for passing to `https://developer.android.com/reference/androidx/media3/common/VideoFrameProcessor#registerInputStream(int,androidx.media3.common.Format,java.util.List<androidx.media3.common.Effect>,long)` to signal a redraw.
`static final long` `https://developer.android.com/reference/androidx/media3/common/VideoFrameProcessor#RENDER_OUTPUT_FRAME_IMMEDIATELY() = -1`

**This field is deprecated.**

Pass `https://developer.android.com/reference/androidx/media3/common/util/SystemClock#nanoTime()` to `https://developer.android.com/reference/androidx/media3/common/VideoFrameProcessor#renderOutputFrame(long)` to render an output frame immediately.

<br />

`static final long` `https://developer.android.com/reference/androidx/media3/common/VideoFrameProcessor#RENDER_OUTPUT_FRAME_WITH_PRESENTATION_TIME() = -3`

Indicates the frame should preserve the input presentation time when `https://developer.android.com/reference/androidx/media3/common/VideoFrameProcessor#renderOutputFrame(long)` is invoked.

## Constants

### WORKING_COLOR_SPACE_DEFAULT

```
public static final int WORKING_COLOR_SPACE_DEFAULT = 0
```

For SDR content, uses the input color space as the working color space if the color transfer is `https://developer.android.com/reference/androidx/media3/common/C#COLOR_TRANSFER_SRGB()` or `https://developer.android.com/reference/androidx/media3/common/C#COLOR_TRANSFER_SDR()`. No conversions are applied between sRGB and SMPTE 170M, reflecting Android platform behavior where these are treated as equivalent.

### WORKING_COLOR_SPACE_LINEAR

```
public static final int WORKING_COLOR_SPACE_LINEAR = 2
```

The working color space will have the same primaries as the input and a linear transfer function.

This option is not recommended for SDR content since it may lead to color banding since 8-bit colors are used in SDR processing. It may also cause effects that modify a frame's output colors (for example `https://developer.android.com/reference/androidx/media3/effect/OverlayEffect`) to have incorrect output colors.

### WORKING_COLOR_SPACE_ORIGINAL

```
public static final int WORKING_COLOR_SPACE_ORIGINAL = 1
```

Use the original color space of the input as the working color space when the input is SDR.

Tonemapped HDR content will be represented with BT709 color primaries and the standard SDR transfer function (SMPTE 170m).

No color transfers will be applied when the input is SDR.

## Public methods

### flush

```
public void flush()
```

Flushes the VideoFrameProcessor}.

All the frames that are #registerInputFrame() registered prior to calling this method are no longer considered to be registered when this method returns.

methods invoked prior to calling this method should be ignored.

The downstream frame consumer must be flushed before this instance is flushed, and stop accepting input until this DefaultVideoFrameProcessor instance finishes flushing.

After this method is called, any object consuming `https://developer.android.com/reference/androidx/media3/effect/DefaultVideoFrameProcessor.Factory.Builder#setTextureOutput(androidx.media3.effect.GlTextureProducer.Listener,int)` must not access any output textures that were `https://developer.android.com/reference/androidx/media3/effect/GlTextureProducer.Listener#onTextureRendered(androidx.media3.effect.GlTextureProducer,androidx.media3.common.GlTextureInfo,long,long)` before calling this method.

### getInputSurface

```
public Surface getInputSurface()
```

Returns the input `https://developer.android.com/reference/android/view/Surface.html`, where `https://developer.android.com/reference/androidx/media3/common/VideoFrameProcessor` consumes input frames from.

The frames arriving on the `https://developer.android.com/reference/android/view/Surface.html` will not be consumed by the ` VideoFrameProcessor` until `https://developer.android.com/reference/androidx/media3/common/VideoFrameProcessor#registerInputStream(int,androidx.media3.common.Format,java.util.List<androidx.media3.common.Effect>,long)` is called with `https://developer.android.com/reference/androidx/media3/common/VideoFrameProcessor#INPUT_TYPE_SURFACE()`.

For streams with `https://developer.android.com/reference/androidx/media3/common/VideoFrameProcessor#INPUT_TYPE_SURFACE()`, the returned surface is ready to use immediately and will not have a `https://developer.android.com/reference/android/graphics/SurfaceTexture.html#setDefaultBufferSize(int, int)` set on it. This is suitable for configuring a `https://developer.android.com/reference/android/media/MediaCodec.html` decoder.

For streams with `https://developer.android.com/reference/androidx/media3/common/VideoFrameProcessor#INPUT_TYPE_SURFACE_AUTOMATIC_FRAME_REGISTRATION()`, set a listener for the surface becoming ready via `https://developer.android.com/reference/androidx/media3/common/VideoFrameProcessor#setOnInputSurfaceReadyListener(java.lang.Runnable)` and wait for the event before using the returned surface. This is suitable for use with non-decoder producers like media projection.

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/UnsupportedOperationException.html` | If the `VideoFrameProcessor` does not accept `https://developer.android.com/reference/androidx/media3/common/VideoFrameProcessor#INPUT_TYPE_SURFACE()`. |

### getPendingInputFrameCount

```
public int getPendingInputFrameCount()
```

Returns the number of input frames that have been made available to the ` VideoFrameProcessor` but have not been processed yet.

### queueInputBitmap

```
public boolean queueInputBitmap(
    Bitmap inputBitmap,
    TimestampIterator timestampIterator
)
```

Provides an input to the .

Can be called many times after #registerInputStream registering the input stream to put multiple frames in the same input stream.

An implementation could Bitmap#recycle the passed in , so it may not be suitable for reuse.

The passed in `https://developer.android.com/reference/android/graphics/Bitmap.html` argument cannot be reused after this method returns ` true`, as it will be `https://developer.android.com/reference/android/graphics/Bitmap.html#recycle()` by the processing pipeline.

### queueInputTexture

```
public boolean queueInputTexture(int textureId, long presentationTimeUs)
```

Provides an input texture ID to the `VideoFrameProcessor`.

It must be only called after `https://developer.android.com/reference/androidx/media3/common/VideoFrameProcessor#setOnInputFrameProcessedListener(androidx.media3.common.OnInputFrameProcessedListener)` and `https://developer.android.com/reference/androidx/media3/common/VideoFrameProcessor#registerInputStream(int,androidx.media3.common.Format,java.util.List<androidx.media3.common.Effect>,long)` have been called.

| Parameters |
|---|---|
| `int textureId` | The ID of the texture queued to the `VideoFrameProcessor`. |
| `long presentationTimeUs` | The presentation time of the queued texture, in microseconds. |

| Returns |
|---|---|
| `boolean` | Whether the texture was successfully queued. A return value of `false` indicates the `VideoFrameProcessor` is not ready to accept input. |

### redraw

```
public void redraw()
```

Updates an Listener#onOutputFrameAvailableForRendering available frame with the modified effects.

This method can be called from any thread.

`DefaultVideoFrameProcessor` keeps track of the redraw requests received. If a call to redraw is made when another redraw request is ongoing, the new request will be performed later when the ongoing redraw completes, and this method will return immediately.

### registerInputFrame

```
public boolean registerInputFrame()
```

Informs the `VideoFrameProcessor` that a frame will be queued to its `https://developer.android.com/reference/androidx/media3/common/VideoFrameProcessor#getInputSurface()`.

Must be called before rendering a frame to the input surface. The caller must not render frames to the `https://developer.android.com/reference/androidx/media3/common/VideoFrameProcessor#getInputSurface()` when `false` is returned.

| Returns |
|---|---|
| `boolean` | Whether the input frame was successfully registered. If `https://developer.android.com/reference/androidx/media3/common/VideoFrameProcessor#registerInputStream(int,androidx.media3.common.Format,java.util.List<androidx.media3.common.Effect>,long)` is called, this method returns `false` until `https://developer.android.com/reference/androidx/media3/common/VideoFrameProcessor.Listener#onInputStreamRegistered(int,androidx.media3.common.Format,java.util.List<androidx.media3.common.Effect>)` is called. Otherwise, a return value of `false` indicates the `VideoFrameProcessor` is not ready to accept input. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/UnsupportedOperationException.html` | If the `VideoFrameProcessor` does not accept `https://developer.android.com/reference/androidx/media3/common/VideoFrameProcessor#INPUT_TYPE_SURFACE()`. |
| `https://developer.android.com/reference/java/lang/IllegalStateException.html` | If called after `https://developer.android.com/reference/androidx/media3/common/VideoFrameProcessor#signalEndOfInput()` or before `https://developer.android.com/reference/androidx/media3/common/VideoFrameProcessor#registerInputStream(int,androidx.media3.common.Format,java.util.List<androidx.media3.common.Effect>,long)`. |

### registerInputStream

```
public void registerInputStream(
    @VideoFrameProcessor.InputType int inputType,
    Format format,
    List<Effect> effects,
    long offsetToAddUs
)
```

Informs the VideoFrameProcessor} that a new input stream will be queued with the list of Effects to apply to the new input stream.

After registering the first input stream, this method must only be called after the last frame of the already-registered input stream has been #registerInputFrame registered, last bitmap #queueInputBitmap queued or last texture id \* #queueInputTexture queued.

This method blocks the calling thread until the previous calls to this method finish, that is when Listener#onInputStreamRegistered(int, Format, List) is called after the underlying processing pipeline has been adapted to the registered input stream.

Using HDR `https://developer.android.com/reference/androidx/media3/common/Format#colorInfo()` requires OpenGL ES 3.0 and the `EXT_YUV_target` OpenGL extension.

`https://developer.android.com/reference/androidx/media3/common/Effect`s are applied on `https://developer.android.com/reference/androidx/media3/common/C#COLOR_RANGE_FULL()` colors with `null``https://developer.android.com/reference/androidx/media3/common/ColorInfo#hdrStaticInfo()`.

If either `https://developer.android.com/reference/androidx/media3/common/Format#colorInfo()` or `outputColorInfo``https://developer.android.com/reference/androidx/media3/common/ColorInfo#isTransferHdr(androidx.media3.common.ColorInfo)` are HDR}, textures will use `https://developer.android.com/reference/android/opengl/GLES30.html#GL_RGBA16F` and `https://developer.android.com/reference/android/opengl/GLES30.html#GL_HALF_FLOAT`. Otherwise, textures will use `https://developer.android.com/reference/android/opengl/GLES20.html#GL_RGBA` and `https://developer.android.com/reference/android/opengl/GLES20.html#GL_UNSIGNED_BYTE`.

If `https://developer.android.com/reference/androidx/media3/common/Format#colorInfo()``https://developer.android.com/reference/androidx/media3/common/ColorInfo#isTransferHdr(androidx.media3.common.ColorInfo)`, but `outputColorInfo` is SDR, then HDR to SDR tone-mapping is applied, and ` outputColorInfo`'s `https://developer.android.com/reference/androidx/media3/common/ColorInfo#colorTransfer()` must be `https://developer.android.com/reference/androidx/media3/common/C#COLOR_TRANSFER_GAMMA_2_2()` or `https://developer.android.com/reference/androidx/media3/common/C#COLOR_TRANSFER_SDR()`. In this case, the actual output transfer function will be in `https://developer.android.com/reference/androidx/media3/common/C#COLOR_TRANSFER_GAMMA_2_2()`, for consistency with other tone-mapping and color behavior in the Android ecosystem (for example, MediaFormat's COLOR_TRANSFER_SDR_VIDEO is defined as SMPTE 170M, but most OEMs process it as Gamma 2.2).

### release

```
public void release()
```

Releases all resources.

If the `VideoFrameProcessor` is released before it has `https://developer.android.com/reference/androidx/media3/common/VideoFrameProcessor.Listener#onEnded()`, it will attempt to cancel processing any input frames that have already become available. Input frames that become available after release are ignored.

This method blocks until all resources are released or releasing times out.

This `https://developer.android.com/reference/androidx/media3/common/VideoFrameProcessor` instance must not be used after this method is called.

### renderOutputFrame

```
public void renderOutputFrame(long renderTimeNs)
```

Renders the oldest unrendered output frame that has become \* Listener#onOutputFrameAvailableForRendering(long, boolean) available for rendering at the given renderTimeNs}.

This will either render the output frame to the #setOutputSurfaceInfo output surface, or drop the frame, per renderTimeNs}.

This method must only be called if renderFramesAutomatically} was set to \*false using the and should be called exactly once for each frame that becomes Listener#onOutputFrameAvailableForRendering(long, boolean) available for rendering.

The renderTimeNs} may be passed to EGLExt#eglPresentationTimeANDROID depending on the implementation.

If `https://developer.android.com/reference/androidx/media3/effect/DefaultVideoFrameProcessor.Factory.Builder#setTextureOutput(androidx.media3.effect.GlTextureProducer.Listener,int)` is set, calling this method will be a no-op.

### setInputDefaultBufferSize

```
public void [setInputDefaultBufferSize](https://developer.android.com/reference/androidx/media3/effect/DefaultVideoFrameProcessor#setInputDefaultBufferSize(int,int))(int width, int height)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Set the input type to `https://developer.android.com/reference/androidx/media3/common/VideoFrameProcessor#INPUT_TYPE_SURFACE_AUTOMATIC_FRAME_REGISTRATION()` instead, which sets the default buffer size automatically based on the registered frame info.

Sets the default size for input buffers, for the case where the producer providing input does not override the buffer size.

When input comes from a media codec it's not necessary to call this method because the codec (producer) sets the buffer size automatically. For the case where input comes from CameraX, call this method after instantiation to ensure that buffers are handled at full resolution. See `https://developer.android.com/reference/android/graphics/SurfaceTexture.html#setDefaultBufferSize(int, int)` for more information.

This method must only be called when the `https://developer.android.com/reference/androidx/media3/common/VideoFrameProcessor` is `https://developer.android.com/reference/androidx/media3/common/VideoFrameProcessor.Factory#create(android.content.Context,androidx.media3.common.DebugViewProvider,androidx.media3.common.ColorInfo,boolean,java.util.concurrent.Executor,androidx.media3.common.VideoFrameProcessor.Listener)` with `https://developer.android.com/reference/androidx/media3/common/VideoFrameProcessor#INPUT_TYPE_SURFACE()`.

| Parameters |
|---|---|
| `int width` | The default width for input buffers, in pixels. |
| `int height` | The default height for input buffers, in pixels. |

### setOnInputFrameProcessedListener

```
public void setOnInputFrameProcessedListener(
    OnInputFrameProcessedListener listener
)
```

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

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/media3/common/OnInputFrameProcessedListener listener` | The `https://developer.android.com/reference/androidx/media3/common/OnInputFrameProcessedListener`. |

### setOnInputSurfaceReadyListener

```
public void setOnInputSurfaceReadyListener(Runnable listener)
```

Sets a listener that's called when the `https://developer.android.com/reference/androidx/media3/common/VideoFrameProcessor#getInputSurface()` is ready to use.

### setOutputSurfaceInfo

```
public void setOutputSurfaceInfo(@Nullable SurfaceInfo outputSurfaceInfo)
```

Sets the output surface and supporting information. When output frames are rendered and not dropped, they will be rendered to this output .

The new output is applied from the next output frame rendered onwards. If the output is null}, the VideoFrameProcessor} will stop rendering pending frames and resume rendering once a non-null is set.

If the dimensions given in do not match the \* Listener#onOutputSizeChanged(int,int) output size after applying the final effect the frames are resized before rendering to the surface and letter/pillar-boxing is applied.

The caller is responsible for tracking the lifecycle of the SurfaceInfo#surface including calling this method with a new surface if it is destroyed. When this method returns, the previous output surface is no longer being used and can safely be released by the caller.

If `https://developer.android.com/reference/androidx/media3/effect/DefaultVideoFrameProcessor.Factory.Builder#setTextureOutput(androidx.media3.effect.GlTextureProducer.Listener,int)` is set, calling this method will be a no-op.

### signalEndOfInput

```
public void signalEndOfInput()
```

Informs the `VideoFrameProcessor` that no further input frames should be accepted.

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException.html` | If called more than once. |