MediaCodecAdapter.Configuration


public final class MediaCodecAdapter.Configuration


Configuration parameters for a MediaCodecAdapter.

Summary

Public fields

final MediaCodecInfo

Information about the MediaCodec being configured.

final @Nullable MediaCrypto

For DRM protected playbacks, a MediaCrypto to use for decryption.

final int

See configure.

final Format

The Format for which the codec is being configured.

final MediaFormat

The MediaFormat for which the codec is being configured.

final @Nullable Surface

For video decoding, the output where the object will render the decoded frames.

Public methods

static MediaCodecAdapter.Configuration
createForAudioDecoding(
    MediaCodecInfo codecInfo,
    MediaFormat mediaFormat,
    Format format,
    @Nullable MediaCrypto crypto
)

Creates a configuration for audio decoding.

static MediaCodecAdapter.Configuration
createForVideoDecoding(
    MediaCodecInfo codecInfo,
    MediaFormat mediaFormat,
    Format format,
    @Nullable Surface surface,
    @Nullable MediaCrypto crypto
)

Creates a configuration for video decoding.

Public fields

codecInfo

public final MediaCodecInfo codecInfo

Information about the MediaCodec being configured.

crypto

public final @Nullable MediaCrypto crypto

For DRM protected playbacks, a MediaCrypto to use for decryption.

flags

public final int flags

See configure.

format

public final Format format

The Format for which the codec is being configured.

mediaFormat

public final MediaFormat mediaFormat

The MediaFormat for which the codec is being configured.

surface

public final @Nullable Surface surface

For video decoding, the output where the object will render the decoded frames. This must be null if the codec is not a video decoder, or if it is configured for ByteBuffer output.

Public methods

createForAudioDecoding

public static MediaCodecAdapter.Configuration createForAudioDecoding(
    MediaCodecInfo codecInfo,
    MediaFormat mediaFormat,
    Format format,
    @Nullable MediaCrypto crypto
)

Creates a configuration for audio decoding.

Parameters
MediaCodecInfo codecInfo

See codecInfo.

MediaFormat mediaFormat

See mediaFormat.

Format format

See format.

@Nullable MediaCrypto crypto

See crypto.

Returns
MediaCodecAdapter.Configuration

The created instance.

createForVideoDecoding

public static MediaCodecAdapter.Configuration createForVideoDecoding(
    MediaCodecInfo codecInfo,
    MediaFormat mediaFormat,
    Format format,
    @Nullable Surface surface,
    @Nullable MediaCrypto crypto
)

Creates a configuration for video decoding.

Parameters
MediaCodecInfo codecInfo

See codecInfo.

MediaFormat mediaFormat

See mediaFormat.

Format format

See format.

@Nullable Surface surface

See surface.

@Nullable MediaCrypto crypto

See crypto.

Returns
MediaCodecAdapter.Configuration

The created instance.