Format.Builder
@UnstableApi
class Format.Builder
Builds Format instances.
Use Format#buildUpon() to obtain a builder representing an existing Format.
When building formats, populate all fields whose values are known and relevant to the type of format being constructed. See the Format Javadoc for information about which fields should be set for different types of format.
Summary
Public constructors |
|---|
Builder()Creates a new instance with default values. |
Public constructors
Public functions
setAccessibilityChannel
@CanIgnoreReturnValue
fun setAccessibilityChannel(accessibilityChannel: Int): Format.Builder!
Sets accessibilityChannel. The default value is NO_VALUE.
| Parameters | |
|---|---|
accessibilityChannel: Int |
The |
| Returns | |
|---|---|
Format.Builder! |
The builder. |
setAuxiliaryTrackType
@CanIgnoreReturnValue
fun setAuxiliaryTrackType(@C.AuxiliaryTrackType auxiliaryTrackType: Int): Format.Builder!
Sets auxiliaryTrackType. The default value is AUXILIARY_TRACK_TYPE_UNDEFINED.
This must be set to a value other than AUXILIARY_TRACK_TYPE_UNDEFINED only when role flags contains ROLE_FLAG_AUXILIARY.
| Parameters | |
|---|---|
@C.AuxiliaryTrackType auxiliaryTrackType: Int |
The |
| Returns | |
|---|---|
Format.Builder! |
The builder. |
setAverageBitrate
@CanIgnoreReturnValue
fun setAverageBitrate(averageBitrate: Int): Format.Builder!
Sets averageBitrate. The default value is NO_VALUE.
| Parameters | |
|---|---|
averageBitrate: Int |
The |
| Returns | |
|---|---|
Format.Builder! |
The builder. |
setChannelCount
@CanIgnoreReturnValue
fun setChannelCount(channelCount: Int): Format.Builder!
Sets channelCount. The default value is NO_VALUE.
| Parameters | |
|---|---|
channelCount: Int |
The |
| Returns | |
|---|---|
Format.Builder! |
The builder. |
setCodecs
@CanIgnoreReturnValue
fun setCodecs(codecs: String?): Format.Builder!
Sets codecs. The default value is null.
| Returns | |
|---|---|
Format.Builder! |
The builder. |
setColorInfo
@CanIgnoreReturnValue
fun setColorInfo(colorInfo: ColorInfo?): Format.Builder!
Sets colorInfo. The default value is null.
| Returns | |
|---|---|
Format.Builder! |
The builder. |
setContainerMimeType
@CanIgnoreReturnValue
fun setContainerMimeType(containerMimeType: String?): Format.Builder!
Sets containerMimeType. The default value is null.
| Parameters | |
|---|---|
containerMimeType: String? |
The |
| Returns | |
|---|---|
Format.Builder! |
The builder. |
setCryptoType
@CanIgnoreReturnValue
fun setCryptoType(@C.CryptoType cryptoType: Int): Format.Builder!
Sets cryptoType. The default value is CRYPTO_TYPE_NONE.
| Parameters | |
|---|---|
@C.CryptoType cryptoType: Int |
The |
| Returns | |
|---|---|
Format.Builder! |
The builder. |
setCueReplacementBehavior
@CanIgnoreReturnValue
fun setCueReplacementBehavior(
@Format.CueReplacementBehavior cueReplacementBehavior: Int
): Format.Builder!
Sets cueReplacementBehavior. The default value is CUE_REPLACEMENT_BEHAVIOR_MERGE.
| Parameters | |
|---|---|
@Format.CueReplacementBehavior cueReplacementBehavior: Int |
| Returns | |
|---|---|
Format.Builder! |
The builder. |
setCustomData
@UnstableApi
@CanIgnoreReturnValue
fun setCustomData(customData: Any?): Format.Builder!
Sets the opaque object customData. The default value is null.
This value is not included in serialized Bundle instances of this class that are used to transfer data to other processes.
| Parameters | |
|---|---|
customData: Any? |
The |
| Returns | |
|---|---|
Format.Builder! |
The builder. |
setDecodedHeight
@CanIgnoreReturnValue
fun setDecodedHeight(decodedHeight: Int): Format.Builder!
Sets decodedHeight. The default value is NO_VALUE.
| Parameters | |
|---|---|
decodedHeight: Int |
The |
| Returns | |
|---|---|
Format.Builder! |
The builder. |
setDecodedWidth
@CanIgnoreReturnValue
fun setDecodedWidth(decodedWidth: Int): Format.Builder!
Sets decodedWidth. The default value is NO_VALUE.
| Parameters | |
|---|---|
decodedWidth: Int |
The |
| Returns | |
|---|---|
Format.Builder! |
The builder. |
setDrmInitData
@CanIgnoreReturnValue
fun setDrmInitData(drmInitData: DrmInitData?): Format.Builder!
Sets drmInitData. The default value is null.
| Parameters | |
|---|---|
drmInitData: DrmInitData? |
The |
| Returns | |
|---|---|
Format.Builder! |
The builder. |
setEncoderDelay
@CanIgnoreReturnValue
fun setEncoderDelay(encoderDelay: Int): Format.Builder!
Sets encoderDelay. The default value is 0.
| Parameters | |
|---|---|
encoderDelay: Int |
The |
| Returns | |
|---|---|
Format.Builder! |
The builder. |
setEncoderPadding
@CanIgnoreReturnValue
fun setEncoderPadding(encoderPadding: Int): Format.Builder!
Sets encoderPadding. The default value is 0.
| Parameters | |
|---|---|
encoderPadding: Int |
The |
| Returns | |
|---|---|
Format.Builder! |
The builder. |
setFrameRate
@CanIgnoreReturnValue
fun setFrameRate(frameRate: Float): Format.Builder!
Sets frameRate. The default value is NO_VALUE.
| Returns | |
|---|---|
Format.Builder! |
The builder. |
setHasPrerollSamples
@CanIgnoreReturnValue
fun setHasPrerollSamples(hasPrerollSamples: Boolean): Format.Builder!
Sets hasPrerollSamples. The default value is false.
| Parameters | |
|---|---|
hasPrerollSamples: Boolean |
The |
| Returns | |
|---|---|
Format.Builder! |
The builder. |
setHeight
@CanIgnoreReturnValue
fun setHeight(height: Int): Format.Builder!
Sets height. The default value is NO_VALUE.
| Returns | |
|---|---|
Format.Builder! |
The builder. |
setId
@CanIgnoreReturnValue
fun setId(id: Int): Format.Builder!
Sets id to Integer.toString(id). The default value is null.
| Returns | |
|---|---|
Format.Builder! |
The builder. |
setId
@CanIgnoreReturnValue
fun setId(id: String?): Format.Builder!
Sets id. The default value is null.
| Returns | |
|---|---|
Format.Builder! |
The builder. |
setInitializationData
@CanIgnoreReturnValue
fun setInitializationData(initializationData: (Mutable)List<ByteArray!>?): Format.Builder!
Sets initializationData. The default value is null.
| Parameters | |
|---|---|
initializationData: (Mutable)List<ByteArray!>? |
The |
| Returns | |
|---|---|
Format.Builder! |
The builder. |
setLabel
@CanIgnoreReturnValue
fun setLabel(label: String?): Format.Builder!
Sets label. The default value is null.
If both this default label and a list of labels are set, this default label must be part of label list.
| Returns | |
|---|---|
Format.Builder! |
The builder. |
setLabels
@CanIgnoreReturnValue
fun setLabels(labels: (Mutable)List<Label!>!): Format.Builder!
Sets labels. The default value is an empty list.
If both the default label and this list are set, the default label must be part of this list of labels.
| Returns | |
|---|---|
Format.Builder! |
The builder. |
setLanguage
@CanIgnoreReturnValue
fun setLanguage(language: String?): Format.Builder!
Sets language. The default value is null.
| Returns | |
|---|---|
Format.Builder! |
The builder. |
setMaxInputSize
@CanIgnoreReturnValue
fun setMaxInputSize(maxInputSize: Int): Format.Builder!
Sets maxInputSize. The default value is NO_VALUE.
| Parameters | |
|---|---|
maxInputSize: Int |
The |
| Returns | |
|---|---|
Format.Builder! |
The builder. |
setMaxNumReorderSamples
@CanIgnoreReturnValue
fun setMaxNumReorderSamples(maxNumReorderSamples: Int): Format.Builder!
Sets maxNumReorderSamples. The default value is NO_VALUE.
| Parameters | |
|---|---|
maxNumReorderSamples: Int |
| Returns | |
|---|---|
Format.Builder! |
The builder. |
setMaxSubLayers
@CanIgnoreReturnValue
fun setMaxSubLayers(maxSubLayers: Int): Format.Builder!
Sets maxSubLayers. The default value is NO_VALUE.
| Parameters | |
|---|---|
maxSubLayers: Int |
The |
| Returns | |
|---|---|
Format.Builder! |
The builder. |
setMetadata
@CanIgnoreReturnValue
fun setMetadata(metadata: Metadata?): Format.Builder!
Sets metadata. The default value is null.
| Returns | |
|---|---|
Format.Builder! |
The builder. |
setPcmEncoding
@CanIgnoreReturnValue
fun setPcmEncoding(@C.PcmEncoding pcmEncoding: Int): Format.Builder!
Sets pcmEncoding. The default value is NO_VALUE.
| Parameters | |
|---|---|
@C.PcmEncoding pcmEncoding: Int |
The |
| Returns | |
|---|---|
Format.Builder! |
The builder. |
setPeakBitrate
@CanIgnoreReturnValue
fun setPeakBitrate(peakBitrate: Int): Format.Builder!
Sets peakBitrate. The default value is NO_VALUE.
| Parameters | |
|---|---|
peakBitrate: Int |
The |
| Returns | |
|---|---|
Format.Builder! |
The builder. |
setPixelWidthHeightRatio
@CanIgnoreReturnValue
fun setPixelWidthHeightRatio(pixelWidthHeightRatio: Float): Format.Builder!
Sets pixelWidthHeightRatio. The default value is 1.0f.
| Parameters | |
|---|---|
pixelWidthHeightRatio: Float |
| Returns | |
|---|---|
Format.Builder! |
The builder. |
setProjectionData
@CanIgnoreReturnValue
fun setProjectionData(projectionData: ByteArray?): Format.Builder!
Sets projectionData. The default value is null.
| Parameters | |
|---|---|
projectionData: ByteArray? |
The |
| Returns | |
|---|---|
Format.Builder! |
The builder. |
setRoleFlags
@CanIgnoreReturnValue
fun setRoleFlags(@C.RoleFlags roleFlags: Int): Format.Builder!
Sets roleFlags. The default value is 0.
When roleFlags includes ROLE_FLAG_AUXILIARY, then the specific C.AuxiliaryTrackType can also be set.
| Parameters | |
|---|---|
@C.RoleFlags roleFlags: Int |
The |
| Returns | |
|---|---|
Format.Builder! |
The builder. |
setRotationDegrees
@CanIgnoreReturnValue
fun setRotationDegrees(rotationDegrees: Int): Format.Builder!
Sets rotationDegrees. The default value is 0.
| Parameters | |
|---|---|
rotationDegrees: Int |
The |
| Returns | |
|---|---|
Format.Builder! |
The builder. |
setSampleMimeType
@CanIgnoreReturnValue
fun setSampleMimeType(sampleMimeType: String?): Format.Builder!
Sets sampleMimeType. The default value is null.
| Parameters | |
|---|---|
sampleMimeType: String? |
| Returns | |
|---|---|
Format.Builder! |
The builder. |
setSampleRate
@CanIgnoreReturnValue
fun setSampleRate(sampleRate: Int): Format.Builder!
Sets sampleRate. The default value is NO_VALUE.
| Parameters | |
|---|---|
sampleRate: Int |
The |
| Returns | |
|---|---|
Format.Builder! |
The builder. |
setSelectionFlags
@CanIgnoreReturnValue
fun setSelectionFlags(@C.SelectionFlags selectionFlags: Int): Format.Builder!
Sets selectionFlags. The default value is 0.
| Parameters | |
|---|---|
@C.SelectionFlags selectionFlags: Int |
The |
| Returns | |
|---|---|
Format.Builder! |
The builder. |
setStereoMode
@CanIgnoreReturnValue
fun setStereoMode(@C.StereoMode stereoMode: Int): Format.Builder!
Sets stereoMode. The default value is NO_VALUE.
| Parameters | |
|---|---|
@C.StereoMode stereoMode: Int |
The |
| Returns | |
|---|---|
Format.Builder! |
The builder. |
setSubsampleOffsetUs
@CanIgnoreReturnValue
fun setSubsampleOffsetUs(subsampleOffsetUs: Long): Format.Builder!
Sets subsampleOffsetUs. The default value is OFFSET_SAMPLE_RELATIVE.
| Parameters | |
|---|---|
subsampleOffsetUs: Long |
The |
| Returns | |
|---|---|
Format.Builder! |
The builder. |
setTileCountHorizontal
@CanIgnoreReturnValue
fun setTileCountHorizontal(tileCountHorizontal: Int): Format.Builder!
Sets tileCountHorizontal. The default value is NO_VALUE.
| Parameters | |
|---|---|
tileCountHorizontal: Int |
The |
| Returns | |
|---|---|
Format.Builder! |
The builder. |
setTileCountVertical
@CanIgnoreReturnValue
fun setTileCountVertical(tileCountVertical: Int): Format.Builder!
Sets tileCountVertical. The default value is NO_VALUE.
| Parameters | |
|---|---|
tileCountVertical: Int |
The |
| Returns | |
|---|---|
Format.Builder! |
The builder. |
setWidth
@CanIgnoreReturnValue
fun setWidth(width: Int): Format.Builder!
Sets width. The default value is NO_VALUE.
| Returns | |
|---|---|
Format.Builder! |
The builder. |