From b283dc64bc97f53804108cebf5b904eb4fb77155 Mon Sep 17 00:00:00 2001 From: Jamie Gennis Date: Sun, 28 Aug 2011 16:28:08 -0700 Subject: [PATCH] MediaPlayer: unhide the setSurface method Change-Id: I2fb695ab918d1099ad7cc51bfd436712a0b640d9 --- api/current.txt | 1 + media/java/android/media/MediaPlayer.java | 21 ++++++++++++++------- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/api/current.txt b/api/current.txt index 6186d2fd9b590..0051194b93d4d 100644 --- a/api/current.txt +++ b/api/current.txt @@ -10676,6 +10676,7 @@ package android.media { method public void setOnVideoSizeChangedListener(android.media.MediaPlayer.OnVideoSizeChangedListener); method public void setScreenOnWhilePlaying(boolean); method public void setTexture(android.graphics.SurfaceTexture); + method public void setSurface(android.view.Surface); method public void setVolume(float, float); method public void setWakeMode(android.content.Context, int); method public void start() throws java.lang.IllegalStateException; diff --git a/media/java/android/media/MediaPlayer.java b/media/java/android/media/MediaPlayer.java index 66bd56a01b3ba..1ee9a1fcc52b6 100644 --- a/media/java/android/media/MediaPlayer.java +++ b/media/java/android/media/MediaPlayer.java @@ -381,7 +381,7 @@ import java.lang.ref.WeakReference; * {}

* This method can be called in any state and calling it does not change * the object state.

- * setTexture

+ * setSurface

* any

* {}

* This method can be called in any state and calling it does not change @@ -608,7 +608,7 @@ public class MediaPlayer * portion of the media. * * Either a surface holder or surface must be set if a display or video sink - * is needed. Not calling this method or {@link #setTexture(SurfaceTexture)} + * is needed. Not calling this method or {@link #setSurface(Surface)} * when playing back a video will result in only the audio track being played. * A null surface holder or surface will result in only the audio track being * played. @@ -629,14 +629,21 @@ public class MediaPlayer /** * Sets the {@link Surface} to be used as the sink for the video portion of - * the media. This is similar to {@link #setDisplay(SurfaceHolder)}, but does not - * support {@link #setScreenOnWhilePlaying(boolean)} or {@link #updateSurfaceScreenOn()}. - * Setting a Surface will un-set any Surface or SurfaceHolder that was previously set. + * the media. This is similar to {@link #setDisplay(SurfaceHolder)}, but + * does not support {@link #setScreenOnWhilePlaying(boolean)}. Setting a + * Surface will un-set any Surface or SurfaceHolder that was previously set. * A null surface will result in only the audio track being played. * - * @param surface The {@link Surface} to be used for the video portion of the media. + * If the Surface sends frames to a {@link SurfaceTexture}, the timestamps + * returned from {@link SurfaceTexture#getTimestamp()} will have an + * unspecified zero point. These timestamps cannot be directly compared + * between different media sources, different instances of the same media + * source, or multiple runs of the same program. The timestamp is normally + * monotonically increasing and is unaffected by time-of-day adjustments, + * but it is reset when the position is set. * - * @hide Pending review by API council. + * @param surface The {@link Surface} to be used for the video portion of + * the media. */ public void setSurface(Surface surface) { if (mScreenOnWhilePlaying && surface != null) {