# FrameProcessorTestUtil

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

*** ** * ** ***


```
@RequiresApi(value = 26)
@UnstableApi
public final class FrameProcessorTestUtil
```

<br />

*** ** * ** ***

Test utilities for asserting `https://developer.android.com/reference/androidx/media3/common/video/FrameProcessor` inputs.

## Summary

| ### Nested types |
|---|
| `public class https://developer.android.com/reference/androidx/media3/test/utils/FrameProcessorTestUtil.ExpectedFrame` Represents a frame that is expected to be presented. |

| ### Public methods |
|---|---|
| `static void` | `https://developer.android.com/reference/androidx/media3/test/utils/FrameProcessorTestUtil#assertPlaybackOutput(androidx.media3.test.utils.CapturingFrameProcessor,androidx.media3.test.utils.CompositionAssetInfo)( https://developer.android.com/reference/androidx/media3/test/utils/CapturingFrameProcessor frameProcessor, https://developer.android.com/reference/androidx/media3/test/utils/CompositionAssetInfo compositionAssetInfo )` Asserts the `https://developer.android.com/reference/androidx/media3/test/utils/CapturingFrameProcessor` consumes frames matching the `https://developer.android.com/reference/androidx/media3/test/utils/CompositionAssetInfo`, if it was played from start to finish. |
| `static https://guava.dev/releases/snapshot-android/api/docs/com/google/common/collect/ImmutableList.html<https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/androidx/media3/test/utils/FrameProcessorTestUtil.ExpectedFrame>>` | `https://developer.android.com/reference/androidx/media3/test/utils/FrameProcessorTestUtil#getExpectedEvents(androidx.media3.test.utils.CompositionAssetInfo)(https://developer.android.com/reference/androidx/media3/test/utils/CompositionAssetInfo compositionAssetInfo)` Returns the events expected to be consumed by the `https://developer.android.com/reference/androidx/media3/common/video/FrameProcessor` if the `https://developer.android.com/reference/androidx/media3/test/utils/CompositionAssetInfo#getComposition()` was played from start to finish. |

## Public methods

### assertPlaybackOutput

```
public static void assertPlaybackOutput(
    CapturingFrameProcessor frameProcessor,
    CompositionAssetInfo compositionAssetInfo
)
```

Asserts the `https://developer.android.com/reference/androidx/media3/test/utils/CapturingFrameProcessor` consumes frames matching the `https://developer.android.com/reference/androidx/media3/test/utils/CompositionAssetInfo`, if it was played from start to finish.

This method verifies both the timing/structure of the playback (timestamps, sequence indices, EOS) and that the correct `https://developer.android.com/reference/androidx/media3/common/MediaItem` metadata is associated with each frame.

### getExpectedEvents

```
public static ImmutableList<List<FrameProcessorTestUtil.ExpectedFrame>> getExpectedEvents(CompositionAssetInfo compositionAssetInfo)
```

Returns the events expected to be consumed by the `https://developer.android.com/reference/androidx/media3/common/video/FrameProcessor` if the `https://developer.android.com/reference/androidx/media3/test/utils/CompositionAssetInfo#getComposition()` was played from start to finish.