DecodeOneFrameUtil


@UnstableApi
class DecodeOneFrameUtil


Utilities for decoding a video frame for tests.

Summary

Nested types

Listener for decoding events.

Constants

const String!
NO_DECODER_SUPPORT_ERROR_STRING = "No MediaCodec decoders on this device support this value."

Public functions

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

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

Constants

NO_DECODER_SUPPORT_ERROR_STRING

const val NO_DECODER_SUPPORT_ERROR_STRING = "No MediaCodec decoders on this device support this value.": String!

Public functions

decodeOneAssetFileFrame

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

Reads and decodes one frame from the assetFilePath and renders it 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, null if the decoded frame is not needed.

Throws
java.io.IOException

If the MediaExtractor or MediaCodec cannot be created.