DecoderReuseEvaluation


@UnstableApi
public final class DecoderReuseEvaluation


The result of an evaluation to determine whether a decoder can be reused for a new input format.

Summary

Nested types

@Documented
@Retention(value = RetentionPolicy.SOURCE)
@Target(value = TYPE_USE)
@IntDef(flag = true, value = )
public annotation DecoderReuseEvaluation.DecoderDiscardReasons

Possible reasons why reuse is not possible.

@Documented
@Retention(value = RetentionPolicy.SOURCE)
@Target(value = TYPE_USE)
@IntDef(value = )
public annotation DecoderReuseEvaluation.DecoderReuseResult

Possible outcomes of the evaluation.

Constants

static final int

Decoder reuse is disabled by overriding behavior in application code.

static final int

The audio bypass mode is possible.

static final int

The audio channel count is changing.

static final int

The audio encoding is changing.

static final int

The audio sample rate is changing.

static final int

The DRM session is changing.

static final int

The format initialization data is changing.

static final int

The new format may exceed the decoder's configured maximum sample size, in bytes.

static final int

The sample MIME type is changing.

static final int

The codec's operating rate is changing.

static final int

Decoder reuse is not implemented.

static final int

The video ColorInfo is changing.

static final int

The new format may exceed the decoder's configured maximum resolution.

static final int

The video resolution is changing.

static final int

The video rotation is changing.

static final int

Decoder reuse is disabled by a workaround.

static final int

The decoder cannot be reused.

static final int

The decoder can be kept.

static final int

The decoder can be reused, but must be flushed.

static final int

The decoder can be reused.

Public fields

final String

The name of the decoder.

final int

Reasons why the decoder cannot be reused.

final Format

The new Format being evaluated.

final Format

The Format for which the decoder was previously configured.

final int

The result of the evaluation.

Public constructors

DecoderReuseEvaluation(
    String decoderName,
    Format oldFormat,
    Format newFormat,
    @DecoderReuseEvaluation.DecoderReuseResult int result,
    @DecoderReuseEvaluation.DecoderDiscardReasons int discardReasons
)

Public methods

boolean
int

Constants

DISCARD_REASON_APP_OVERRIDE

public static final int DISCARD_REASON_APP_OVERRIDE = 4

Decoder reuse is disabled by overriding behavior in application code.

DISCARD_REASON_AUDIO_BYPASS_POSSIBLE

public static final int DISCARD_REASON_AUDIO_BYPASS_POSSIBLE = 32768

The audio bypass mode is possible.

DISCARD_REASON_AUDIO_CHANNEL_COUNT_CHANGED

public static final int DISCARD_REASON_AUDIO_CHANNEL_COUNT_CHANGED = 4096

The audio channel count is changing.

DISCARD_REASON_AUDIO_ENCODING_CHANGED

public static final int DISCARD_REASON_AUDIO_ENCODING_CHANGED = 16384

The audio encoding is changing.

DISCARD_REASON_AUDIO_SAMPLE_RATE_CHANGED

public static final int DISCARD_REASON_AUDIO_SAMPLE_RATE_CHANGED = 8192

The audio sample rate is changing.

DISCARD_REASON_DRM_SESSION_CHANGED

public static final int DISCARD_REASON_DRM_SESSION_CHANGED = 128

The DRM session is changing.

DISCARD_REASON_INITIALIZATION_DATA_CHANGED

public static final int DISCARD_REASON_INITIALIZATION_DATA_CHANGED = 32

The format initialization data is changing.

DISCARD_REASON_MAX_INPUT_SIZE_EXCEEDED

public static final int DISCARD_REASON_MAX_INPUT_SIZE_EXCEEDED = 64

The new format may exceed the decoder's configured maximum sample size, in bytes.

DISCARD_REASON_MIME_TYPE_CHANGED

public static final int DISCARD_REASON_MIME_TYPE_CHANGED = 8

The sample MIME type is changing.

DISCARD_REASON_OPERATING_RATE_CHANGED

public static final int DISCARD_REASON_OPERATING_RATE_CHANGED = 16

The codec's operating rate is changing.

DISCARD_REASON_REUSE_NOT_IMPLEMENTED

public static final int DISCARD_REASON_REUSE_NOT_IMPLEMENTED = 1

Decoder reuse is not implemented.

DISCARD_REASON_VIDEO_COLOR_INFO_CHANGED

public static final int DISCARD_REASON_VIDEO_COLOR_INFO_CHANGED = 2048

The video ColorInfo is changing.

DISCARD_REASON_VIDEO_MAX_RESOLUTION_EXCEEDED

public static final int DISCARD_REASON_VIDEO_MAX_RESOLUTION_EXCEEDED = 256

The new format may exceed the decoder's configured maximum resolution.

DISCARD_REASON_VIDEO_RESOLUTION_CHANGED

public static final int DISCARD_REASON_VIDEO_RESOLUTION_CHANGED = 512

The video resolution is changing.

DISCARD_REASON_VIDEO_ROTATION_CHANGED

public static final int DISCARD_REASON_VIDEO_ROTATION_CHANGED = 1024

The video rotation is changing.

DISCARD_REASON_WORKAROUND

public static final int DISCARD_REASON_WORKAROUND = 2

Decoder reuse is disabled by a workaround.

REUSE_RESULT_NO

public static final int REUSE_RESULT_NO = 0

The decoder cannot be reused.

REUSE_RESULT_YES_WITHOUT_RECONFIGURATION

public static final int REUSE_RESULT_YES_WITHOUT_RECONFIGURATION = 3

The decoder can be kept. It does not need to be flushed and no reconfiguration is required.

REUSE_RESULT_YES_WITH_FLUSH

public static final int REUSE_RESULT_YES_WITH_FLUSH = 1

The decoder can be reused, but must be flushed.

REUSE_RESULT_YES_WITH_RECONFIGURATION

public static final int REUSE_RESULT_YES_WITH_RECONFIGURATION = 2

The decoder can be reused. It does not need to be flushed, but must be reconfigured by prefixing the next input buffer with the new format's configuration data.

Public fields

decoderName

public final String decoderName

The name of the decoder.

discardReasons

@DecoderReuseEvaluation.DecoderDiscardReasons
public final int discardReasons

Reasons why the decoder cannot be reused. Always 0 if reuse is possible. May also be {code 0} if reuse is not possible for an unspecified reason.

newFormat

public final Format newFormat

The new Format being evaluated.

oldFormat

public final Format oldFormat

The Format for which the decoder was previously configured.

result

@DecoderReuseEvaluation.DecoderReuseResult
public final int result

The result of the evaluation.

Public constructors

DecoderReuseEvaluation

public DecoderReuseEvaluation(
    String decoderName,
    Format oldFormat,
    Format newFormat,
    @DecoderReuseEvaluation.DecoderReuseResult int result,
    @DecoderReuseEvaluation.DecoderDiscardReasons int discardReasons
)
Parameters
String decoderName

The name of the decoder.

Format oldFormat

The Format for which the decoder was previously configured.

Format newFormat

The new Format being evaluated.

@DecoderReuseEvaluation.DecoderReuseResult int result

The result of the evaluation.

@DecoderReuseEvaluation.DecoderDiscardReasons int discardReasons

One or more reasons why the decoder cannot be reused, or 0 if reuse is possible.

Public methods

equals

public boolean equals(@Nullable Object obj)

hashCode

public int hashCode()