# CapturingFrameProcessor.Factory

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/CapturingFrameProcessor.java+class:androidx.media3.test.utils.CapturingFrameProcessor.Factory)

*** ** * ** ***


```
public class CapturingFrameProcessor.Factory implements FrameProcessor.Factory
```

<br />

*** ** * ** ***

A factory for `https://developer.android.com/reference/androidx/media3/test/utils/CapturingFrameProcessor` instances.

## Summary

| ### Public fields |
|---|---|
| `volatile @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/test/utils/CapturingFrameProcessor` | `https://developer.android.com/reference/androidx/media3/test/utils/CapturingFrameProcessor.Factory#createdProcessor()` |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/media3/test/utils/CapturingFrameProcessor.Factory#Factory(androidx.media3.common.video.FrameProcessor.Factory)(https://developer.android.com/reference/androidx/media3/common/video/FrameProcessor.Factory underlyingFactory)` Creates a new instance. |
| `https://developer.android.com/reference/androidx/media3/test/utils/CapturingFrameProcessor.Factory#Factory(androidx.media3.common.video.FrameProcessor.Factory,java.util.function.Consumer<java.util.List<androidx.media3.common.video.AsyncFrame>>)( https://developer.android.com/reference/androidx/media3/common/video/FrameProcessor.Factory underlyingFactory, @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/java/util/function/Consumer.html<https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/androidx/media3/common/video/AsyncFrame>> onQueueListener )` Creates a new instance. |

| ### Public methods |
|---|---|
| `https://developer.android.com/reference/androidx/media3/test/utils/CapturingFrameProcessor` | `https://developer.android.com/reference/androidx/media3/test/utils/CapturingFrameProcessor.Factory#create(androidx.media3.common.video.FrameWriter,java.util.concurrent.Executor,androidx.media3.common.video.FrameProcessor.Listener)( https://developer.android.com/reference/androidx/media3/common/video/FrameWriter output, https://developer.android.com/reference/java/util/concurrent/Executor.html listenerExecutor, https://developer.android.com/reference/androidx/media3/common/video/FrameProcessor.Listener listener )` Creates a `https://developer.android.com/reference/androidx/media3/common/video/FrameProcessor` that sends frames to the given `https://developer.android.com/reference/androidx/media3/common/video/FrameWriter`. |
| `@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/test/utils/CapturingFrameProcessor` | `https://developer.android.com/reference/androidx/media3/test/utils/CapturingFrameProcessor.Factory#getCreatedProcessor()()` Returns the created `https://developer.android.com/reference/androidx/media3/test/utils/CapturingFrameProcessor` instance. |

## Public fields

### createdProcessor

```
volatile public @Nullable CapturingFrameProcessor createdProcessor
```

## Public constructors

### Factory

```
public Factory(FrameProcessor.Factory underlyingFactory)
```

Creates a new instance.

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/media3/common/video/FrameProcessor.Factory underlyingFactory` | The factory that creates the underlying `https://developer.android.com/reference/androidx/media3/common/video/FrameProcessor`. |

### Factory

```
public Factory(
    FrameProcessor.Factory underlyingFactory,
    @Nullable Consumer<List<AsyncFrame>> onQueueListener
)
```

Creates a new instance.

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/media3/common/video/FrameProcessor.Factory underlyingFactory` | The factory that creates the underlying `https://developer.android.com/reference/androidx/media3/common/video/FrameProcessor`. |
| `@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/java/util/function/Consumer.html<https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/androidx/media3/common/video/AsyncFrame>> onQueueListener` | A listener that is invoked after each successful `https://developer.android.com/reference/androidx/media3/test/utils/CapturingFrameProcessor#queue(java.util.List<androidx.media3.common.video.AsyncFrame>)` call. |

## Public methods

### create

```
public CapturingFrameProcessor create(
    FrameWriter output,
    Executor listenerExecutor,
    FrameProcessor.Listener listener
)
```

Creates a `https://developer.android.com/reference/androidx/media3/common/video/FrameProcessor` that sends frames to the given `https://developer.android.com/reference/androidx/media3/common/video/FrameWriter`.

The created `https://developer.android.com/reference/androidx/media3/common/video/FrameProcessor` does not `https://developer.android.com/reference/androidx/media3/common/video/FrameWriter#close()` the passed in `https://developer.android.com/reference/androidx/media3/common/video/FrameWriter`.

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/media3/common/video/FrameWriter output` | The `https://developer.android.com/reference/androidx/media3/common/video/FrameWriter` to which the `https://developer.android.com/reference/androidx/media3/common/video/FrameProcessor` outputs. |
| `https://developer.android.com/reference/java/util/concurrent/Executor.html listenerExecutor` | The `https://developer.android.com/reference/java/util/concurrent/Executor.html` on which the `listener` is invoked. |
| `https://developer.android.com/reference/androidx/media3/common/video/FrameProcessor.Listener listener` | A `https://developer.android.com/reference/androidx/media3/common/video/FrameProcessor.Listener` to be invoked for `https://developer.android.com/reference/androidx/media3/common/video/FrameProcessor` events. |

### getCreatedProcessor

```
public @Nullable CapturingFrameProcessor getCreatedProcessor()
```

Returns the created `https://developer.android.com/reference/androidx/media3/test/utils/CapturingFrameProcessor` instance.