Added in API level 31

Builder


class Builder
kotlin.Any
   ↳ android.media.metrics.TrackChangeEvent.Builder

A builder for TrackChangeEvent

Summary

Public constructors
Builder(type: Int)

Creates a new Builder.

Public methods
TrackChangeEvent

Builds the instance.

TrackChangeEvent.Builder

Sets sample rate.

TrackChangeEvent.Builder
setBitrate(value: Int)

Sets bitrate in bits per second.

TrackChangeEvent.Builder

Sets channel count.

TrackChangeEvent.Builder

Sets codec name.

TrackChangeEvent.Builder

Sets container MIME type.

TrackChangeEvent.Builder
setHeight(value: Int)

Sets video height.

TrackChangeEvent.Builder

Sets language code.

TrackChangeEvent.Builder

Sets language region code.

TrackChangeEvent.Builder
setMetricsBundle(metricsBundle: Bundle)

Sets metrics-related information that is not supported by dedicated methods.

TrackChangeEvent.Builder

Sets the MIME type of the video/audio/text samples.

TrackChangeEvent.Builder

Sets timestamp since the creation in milliseconds.

TrackChangeEvent.Builder

Sets track change reason.

TrackChangeEvent.Builder

Sets track state.

TrackChangeEvent.Builder

Sets video frame rate.

TrackChangeEvent.Builder
setWidth(value: Int)

Sets video width.

Public constructors

Public methods

build

Added in API level 31
fun build(): TrackChangeEvent

Builds the instance. This builder should not be touched after calling this!

Return
TrackChangeEvent This value cannot be null.

setAudioSampleRate

Added in API level 31
fun setAudioSampleRate(value: Int): TrackChangeEvent.Builder

Sets sample rate.

Parameters
value Int: the sample rate. -1 indicates the value is unknown. Value is between -1 and Integer.MAX_VALUE inclusive
Return
TrackChangeEvent.Builder This value cannot be null.

setBitrate

Added in API level 31
fun setBitrate(value: Int): TrackChangeEvent.Builder

Sets bitrate in bits per second.

Parameters
value Int: the bitrate in bits per second. -1 indicates the value is unknown. Value is between -1 and Integer.MAX_VALUE inclusive
Return
TrackChangeEvent.Builder This value cannot be null.

setChannelCount

Added in API level 31
fun setChannelCount(value: Int): TrackChangeEvent.Builder

Sets channel count.

Parameters
value Int: the channel count. -1 indicates the value is unknown. Value is between -1 and Integer.MAX_VALUE inclusive
Return
TrackChangeEvent.Builder This value cannot be null.

setCodecName

Added in API level 31
fun setCodecName(value: String): TrackChangeEvent.Builder

Sets codec name.

Parameters
value String: This value cannot be null.
Return
TrackChangeEvent.Builder This value cannot be null.

setContainerMimeType

Added in API level 31
fun setContainerMimeType(value: String): TrackChangeEvent.Builder

Sets container MIME type.

Parameters
value String: This value cannot be null.
Return
TrackChangeEvent.Builder This value cannot be null.

setHeight

Added in API level 31
fun setHeight(value: Int): TrackChangeEvent.Builder

Sets video height.

Parameters
value Int: the video height. -1 indicates the value is unknown. Value is between -1 and Integer.MAX_VALUE inclusive
Return
TrackChangeEvent.Builder This value cannot be null.

setLanguage

Added in API level 31
fun setLanguage(value: String): TrackChangeEvent.Builder

Sets language code.

Parameters
value String: a two-letter ISO 639-1 language code. This value cannot be null.
Return
TrackChangeEvent.Builder This value cannot be null.

setLanguageRegion

Added in API level 31
fun setLanguageRegion(value: String): TrackChangeEvent.Builder

Sets language region code.

Parameters
value String: an IETF BCP 47 optional language region subtag based on a two-letter country code. This value cannot be null.
Return
TrackChangeEvent.Builder This value cannot be null.

setMetricsBundle

Added in API level 31
fun setMetricsBundle(metricsBundle: Bundle): TrackChangeEvent.Builder

Sets metrics-related information that is not supported by dedicated methods.

It is intended to be used for backwards compatibility by the metrics infrastructure.

Parameters
metricsBundle Bundle: This value cannot be null.
Return
TrackChangeEvent.Builder This value cannot be null.

setSampleMimeType

Added in API level 31
fun setSampleMimeType(value: String): TrackChangeEvent.Builder

Sets the MIME type of the video/audio/text samples.

Parameters
value String: This value cannot be null.
Return
TrackChangeEvent.Builder This value cannot be null.

setTimeSinceCreatedMillis

Added in API level 31
fun setTimeSinceCreatedMillis(value: Long): TrackChangeEvent.Builder

Sets timestamp since the creation in milliseconds.

Parameters
value Long: the timestamp since the creation in milliseconds. -1 indicates the value is unknown. Value is -1 or greater
Return
TrackChangeEvent.Builder This value cannot be null.

setTrackState

Added in API level 31
fun setTrackState(value: Int): TrackChangeEvent.Builder

Sets track state.

Parameters
value Int: Value is android.media.metrics.TrackChangeEvent#TRACK_STATE_OFF, or android.media.metrics.TrackChangeEvent#TRACK_STATE_ON
Return
TrackChangeEvent.Builder This value cannot be null.

setVideoFrameRate

Added in API level 31
fun setVideoFrameRate(value: Float): TrackChangeEvent.Builder

Sets video frame rate.

Parameters
value Float: the video frame rate. -1 indicates the value is unknown. Value is between -1 and Float.MAX_VALUE inclusive
Return
TrackChangeEvent.Builder This value cannot be null.

setWidth

Added in API level 31
fun setWidth(value: Int): TrackChangeEvent.Builder

Sets video width.

Parameters
value Int: the video width. -1 indicates the value is unknown. Value is between -1 and Integer.MAX_VALUE inclusive
Return
TrackChangeEvent.Builder This value cannot be null.