Added in API level 31

Builder


class Builder
kotlin.Any
   ↳ 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

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

Public methods
ApplicationMediaCapabilities.Builder

Adds a supported hdr type.

ApplicationMediaCapabilities.Builder

Adds a supported video codec mime type.

ApplicationMediaCapabilities.Builder

Adds an unsupported hdr type.

ApplicationMediaCapabilities.Builder

Adds an unsupported video codec mime type.

ApplicationMediaCapabilities

Builds a ApplicationMediaCapabilities object.

Public constructors

Builder

Added in API level 31
Builder()

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

Public methods

addSupportedHdrType

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

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 android.media.MediaFeature.HdrType#DOLBY_VISION, android.media.MediaFeature.HdrType#HDR10, android.media.MediaFeature.HdrType#HDR10_PLUS, or android.media.MediaFeature.HdrType#HLG
Return
ApplicationMediaCapabilities.Builder This value cannot be null.
Exceptions
java.lang.IllegalArgumentException if hdrType is not valid.

addSupportedVideoMimeType

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

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.
Return
ApplicationMediaCapabilities.Builder This value cannot be null.
Exceptions
java.lang.IllegalArgumentException if mime type is not valid.

addUnsupportedHdrType

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

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 android.media.MediaFeature.HdrType#DOLBY_VISION, android.media.MediaFeature.HdrType#HDR10, android.media.MediaFeature.HdrType#HDR10_PLUS, or android.media.MediaFeature.HdrType#HLG
Return
ApplicationMediaCapabilities.Builder This value cannot be null.
Exceptions
java.lang.IllegalArgumentException if hdrType is not valid.

addUnsupportedVideoMimeType

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

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.
Return
ApplicationMediaCapabilities.Builder This value cannot be null.
Exceptions
java.lang.IllegalArgumentException if mime type is not valid.

build

Added in API level 31
fun build(): ApplicationMediaCapabilities

Builds a ApplicationMediaCapabilities object.

Return
ApplicationMediaCapabilities a new ApplicationMediaCapabilities instance successfully initialized with all the parameters set on this Builder. This value cannot be null.
Exceptions
java.lang.UnsupportedOperationException if the parameters set on the Builder were incompatible, or if they are not supported by the device.