EncoderPreference


public class EncoderPreference


Defines the configuration for an encoder, including hardware/software preference and constant quality (CQ) bitrate mode preference.

Summary

Nested types

public final class EncoderPreference.Builder

Builder class for constructing a EncoderPreference object from specified parameters.

Constants

static final int

Only choose the encoder that supports constant quality mode.

static final int

This is the default mode.

static final int

Only use a hardware encoder.

static final int

Prefer a hardware encoder, but fall back to a software encoder.

static final int

This is the default mode.

static final int

Only use a software encoder.

static final int

Prefer a software encoder, but fall back to a hardware encoder.

Public methods

int

Gets the preferred bitrate mode.

static @NonNull EncoderPreference

Gets the default encoder preference.

int

Gets the preferred encoding type.

String

Constants

CONSTANT_QUALITY_MODE_ONLY

Added in 1.2.0-alpha01
public static final int CONSTANT_QUALITY_MODE_ONLY = 1

Only choose the encoder that supports constant quality mode.

CONSTANT_QUALITY_MODE_PREFERRED

Added in 1.2.0-alpha01
public static final int CONSTANT_QUALITY_MODE_PREFERRED = 0

This is the default mode. Constant quality is not enforced, but encoders with constant quality support are prioritized.

HARDWARE_ENCODER_ONLY

Added in 1.2.0-alpha01
public static final int HARDWARE_ENCODER_ONLY = 1

Only use a hardware encoder.

HARDWARE_ENCODER_PREFERRED

Added in 1.2.0-alpha01
public static final int HARDWARE_ENCODER_PREFERRED = 2

Prefer a hardware encoder, but fall back to a software encoder.

NO_ENCODER_PREFERENCE

Added in 1.2.0-alpha01
public static final int NO_ENCODER_PREFERENCE = 0

This is the default mode. System will use its default behavior.

SOFTWARE_ENCODER_ONLY

Added in 1.2.0-alpha01
public static final int SOFTWARE_ENCODER_ONLY = 3

Only use a software encoder.

SOFTWARE_ENCODER_PREFERRED

Added in 1.2.0-alpha01
public static final int SOFTWARE_ENCODER_PREFERRED = 4

Prefer a software encoder, but fall back to a hardware encoder.

Public methods

getBitrateMode

Added in 1.2.0-alpha01
public int getBitrateMode()

Gets the preferred bitrate mode.

Returns
int

The BitrateMode.

getDefaultEncoderPreference

Added in 1.2.0-alpha01
public static @NonNull EncoderPreference getDefaultEncoderPreference()

Gets the default encoder preference.

Returns
@NonNull EncoderPreference

The EncoderPreference object.

getEncoderType

Added in 1.2.0-alpha01
public int getEncoderType()

Gets the preferred encoding type.

Returns
int

The EncoderType.

toString

public String toString()