Added in API level 35

Builder


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

Builder for MediaItemInfo.

Summary

Public constructors

Creates a new builder.

Public methods
MediaItemInfo.Builder
addCodecName(codecName: String)

Adds an media codec name that was used as part of decoding/encoding this media item.

MediaItemInfo.Builder
addDataType(dataType: Long)

Adds an additional data type represented as part of the media item.

MediaItemInfo.Builder

Adds a sample MIME type stored in the media container.

MediaItemInfo

Builds an instance.

MediaItemInfo.Builder
setAudioChannelCount(audioChannelCount: Int)

Sets the number of audio channels.

MediaItemInfo.Builder
setAudioSampleCount(audioSampleCount: Long)

Sets the number of audio frames in the item, after clipping (if applicable).

MediaItemInfo.Builder
setAudioSampleRateHz(audioSampleRateHz: Int)

Sets the sample rate of audio, in Hertz.

MediaItemInfo.Builder
setClipDurationMillis(clipDurationMillis: Long)

Sets the duration of the clip taken from the media item, in milliseconds.

MediaItemInfo.Builder
setContainerMimeType(containerMimeType: String)

Sets the MIME type of the media container.

MediaItemInfo.Builder
setDurationMillis(durationMillis: Long)

Sets the duration of the media item, in milliseconds.

MediaItemInfo.Builder
setSourceType(sourceType: Int)

Sets where the media item came from.

MediaItemInfo.Builder
setVideoDataSpace(videoDataSpace: Int)

Sets the DataSpace of video frames.

MediaItemInfo.Builder
setVideoFrameRate(videoFrameRate: Float)

Sets the average video frame rate, in frames per second.

MediaItemInfo.Builder
setVideoSampleCount(videoSampleCount: Long)

Sets the number of video frames, after clipping (if applicable).

MediaItemInfo.Builder
setVideoSize(videoSize: Size)

Sets the video size, in pixels.

Public constructors

Builder

Added in API level 35
Builder()

Creates a new builder.

Public methods

addCodecName

Added in API level 35
fun addCodecName(codecName: String): MediaItemInfo.Builder

Adds an media codec name that was used as part of decoding/encoding this media item.

Parameters
codecName String: This value cannot be null.
Return
MediaItemInfo.Builder This value cannot be null.

addSampleMimeType

Added in API level 35
fun addSampleMimeType(mimeType: String): MediaItemInfo.Builder

Adds a sample MIME type stored in the media container.

Parameters
mimeType String: This value cannot be null.
Return
MediaItemInfo.Builder This value cannot be null.

build

Added in API level 35
fun build(): MediaItemInfo

Builds an instance.

Return
MediaItemInfo This value cannot be null.

setAudioChannelCount

Added in API level 35
fun setAudioChannelCount(audioChannelCount: Int): MediaItemInfo.Builder

Sets the number of audio channels.

Parameters
audioChannelCount Int: Value is 0 or greater
Return
MediaItemInfo.Builder This value cannot be null.

setAudioSampleCount

Added in API level 35
fun setAudioSampleCount(audioSampleCount: Long): MediaItemInfo.Builder

Sets the number of audio frames in the item, after clipping (if applicable).

Parameters
audioSampleCount Long: Value is 0 or greater
Return
MediaItemInfo.Builder This value cannot be null.

setAudioSampleRateHz

Added in API level 35
fun setAudioSampleRateHz(audioSampleRateHz: Int): MediaItemInfo.Builder

Sets the sample rate of audio, in Hertz.

Parameters
audioSampleRateHz Int: Value is 0 or greater
Return
MediaItemInfo.Builder This value cannot be null.

setClipDurationMillis

Added in API level 35
fun setClipDurationMillis(clipDurationMillis: Long): MediaItemInfo.Builder

Sets the duration of the clip taken from the media item, in milliseconds.

Return
MediaItemInfo.Builder This value cannot be null.

setContainerMimeType

Added in API level 35
fun setContainerMimeType(containerMimeType: String): MediaItemInfo.Builder

Sets the MIME type of the media container.

Parameters
containerMimeType String: This value cannot be null.
Return
MediaItemInfo.Builder This value cannot be null.

setDurationMillis

Added in API level 35
fun setDurationMillis(durationMillis: Long): MediaItemInfo.Builder

Sets the duration of the media item, in milliseconds.

Return
MediaItemInfo.Builder This value cannot be null.

setVideoDataSpace

Added in API level 35
fun setVideoDataSpace(videoDataSpace: Int): MediaItemInfo.Builder

Sets the DataSpace of video frames.

Parameters
videoDataSpace Int: The data space, returned by DataSpace#pack(int, int, int).
Return
MediaItemInfo.Builder This value cannot be null.

setVideoFrameRate

Added in API level 35
fun setVideoFrameRate(videoFrameRate: Float): MediaItemInfo.Builder

Sets the average video frame rate, in frames per second.

Parameters
videoFrameRate Float: Value is 0 or greater
Return
MediaItemInfo.Builder This value cannot be null.

setVideoSampleCount

Added in API level 35
fun setVideoSampleCount(videoSampleCount: Long): MediaItemInfo.Builder

Sets the number of video frames, after clipping (if applicable).

Parameters
videoSampleCount Long: Value is 0 or greater
Return
MediaItemInfo.Builder This value cannot be null.

setVideoSize

Added in API level 35
fun setVideoSize(videoSize: Size): MediaItemInfo.Builder

Sets the video size, in pixels.

Parameters
videoSize Size: This value cannot be null.
Return
MediaItemInfo.Builder This value cannot be null.