Skip to content

Most visited

Recently visited

navigation

MediaTimestamp

public final class MediaTimestamp
extends Object

java.lang.Object
   ↳ 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.

See also:

Summary

Public methods

long getAnchorMediaTimeUs()

Get the media time of the anchor in microseconds.

long getAnchorSytemNanoTime()

Get the system time corresponding to the media time in nanoseconds.

float getMediaClockRate()

Get the rate of the media clock in relation to the system time.

Inherited methods

From class java.lang.Object

Public methods

getAnchorMediaTimeUs

added in API level 23
long getAnchorMediaTimeUs ()

Get the media time of the anchor in microseconds.

Returns
long

getAnchorSytemNanoTime

added in API level 23
long getAnchorSytemNanoTime ()

Get the system time corresponding to the media time in nanoseconds.

Returns
long

getMediaClockRate

added in API level 23
float getMediaClockRate ()

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.

Returns
float

This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a one-minute survey?
Help us improve Android tools and documentation.