DecodeOneFrameUtil


@UnstableApi
class DecodeOneFrameUtil


Utilities for decoding a video frame for tests.

Summary

Nested types

Listener for decoding events.

Public functions

java-static Unit
decodeOneAssetFileFrame(
    assetFilePath: String!,
    listener: DecodeOneFrameUtil.Listener!,
    surface: Surface!
)

Reads and decodes one frame synchronously from the assetFilePath and renders it to the surface.

java-static Unit
decodeOneMediaItemFrame(
    mediaItem: MediaItem!,
    listener: DecodeOneFrameUtil.Listener!,
    surface: Surface!
)

Reads and decodes one frame synchronously from the mediaItem and renders it to the surface.

Public functions

decodeOneAssetFileFrame

java-static fun decodeOneAssetFileFrame(
    assetFilePath: String!,
    listener: DecodeOneFrameUtil.Listener!,
    surface: Surface!
): Unit

Reads and decodes one frame synchronously from the assetFilePath and renders it to the surface.

This method blocks until the frame has been rendered to the surface.

Parameters
assetFilePath: String!

The path to the file in the asset directory.

listener: DecodeOneFrameUtil.Listener!

A Listener implementation.

surface: Surface!

The Surface to render the decoded frame to.

decodeOneMediaItemFrame

java-static fun decodeOneMediaItemFrame(
    mediaItem: MediaItem!,
    listener: DecodeOneFrameUtil.Listener!,
    surface: Surface!
): Unit

Reads and decodes one frame synchronously from the mediaItem and renders it to the surface.

This method blocks until the frame has been rendered to the surface.

Parameters
mediaItem: MediaItem!

The MediaItem from which to decode a frame.

listener: DecodeOneFrameUtil.Listener!

A Listener implementation.

surface: Surface!

The Surface to render the decoded frame to.