Builder
class Builder
kotlin.Any | |
↳ | android.media.metrics.TrackChangeEvent.Builder |
A builder for TrackChangeEvent
Summary
Public constructors | |
---|---|
Creates a new Builder. |
Public constructors
Builder
Builder(type: Int)
Creates a new Builder.
Parameters | |
---|---|
type |
Int: the track type. It must be one of TRACK_TYPE_AUDIO , TRACK_TYPE_VIDEO , TRACK_TYPE_TEXT . Value is android.media.metrics.TrackChangeEvent#TRACK_TYPE_AUDIO , android.media.metrics.TrackChangeEvent#TRACK_TYPE_VIDEO , or android.media.metrics.TrackChangeEvent#TRACK_TYPE_TEXT |
Public methods
build
fun build(): TrackChangeEvent
Builds the instance. This builder should not be touched after calling this!
Return | |
---|---|
TrackChangeEvent |
This value cannot be null . |
setAudioSampleRate
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
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
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
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
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
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
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
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
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
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
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 . |
See Also
setTrackChangeReason
fun setTrackChangeReason(value: Int): TrackChangeEvent.Builder
Sets track change reason.
Return | |
---|---|
TrackChangeEvent.Builder |
This value cannot be null . |
setTrackState
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
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
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 . |