am 879d52f1: am af047944: Merge "media: change final fields to accessors in MediaTimestamp" into mnc-dev

* commit '879d52f1763a07d5abf8b941244cacc409f5058f':
  media: change final fields to accessors in MediaTimestamp
This commit is contained in:
Lajos Molnar
2015-05-14 21:33:13 +00:00
committed by Android Git Automerger
5 changed files with 52 additions and 40 deletions

View File

@@ -16459,9 +16459,9 @@ package android.media {
}
public final class MediaTimestamp {
field public final float clockRate;
field public final long mediaTimeUs;
field public final long nanoTime;
method public long getAnchorMediaTimeUs();
method public long getAnchorSytemNanoTime();
method public float getMediaClockRate();
}
public final class NotProvisionedException extends android.media.MediaDrmException {

View File

@@ -17699,9 +17699,9 @@ package android.media {
}
public final class MediaTimestamp {
field public final float clockRate;
field public final long mediaTimeUs;
field public final long nanoTime;
method public long getAnchorMediaTimeUs();
method public long getAnchorSytemNanoTime();
method public float getMediaClockRate();
}
public final class NotProvisionedException extends android.media.MediaDrmException {

View File

@@ -1481,23 +1481,22 @@ public class MediaPlayer implements SubtitleController.Listener
public native void seekTo(int msec) throws IllegalStateException;
/**
* Get current playback position.
* Get current playback position as a {@link MediaTimestamp}.
* <p>
* The MediaTimestamp represents how the media time correlates to the system time in
* a linear fashion. It contains the media time and system timestamp of an anchor frame
* ({@link MediaTimestamp#mediaTimeUs} and {@link MediaTimestamp#nanoTime})
* and the speed of the media clock ({@link MediaTimestamp#clockRate}).
* a linear fashion using an anchor and a clock rate. During regular playback, the media
* time moves fairly constantly (though the anchor frame may be rebased to a current
* system time, the linear correlation stays steady). Therefore, this method does not
* need to be called often.
* <p>
* During regular playback, the media time moves fairly constantly (though the
* anchor frame may be rebased to a current system time, the linear correlation stays
* steady). Therefore, this method does not need to be called often.
* <p>
* To help users to get current playback position, this method always returns the timestamp of
* just-rendered frame, i.e., {@link System#nanoTime} and its corresponding media time. They
* can be used as current playback position.
* To help users get current playback position, this method always anchors the timestamp
* to the current {@link System#nanoTime system time}, so
* {@link MediaTimestamp#getAnchorMediaTimeUs} can be used as current playback position.
*
* @return a MediaTimestamp object if a timestamp is available, or {@code null} if no timestamp
* is available, e.g. because the media player has not been initialized.
*
* @see MediaTimestamp
*/
@Nullable
public MediaTimestamp getTimestamp()

View File

@@ -524,24 +524,23 @@ public final class MediaSync {
}
/**
* Get current playback position.
* <p>
* The MediaTimestamp represents how the media time correlates to the system time in
* a linear fashion. It contains the media time and system timestamp of an anchor frame
* ({@link MediaTimestamp#mediaTimeUs} and {@link MediaTimestamp#nanoTime})
* and the speed of the media clock ({@link MediaTimestamp#clockRate}).
* <p>
* During regular playback, the media time moves fairly constantly (though the
* anchor frame may be rebased to a current system time, the linear correlation stays
* steady). Therefore, this method does not need to be called often.
* <p>
* To help users to get current playback position, this method always returns the timestamp of
* just-rendered frame, i.e., {@link System#nanoTime} and its corresponding media time. They
* can be used as current playback position.
*
* @return a MediaTimestamp object if a timestamp is available, or {@code null} if no timestamp
* is available, e.g. because the media sync has not been initialized.
*/
* Get current playback position.
* <p>
* The MediaTimestamp represents how the media time correlates to the system time in
* a linear fashion using an anchor and a clock rate. During regular playback, the media
* time moves fairly constantly (though the anchor frame may be rebased to a current
* system time, the linear correlation stays steady). Therefore, this method does not
* need to be called often.
* <p>
* To help users get current playback position, this method always anchors the timestamp
* to the current {@link System#nanoTime system time}, so
* {@link MediaTimestamp#getAnchorMediaTimeUs} can be used as current playback position.
*
* @return a MediaTimestamp object if a timestamp is available, or {@code null} if no timestamp
* is available, e.g. because the media player has not been initialized.
*
* @see MediaTimestamp
*/
@Nullable
public MediaTimestamp getTimestamp()
{

View File

@@ -37,22 +37,36 @@ package android.media;
public final class MediaTimestamp
{
/**
* Media time in microseconds.
* Get the media time of the anchor in microseconds.
*/
public final long mediaTimeUs;
public long getAnchorMediaTimeUs() {
return mediaTimeUs;
}
/**
* The {@link java.lang.System#nanoTime system time} corresponding to the media time
* Get the {@link java.lang.System#nanoTime system time} corresponding to the media time
* in nanoseconds.
*/
public final long nanoTime;
public long getAnchorSytemNanoTime() {
return nanoTime;
}
/**
* The rate of the media clock in relation to the system time.
* Get the rate of the media clock in relation to the system time.
* <p>
* 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.
*/
public float getMediaClockRate() {
return clockRate;
}
/** @hide - accessor shorthand */
public final long mediaTimeUs;
/** @hide - accessor shorthand */
public final long nanoTime;
/** @hide - accessor shorthand */
public final float clockRate;
/** @hide */