ApplicationMediaCapabilities.Builder

public static final class ApplicationMediaCapabilities.Builder
extends Object

java.lang.Object
   ↳ android.media.ApplicationMediaCapabilities.Builder


Builder class for ApplicationMediaCapabilities objects. Use this class to configure and create an ApplicationMediaCapabilities instance. Builder could be created from an existing ApplicationMediaCapabilities object, from a xml file or MediaCodecList. //TODO(hkuang): Add xml parsing support to the builder.

Summary

Public constructors

Builder()

Constructs a new Builder with all the supports default to false.

Public methods

ApplicationMediaCapabilities.Builder addSupportedHdrType(String hdrType)

Adds a supported hdr type.

ApplicationMediaCapabilities.Builder addSupportedVideoMimeType(String codecMime)

Adds a supported video codec mime type.

ApplicationMediaCapabilities.Builder addUnsupportedHdrType(String hdrType)

Adds an unsupported hdr type.

ApplicationMediaCapabilities.Builder addUnsupportedVideoMimeType(String codecMime)

Adds an unsupported video codec mime type.

ApplicationMediaCapabilities build()

Builds a ApplicationMediaCapabilities object.

Inherited methods

Public constructors

Builder

Added in API level 31
public Builder ()

Constructs a new Builder with all the supports default to false.

Public methods

addSupportedHdrType

Added in API level 31
public ApplicationMediaCapabilities.Builder addSupportedHdrType (String hdrType)

Adds a supported hdr type.

Parameters
hdrType String: Supported hdr type. Must be one of the String defined in MediaFeature.HdrType. This value cannot be null. Value is MediaFeature.HdrType.DOLBY_VISION, MediaFeature.HdrType.HDR10, MediaFeature.HdrType.HDR10_PLUS, or MediaFeature.HdrType.HLG

Returns
ApplicationMediaCapabilities.Builder This value cannot be null.

Throws
IllegalArgumentException if hdrType is not valid.

addSupportedVideoMimeType

Added in API level 31
public ApplicationMediaCapabilities.Builder addSupportedVideoMimeType (String codecMime)

Adds a supported video codec mime type.

Parameters
codecMime String: Supported codec mime types. Must be one of the mime type defined in MediaFormat. This value cannot be null.

Returns
ApplicationMediaCapabilities.Builder This value cannot be null.

Throws
IllegalArgumentException if mime type is not valid.

addUnsupportedHdrType

Added in API level 31
public ApplicationMediaCapabilities.Builder addUnsupportedHdrType (String hdrType)

Adds an unsupported hdr type.

Parameters
hdrType String: Unsupported hdr type. Must be one of the String defined in MediaFeature.HdrType. This value cannot be null. Value is MediaFeature.HdrType.DOLBY_VISION, MediaFeature.HdrType.HDR10, MediaFeature.HdrType.HDR10_PLUS, or MediaFeature.HdrType.HLG

Returns
ApplicationMediaCapabilities.Builder This value cannot be null.

Throws
IllegalArgumentException if hdrType is not valid.

addUnsupportedVideoMimeType

Added in API level 31
public ApplicationMediaCapabilities.Builder addUnsupportedVideoMimeType (String codecMime)

Adds an unsupported video codec mime type.

Parameters
codecMime String: Unsupported codec mime type. Must be one of the mime type defined in MediaFormat. This value cannot be null.

Returns
ApplicationMediaCapabilities.Builder This value cannot be null.

Throws
IllegalArgumentException if mime type is not valid.

build

Added in API level 31
public ApplicationMediaCapabilities build ()

Builds a ApplicationMediaCapabilities object.

Returns
ApplicationMediaCapabilities a new ApplicationMediaCapabilities instance successfully initialized with all the parameters set on this Builder. This value cannot be null.

Throws
UnsupportedOperationException if the parameters set on the Builder were incompatible, or if they are not supported by the device.