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 Format

The Format for which the codec is being configured.

final @Nullable LoudnessCodecController

The LoudnessCodecController for audio codecs.

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,
    @Nullable LoudnessCodecController loudnessCodecController
)

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.

format

public final Format format

The Format for which the codec is being configured.

loudnessCodecController

public final @Nullable LoudnessCodecController loudnessCodecController

The LoudnessCodecController for audio codecs.

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,
    @Nullable LoudnessCodecController loudnessCodecController
)

Creates a configuration for audio decoding.

Parameters
MediaCodecInfo codecInfo

See codecInfo.

MediaFormat mediaFormat

See mediaFormat.

Format format

See format.

@Nullable MediaCrypto crypto

See crypto.

@Nullable LoudnessCodecController loudnessCodecController

See loudnessCodecController.

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.