# FakeFrameProcessor

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

*** ** * ** ***


```
@ExperimentalApi
class FakeFrameProcessor : FrameProcessor
```

<br />

*** ** * ** ***

A fake `https://developer.android.com/reference/kotlin/androidx/media3/common/video/FrameProcessor` implementation.

## Summary

| ### Nested types |
|---|
| `class https://developer.android.com/reference/kotlin/androidx/media3/test/utils/FakeFrameProcessor.Factory : https://developer.android.com/reference/kotlin/androidx/media3/common/video/FrameProcessor.Factory` A factory for `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/FakeFrameProcessor` implementations. |
| `class https://developer.android.com/reference/kotlin/androidx/media3/test/utils/FakeFrameProcessor.Listener : https://developer.android.com/reference/kotlin/androidx/media3/common/video/FrameProcessor.Listener` A fake `https://developer.android.com/reference/kotlin/androidx/media3/common/video/FrameProcessor.Listener` implementation for tests. |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/FakeFrameProcessor#close()()` Blocks until all resources are released. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/FakeFrameProcessor#queue(java.util.List<androidx.media3.common.video.AsyncFrame>)(frames: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/media3/common/video/AsyncFrame!>!)` Attempts to queue a `https://developer.android.com/reference/java/util/List.html` of `https://developer.android.com/reference/kotlin/androidx/media3/common/video/AsyncFrame` for processing. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/FakeFrameProcessor#signalEndOfStream()()` Notifies this processor that the current stream has ended. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/FakeFrameProcessor#triggerError(androidx.media3.common.VideoFrameProcessingException)(exception: https://developer.android.com/reference/kotlin/androidx/media3/common/VideoFrameProcessingException!)` Simulates a video frame processing error by notifying the listener. |

| ### Public properties |
|---|---|
| `https://developer.android.com/reference/java/util/concurrent/atomic/AtomicBoolean.html!` | `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/FakeFrameProcessor#closed()` |
| `https://developer.android.com/reference/java/util/concurrent/atomic/AtomicBoolean.html!` | `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/FakeFrameProcessor#eosSignaled()` |
| `https://developer.android.com/reference/kotlin/androidx/media3/common/video/FrameWriter!` | `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/FakeFrameProcessor#output()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/FakeFrameProcessor#queuedFramesCount()` |

### Inherited functions

From [java.lang.AutoCloseable](https://developer.android.com/reference/java/lang/AutoCloseable.html) `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/java/lang/AutoCloseable.html#close()()`

## Public functions

### close

```
fun close(): Unit
```

Blocks until all resources are released.

### queue

```
fun queue(frames: (Mutable)List<AsyncFrame!>!): Boolean
```

Attempts to queue a `https://developer.android.com/reference/java/util/List.html` of `https://developer.android.com/reference/kotlin/androidx/media3/common/video/AsyncFrame` for processing.

All frames provided in a single invocation of this method represent the exact same point in time.

If this consumer is at capacity, this method returns `false` and the `https://developer.android.com/reference/kotlin/androidx/media3/common/video/FrameProcessor.Listener#onWakeup()` will be invoked when capacity becomes available.

If this method returns `true`, `https://developer.android.com/reference/kotlin/androidx/media3/common/video/FrameProcessor.Listener#onFrameProcessed(androidx.media3.common.video.Frame,androidx.media3.common.video.SyncFenceWrapper)` must be called once with every input `https://developer.android.com/reference/kotlin/androidx/media3/common/video/AsyncFrame#frame()` instance queued, once the `https://developer.android.com/reference/kotlin/androidx/media3/common/video/FrameProcessor` has finished processing the `frames`.

| Parameters |
|---|---|
| `frames: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/media3/common/video/AsyncFrame!>!` | The frames to queue. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `true` if the frames were queued, `false` if the consumer is at capacity. |

### signalEndOfStream

```
fun signalEndOfStream(): Unit
```

Notifies this processor that the current stream has ended.

More frames may be queued after calling this method, if the current stream changes.

### triggerError

```
fun triggerError(exception: VideoFrameProcessingException!): Unit
```

Simulates a video frame processing error by notifying the listener.

## Public properties

### closed

```
val closed: AtomicBoolean!
```

### eosSignaled

```
val eosSignaled: AtomicBoolean!
```

### output

```
val output: FrameWriter!
```

### queuedFramesCount

```
val queuedFramesCount: Int
```