FrameProcessorTestUtil


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


Test utilities for asserting FrameProcessor inputs.

Summary

Nested types

Represents a frame that is expected to be presented.

Public methods

static void
assertPlaybackOutput(
    CapturingFrameProcessor frameProcessor,
    CompositionAssetInfo compositionAssetInfo
)

Asserts the CapturingFrameProcessor consumes frames matching the CompositionAssetInfo, if it was played from start to finish.

static ImmutableList<List<FrameProcessorTestUtil.ExpectedFrame>>

Returns the events expected to be consumed by the androidx.media3.common.video.FrameProcessor if the Composition was played from start to finish.

Public methods

assertPlaybackOutput

public static void assertPlaybackOutput(
    CapturingFrameProcessor frameProcessor,
    CompositionAssetInfo compositionAssetInfo
)

Asserts the CapturingFrameProcessor consumes frames matching the 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 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 androidx.media3.common.video.FrameProcessor if the Composition was played from start to finish.