MediaItemInfo.Builder


public static final class MediaItemInfo.Builder
extends Object

java.lang.Object
   ↳ android.media.metrics.MediaItemInfo.Builder


Builder for MediaItemInfo.

Summary

Public constructors

Builder()

Creates a new builder.

Public methods

MediaItemInfo.Builder addCodecName(String codecName)

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

MediaItemInfo.Builder addDataType(long dataType)

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

MediaItemInfo.Builder addSampleMimeType(String mimeType)

Adds a sample MIME type stored in the media container.

MediaItemInfo build()

Builds an instance.

MediaItemInfo.Builder setAudioChannelCount(int audioChannelCount)

Sets the number of audio channels.

MediaItemInfo.Builder setAudioSampleCount(long audioSampleCount)

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

MediaItemInfo.Builder setAudioSampleRateHz(int audioSampleRateHz)

Sets the sample rate of audio, in Hertz.

MediaItemInfo.Builder setClipDurationMillis(long clipDurationMillis)

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

MediaItemInfo.Builder setContainerMimeType(String containerMimeType)

Sets the MIME type of the media container.

MediaItemInfo.Builder setDurationMillis(long durationMillis)

Sets the duration of the media item, in milliseconds.

MediaItemInfo.Builder setSourceType(int sourceType)

Sets where the media item came from.

MediaItemInfo.Builder setVideoDataSpace(int videoDataSpace)

Sets the DataSpace of video frames.

MediaItemInfo.Builder setVideoFrameRate(float videoFrameRate)

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

MediaItemInfo.Builder setVideoSampleCount(long videoSampleCount)

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

MediaItemInfo.Builder setVideoSize(Size videoSize)

Sets the video size, in pixels.

Inherited methods

Public constructors

Builder

Added in API level 35
public Builder ()

Creates a new builder.

Public methods

addCodecName

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

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

Parameters
codecName String: This value cannot be null.

Returns
MediaItemInfo.Builder This value cannot be null.

addSampleMimeType

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

Adds a sample MIME type stored in the media container.

Parameters
mimeType String: This value cannot be null.

Returns
MediaItemInfo.Builder This value cannot be null.

build

Added in API level 35
public MediaItemInfo build ()

Builds an instance.

Returns
MediaItemInfo This value cannot be null.

setAudioChannelCount

Added in API level 35
public MediaItemInfo.Builder setAudioChannelCount (int audioChannelCount)

Sets the number of audio channels.

Parameters
audioChannelCount int: Value is 0 or greater

Returns
MediaItemInfo.Builder This value cannot be null.

setAudioSampleCount

Added in API level 35
public MediaItemInfo.Builder setAudioSampleCount (long audioSampleCount)

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

Parameters
audioSampleCount long: Value is 0 or greater

Returns
MediaItemInfo.Builder This value cannot be null.

setAudioSampleRateHz

Added in API level 35
public MediaItemInfo.Builder setAudioSampleRateHz (int audioSampleRateHz)

Sets the sample rate of audio, in Hertz.

Parameters
audioSampleRateHz int: Value is 0 or greater

Returns
MediaItemInfo.Builder This value cannot be null.

setClipDurationMillis

Added in API level 35
public MediaItemInfo.Builder setClipDurationMillis (long clipDurationMillis)

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

Parameters
clipDurationMillis long

Returns
MediaItemInfo.Builder This value cannot be null.

setContainerMimeType

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

Sets the MIME type of the media container.

Parameters
containerMimeType String: This value cannot be null.

Returns
MediaItemInfo.Builder This value cannot be null.

setDurationMillis

Added in API level 35
public MediaItemInfo.Builder setDurationMillis (long durationMillis)

Sets the duration of the media item, in milliseconds.

Parameters
durationMillis long

Returns
MediaItemInfo.Builder This value cannot be null.

setVideoDataSpace

Added in API level 35
public MediaItemInfo.Builder setVideoDataSpace (int videoDataSpace)

Sets the DataSpace of video frames.

Parameters
videoDataSpace int: The data space, returned by DataSpace#pack(int, int, int).

Returns
MediaItemInfo.Builder This value cannot be null.

setVideoFrameRate

Added in API level 35
public MediaItemInfo.Builder setVideoFrameRate (float videoFrameRate)

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

Parameters
videoFrameRate float: Value is 0 or greater

Returns
MediaItemInfo.Builder This value cannot be null.

setVideoSampleCount

Added in API level 35
public MediaItemInfo.Builder setVideoSampleCount (long videoSampleCount)

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

Parameters
videoSampleCount long: Value is 0 or greater

Returns
MediaItemInfo.Builder This value cannot be null.

setVideoSize

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

Sets the video size, in pixels.

Parameters
videoSize Size: This value cannot be null.

Returns
MediaItemInfo.Builder This value cannot be null.