Added in API level 35

MediaItemInfo


class MediaItemInfo : Parcelable
kotlin.Any
   ↳ android.media.metrics.MediaItemInfo

Represents information about a piece of media (for example, an audio or video file).

Summary

Nested classes

Builder for MediaItemInfo.

Constants
static Long

The media item includes audio data.

static Long

The media item includes depth (z-distance) information.

static Long

The media item includes gain map information (for example, an Ultra HDR gain map).

static Long

The media item includes gapless audio metadata.

static Long

The media item includes high dynamic range (HDR) video.

static Long

The media item includes high frame rate video data.

static Long

The media item includes image data.

static Long

The media item includes static media container metadata (for example, capture frame rate or location information).

static Long

The media item includes spatial audio data.

static Long

The media item includes time-dependent speed information (for example, slow motion cue points).

static Long

The media item includes video data.

static Int

The media item came directly from camera capture.

static Int

The media item was output by a previous editing session.

static Int

The media item came from the device gallery.

static Int

The media item was generated by another system.

static Int

The media item is stored on the local device's file system.

static Int

The media item is a remote file (for example, it's loaded from an HTTP server).

static Int

The media item is a remotely-served live stream.

static Int

The media item's source is not known.

static Int

Special value for numerical fields where the value was not specified.

Inherited constants
Public methods
Int

Boolean
equals(other: Any?)

Indicates whether some other object is "equal to" this one.

Int

Returns the number of audio channels, or VALUE_UNSPECIFIED if not specified.

Long

Returns the number of audio frames in the item, after clipping (if applicable), or VALUE_UNSPECIFIED if not specified.

Int

Returns the sample rate of audio, in Hertz, or VALUE_UNSPECIFIED if not specified.

Long

Returns the duration of the clip taken from the media item, in milliseconds, or VALUE_UNSPECIFIED if not specified.

MutableList<String!>

Returns the media codec names for codecs that were used as part of encoding/decoding this media item, or an empty list if not known or not applicable.

String?

Returns the MIME type of the media container, or null if unspecified.

Long

Returns the data types that are present in the media item.

Long

Returns the duration of the media item, in milliseconds, or VALUE_UNSPECIFIED if not specified.

MutableList<String!>

Returns the MIME types of samples stored in the media container, or an empty list if not known.

Int

Returns where the media item came from, or SOURCE_TYPE_UNSPECIFIED if not specified.

Int

Returns the data space for video, as a packed integer.

Float

Returns the average video frame rate, in frames per second, or VALUE_UNSPECIFIED if not specified.

Long

Returns the number of video frames, aftrer clipping (if applicable), or VALUE_UNSPECIFIED if not specified.

Size

Returns the video size, in pixels, or a Size with width and height set to VALUE_UNSPECIFIED if not specified.

Int

String

Returns a string representation of the object.

Unit
writeToParcel(dest: Parcel, flags: Int)

Flatten this object in to a Parcel.

Properties
static Parcelable.Creator<MediaItemInfo!>

Constants

DATA_TYPE_AUDIO

Added in API level 35
static val DATA_TYPE_AUDIO: Long

The media item includes audio data.

Value: 4L

DATA_TYPE_DEPTH

Added in API level 35
static val DATA_TYPE_DEPTH: Long

The media item includes depth (z-distance) information.

Value: 16L

DATA_TYPE_GAIN_MAP

Added in API level 35
static val DATA_TYPE_GAIN_MAP: Long

The media item includes gain map information (for example, an Ultra HDR gain map).

Value: 32L

DATA_TYPE_GAPLESS

Added in API level 35
static val DATA_TYPE_GAPLESS: Long

The media item includes gapless audio metadata.

Value: 256L

DATA_TYPE_HIGH_DYNAMIC_RANGE_VIDEO

Added in API level 35
static val DATA_TYPE_HIGH_DYNAMIC_RANGE_VIDEO: Long

The media item includes high dynamic range (HDR) video.

Value: 1024L

DATA_TYPE_HIGH_FRAME_RATE

Added in API level 35
static val DATA_TYPE_HIGH_FRAME_RATE: Long

The media item includes high frame rate video data.

Value: 64L

DATA_TYPE_IMAGE

Added in API level 35
static val DATA_TYPE_IMAGE: Long

The media item includes image data.

Value: 1L

DATA_TYPE_METADATA

Added in API level 35
static val DATA_TYPE_METADATA: Long

The media item includes static media container metadata (for example, capture frame rate or location information).

Value: 8L

DATA_TYPE_SPATIAL_AUDIO

Added in API level 35
static val DATA_TYPE_SPATIAL_AUDIO: Long

The media item includes spatial audio data.

Value: 512L

DATA_TYPE_SPEED_SETTING_CUE_POINTS

Added in API level 35
static val DATA_TYPE_SPEED_SETTING_CUE_POINTS: Long

The media item includes time-dependent speed information (for example, slow motion cue points).

Value: 128L

DATA_TYPE_VIDEO

Added in API level 35
static val DATA_TYPE_VIDEO: Long

The media item includes video data.

Value: 2L

SOURCE_TYPE_CAMERA

Added in API level 35
static val SOURCE_TYPE_CAMERA: Int

The media item came directly from camera capture.

Value: 2

SOURCE_TYPE_EDITING_SESSION

Added in API level 35
static val SOURCE_TYPE_EDITING_SESSION: Int

The media item was output by a previous editing session.

Value: 3
Added in API level 35
static val SOURCE_TYPE_GALLERY: Int

The media item came from the device gallery.

Value: 1

SOURCE_TYPE_GENERATED

Added in API level 35
static val SOURCE_TYPE_GENERATED: Int

The media item was generated by another system.

Value: 7

SOURCE_TYPE_LOCAL_FILE

Added in API level 35
static val SOURCE_TYPE_LOCAL_FILE: Int

The media item is stored on the local device's file system.

Value: 4

SOURCE_TYPE_REMOTE_FILE

Added in API level 35
static val SOURCE_TYPE_REMOTE_FILE: Int

The media item is a remote file (for example, it's loaded from an HTTP server).

Value: 5

SOURCE_TYPE_REMOTE_LIVE_STREAM

Added in API level 35
static val SOURCE_TYPE_REMOTE_LIVE_STREAM: Int

The media item is a remotely-served live stream.

Value: 6

SOURCE_TYPE_UNSPECIFIED

Added in API level 35
static val SOURCE_TYPE_UNSPECIFIED: Int

The media item's source is not known.

Value: 0

VALUE_UNSPECIFIED

Added in API level 35
static val VALUE_UNSPECIFIED: Int

Special value for numerical fields where the value was not specified.

Value: -1

Public methods

describeContents

Added in API level 35
fun describeContents(): Int
Return
Int a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR

equals

Added in API level 35
fun equals(other: Any?): Boolean

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
obj the reference object with which to compare.
o This value may be null.
Return
Boolean true if this object is the same as the obj argument; false otherwise.

getAudioChannelCount

Added in API level 35
fun getAudioChannelCount(): Int

Returns the number of audio channels, or VALUE_UNSPECIFIED if not specified.

getAudioSampleCount

Added in API level 35
fun getAudioSampleCount(): Long

Returns the number of audio frames in the item, after clipping (if applicable), or VALUE_UNSPECIFIED if not specified.

getAudioSampleRateHz

Added in API level 35
fun getAudioSampleRateHz(): Int

Returns the sample rate of audio, in Hertz, or VALUE_UNSPECIFIED if not specified.

getClipDurationMillis

Added in API level 35
fun getClipDurationMillis(): Long

Returns the duration of the clip taken from the media item, in milliseconds, or VALUE_UNSPECIFIED if not specified.

getCodecNames

Added in API level 35
fun getCodecNames(): MutableList<String!>

Returns the media codec names for codecs that were used as part of encoding/decoding this media item, or an empty list if not known or not applicable.

Return
MutableList<String!> This value cannot be null.

getContainerMimeType

Added in API level 35
fun getContainerMimeType(): String?

Returns the MIME type of the media container, or null if unspecified.

getDurationMillis

Added in API level 35
fun getDurationMillis(): Long

Returns the duration of the media item, in milliseconds, or VALUE_UNSPECIFIED if not specified.

getSampleMimeTypes

Added in API level 35
fun getSampleMimeTypes(): MutableList<String!>

Returns the MIME types of samples stored in the media container, or an empty list if not known.

Return
MutableList<String!> This value cannot be null.

getVideoDataSpace

Added in API level 35
fun getVideoDataSpace(): Int

Returns the data space for video, as a packed integer.

getVideoFrameRate

Added in API level 35
fun getVideoFrameRate(): Float

Returns the average video frame rate, in frames per second, or VALUE_UNSPECIFIED if not specified.

getVideoSampleCount

Added in API level 35
fun getVideoSampleCount(): Long

Returns the number of video frames, aftrer clipping (if applicable), or VALUE_UNSPECIFIED if not specified.

getVideoSize

Added in API level 35
fun getVideoSize(): Size

Returns the video size, in pixels, or a Size with width and height set to VALUE_UNSPECIFIED if not specified.

Return
Size This value cannot be null.

hashCode

Added in API level 35
fun hashCode(): Int
Return
Int a hash code value for this object.

toString

Added in API level 35
fun toString(): String

Returns a string representation of the object.

Return
String This value cannot be null.

writeToParcel

Added in API level 35
fun writeToParcel(
    dest: Parcel,
    flags: Int
): Unit

Flatten this object in to a Parcel.

Parameters
dest Parcel: This value cannot be null.
flags Int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE. Value is either 0 or a combination of android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES

Properties

CREATOR

Added in API level 35
static val CREATOR: Parcelable.Creator<MediaItemInfo!>