From 83fb94d188e18a44458f903ff4baa6e8402a31ce Mon Sep 17 00:00:00 2001 From: Jamie Gennis Date: Sun, 28 Aug 2011 17:38:33 -0700 Subject: [PATCH] MediaPlayer: remove the setTexture method This change removes the MediaPlayer#setTexture method. It has been replaced with MediaPlayer#setSurface. Change-Id: Iaecbbac7629d7092883f270694c5c67391f4ed6c --- api/current.txt | 1 - media/java/android/media/MediaPlayer.java | 34 ----------------------- 2 files changed, 35 deletions(-) diff --git a/api/current.txt b/api/current.txt index f380cf94836d9..3ffd977ead549 100644 --- a/api/current.txt +++ b/api/current.txt @@ -10683,7 +10683,6 @@ package android.media { method public void setOnVideoSizeChangedListener(android.media.MediaPlayer.OnVideoSizeChangedListener); method public void setScreenOnWhilePlaying(boolean); method public void setSurface(android.view.Surface); - method public void setTexture(android.graphics.SurfaceTexture); 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 e25f654f812f8..ec1c27a8e3cb2 100644 --- a/media/java/android/media/MediaPlayer.java +++ b/media/java/android/media/MediaPlayer.java @@ -657,40 +657,6 @@ public class MediaPlayer updateSurfaceScreenOn(); } - /** - * Sets the {@link SurfaceTexture} to be used as the sink for the - * video portion of the media. Either a surface or surface texture - * must be set if a video sink is needed. The same surface texture - * can be re-set without harm. Setting a surface texture will un-set - * any surface that was set via {@link #setDisplay(SurfaceHolder)}. - * Not calling this method or {@link #setDisplay(SurfaceHolder)} - * when playing back a video will result in only the audio track - * being played. Note that if a SurfaceTexture is used, the value - * set via setScreenOnWhilePlaying has no effect. - * - * The timestamps provided by {@link SurfaceTexture#getTimestamp()} for a - * SurfaceTexture set as the video sink have an unspecified zero point, - * and cannot be directly compared between different media sources or different - * instances of the same media source, or across multiple runs of the same - * program. The timestamp is normally monotonically increasing and unaffected - * by time-of-day adjustments, but is reset when the position is set. - */ - public void setTexture(SurfaceTexture st) { - // TODO: This method should be hidden before it is published and setSurface - // should be unhidden and made public instead. - if (st != null) { - Surface surface = new Surface(st); - setSurface(surface); - - // It is safe and desired to release the newly created Surface here since the - // native code will grab a reference to the underlying ISurfaceTexture. At that - // point the Surface we just created is no longer needed. - surface.release(); - } else { - setSurface(null); - } - } - /** * Convenience method to create a MediaPlayer for a given Uri. * On success, {@link #prepare()} will already have been called and must not be called again.