# Print output for @column tags ?>
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.
Fields | |
---|---|
public
static
final
MediaTimestamp |
TIMESTAMP_UNKNOWN
An unknown media timestamp value |
Public constructors | |
---|---|
MediaTimestamp(long mediaTimeUs, long nanoTimeNs, float clockRate)
Constructor. |
Public methods | |
---|---|
boolean
|
equals(Object obj)
Indicates whether some other object is "equal to" this one. |
long
|
getAnchorMediaTimeUs()
Get the media time of the anchor in microseconds. |
long
|
getAnchorSystemNanoTime()
Get the |
long
|
getAnchorSytemNanoTime()
This method is deprecated.
use |
float
|
getMediaClockRate()
Get the rate of the media clock in relation to the system time. |
String
|
toString()
Returns a string representation of the object. |
Inherited methods | |
---|---|
public static final MediaTimestamp TIMESTAMP_UNKNOWN
An unknown media timestamp value
public MediaTimestamp (long mediaTimeUs, long nanoTimeNs, float clockRate)
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 boolean equals (Object obj)
Indicates whether some other object is "equal to" this one.
The equals
method implements an equivalence relation
on non-null object references:
x
, x.equals(x)
should return
true
.
x
and y
, x.equals(y)
should return true
if and only if
y.equals(x)
returns true
.
x
, y
, and z
, if
x.equals(y)
returns true
and
y.equals(z)
returns true
, then
x.equals(z)
should return true
.
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.
x
,
x.equals(null)
should return false
.
The equals
method for class Object
implements
the most discriminating possible equivalence relation on objects;
that is, for any non-null reference values x
and
y
, this method returns true
if and only
if x
and y
refer to the same object
(x == y
has the value true
).
Note that it is generally necessary to override the hashCode
method whenever this method is overridden, so as to maintain the
general contract for the hashCode
method, which states
that equal objects must have equal hash codes.
Parameters | |
---|---|
obj |
Object : the reference object with which to compare. |
Returns | |
---|---|
boolean |
true if this object is the same as the obj
argument; false otherwise. |
public long getAnchorMediaTimeUs ()
Get the media time of the anchor in microseconds.
Returns | |
---|---|
long |
public long getAnchorSystemNanoTime ()
Get the system time
corresponding to the media time
in nanoseconds.
Returns | |
---|---|
long |
public long getAnchorSytemNanoTime ()
This method is deprecated.
use getAnchorSystemNanoTime()
instead.
Get the system time
corresponding to the media time
in nanoseconds.
Returns | |
---|---|
long |
public 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 |
Value is between 0.0f and Float.MAX_VALUE inclusive |
public String toString ()
Returns a string representation of the object. In general, the
toString
method returns a string that
"textually represents" this object. The result should
be a concise but informative representation that is easy for a
person to read.
It is recommended that all subclasses override this method.
The toString
method for class Object
returns a string consisting of the name of the class of which the
object is an instance, the at-sign character `@
', and
the unsigned hexadecimal representation of the hash code of the
object. In other words, this method returns a string equal to the
value of:
getClass().getName() + '@' + Integer.toHexString(hashCode())
Returns | |
---|---|
String |
a string representation of the object. |