Skip to content

Commit 2e6f49c

Browse files
Jamie GennisAndroid (Google) Code Review
authored andcommitted
Merge "MediaPlayer: remove the setTexture method"
2 parents 05dbb65 + 83fb94d commit 2e6f49c

File tree

2 files changed

+0
-35
lines changed

2 files changed

+0
-35
lines changed

api/current.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10684,7 +10684,6 @@ package android.media {
1068410684
method public void setOnVideoSizeChangedListener(android.media.MediaPlayer.OnVideoSizeChangedListener);
1068510685
method public void setScreenOnWhilePlaying(boolean);
1068610686
method public void setSurface(android.view.Surface);
10687-
method public void setTexture(android.graphics.SurfaceTexture);
1068810687
method public void setVolume(float, float);
1068910688
method public void setWakeMode(android.content.Context, int);
1069010689
method public void start() throws java.lang.IllegalStateException;

media/java/android/media/MediaPlayer.java

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -657,40 +657,6 @@ public void setSurface(Surface surface) {
657657
updateSurfaceScreenOn();
658658
}
659659

660-
/**
661-
* Sets the {@link SurfaceTexture} to be used as the sink for the
662-
* video portion of the media. Either a surface or surface texture
663-
* must be set if a video sink is needed. The same surface texture
664-
* can be re-set without harm. Setting a surface texture will un-set
665-
* any surface that was set via {@link #setDisplay(SurfaceHolder)}.
666-
* Not calling this method or {@link #setDisplay(SurfaceHolder)}
667-
* when playing back a video will result in only the audio track
668-
* being played. Note that if a SurfaceTexture is used, the value
669-
* set via setScreenOnWhilePlaying has no effect.
670-
*
671-
* The timestamps provided by {@link SurfaceTexture#getTimestamp()} for a
672-
* SurfaceTexture set as the video sink have an unspecified zero point,
673-
* and cannot be directly compared between different media sources or different
674-
* instances of the same media source, or across multiple runs of the same
675-
* program. The timestamp is normally monotonically increasing and unaffected
676-
* by time-of-day adjustments, but is reset when the position is set.
677-
*/
678-
public void setTexture(SurfaceTexture st) {
679-
// TODO: This method should be hidden before it is published and setSurface
680-
// should be unhidden and made public instead.
681-
if (st != null) {
682-
Surface surface = new Surface(st);
683-
setSurface(surface);
684-
685-
// It is safe and desired to release the newly created Surface here since the
686-
// native code will grab a reference to the underlying ISurfaceTexture. At that
687-
// point the Surface we just created is no longer needed.
688-
surface.release();
689-
} else {
690-
setSurface(null);
691-
}
692-
}
693-
694660
/**
695661
* Convenience method to create a MediaPlayer for a given Uri.
696662
* On success, {@link #prepare()} will already have been called and must not be called again.

0 commit comments

Comments
 (0)