MediaTimestamp
class MediaTimestamp
kotlin.Any | |
↳ | android.media.MediaTimestamp |
An immutable object that represents the linear correlation between the media time and the system time. It contains the media clock rate, together with the media timestamp of an anchor frame and the system time when that frame was presented or is committed to be presented.
The phrase "present" means that audio/video produced on device is detectable by an external observer off device. The time is based on the implementation's best effort, using whatever knowledge is available to the system, but cannot account for any delay unknown to the implementation. The anchor frame could be any frame, including a just-rendered frame, or even a theoretical or in-between frame, based on the source of the MediaTimestamp. When the anchor frame is a just-rendered one, the media time stands for current position of the playback or recording.
Summary
Public constructors | |
---|---|
MediaTimestamp(mediaTimeUs: Long, nanoTimeNs: Long, clockRate: Float) Constructor. |
Public methods | |
---|---|
Boolean | |
Long |
Get the media time of the anchor in microseconds. |
Long |
Get the |
Long |
Get the |
Float |
Get the rate of the media clock in relation to the system time. |
String |
toString() |
Properties | |
---|---|
static MediaTimestamp! |
An unknown media timestamp value |
Public constructors
MediaTimestamp
MediaTimestamp(
mediaTimeUs: Long,
nanoTimeNs: Long,
clockRate: Float)
Constructor.
Parameters | |
---|---|
mediaTimeUs |
Long: the media time of the anchor in microseconds |
nanoTimeNs |
Long: the system time corresponding to the media time in nanoseconds. |
clockRate |
Float: the rate of the media clock in relation to the system time. Value is between 0.0f and Float.MAX_VALUE inclusive |
Public methods
equals
fun equals(other: Any?): Boolean
Parameters | |
---|---|
obj |
the reference object with which to compare. |
Return | |
---|---|
Boolean |
true if this object is the same as the obj argument; false otherwise. |
getAnchorMediaTimeUs
fun getAnchorMediaTimeUs(): Long
Get the media time of the anchor in microseconds.
getAnchorSystemNanoTime
fun getAnchorSystemNanoTime(): Long
Get the system time
corresponding to the media time in nanoseconds.
getAnchorSytemNanoTime
fungetAnchorSytemNanoTime(): Long
Deprecated: use getAnchorSystemNanoTime
instead.
Get the system time
corresponding to the media time in nanoseconds.
getMediaClockRate
fun getMediaClockRate(): Float
Get the rate of the media clock in relation to the system time.
It is 1.0 if media clock advances in sync with the system clock; greater than 1.0 if media clock is faster than the system clock; less than 1.0 if media clock is slower than the system clock.
Return | |
---|---|
Float |
Value is between 0.0f and Float.MAX_VALUE inclusive |
toString
fun toString(): String
Return | |
---|---|
String |
a string representation of the object. |
Properties
TIMESTAMP_UNKNOWN
static val TIMESTAMP_UNKNOWN: MediaTimestamp!
An unknown media timestamp value