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 | |
|---|---|
Builder()Constructs a new Builder with all the supports default to false. |
|
| Public methods | |
|---|---|
| ApplicationMediaCapabilities.Builder |
addSupportedHdrType(hdrType: String)Adds a supported hdr type. |
| ApplicationMediaCapabilities.Builder |
addSupportedVideoMimeType(codecMime: String)Adds a supported video codec mime type. |
| ApplicationMediaCapabilities.Builder |
addUnsupportedHdrType(hdrType: String)Adds an unsupported hdr type. |
| ApplicationMediaCapabilities.Builder |
addUnsupportedVideoMimeType(codecMime: String)Adds an unsupported video codec mime type. |
| ApplicationMediaCapabilities |
build()Builds a |
Public constructors
Builder
Builder()
Constructs a new Builder with all the supports default to false.
Public methods
addSupportedHdrType
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
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
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
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
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. |