summaryrefslogtreecommitdiffstats
path: root/media/java
diff options
context:
space:
mode:
authorDave Sparks <davidsparks@android.com>2009-05-29 09:01:20 -0700
committerDave Sparks <davidsparks@android.com>2009-05-29 13:51:38 -0700
commit8b0b174198793cabb2b3fcc015f9bfdc9d5082b5 (patch)
treea19ad8ea5e30a5ae94a4669fdb44ef1f35651166 /media/java
parentb0ded43d3844d9d97c5d554e8ca4ec3ee2c7bbe1 (diff)
downloadframeworks_base-8b0b174198793cabb2b3fcc015f9bfdc9d5082b5.zip
frameworks_base-8b0b174198793cabb2b3fcc015f9bfdc9d5082b5.tar.gz
frameworks_base-8b0b174198793cabb2b3fcc015f9bfdc9d5082b5.tar.bz2
Update MediaPlayer to allow setVideoSurface calls after prepare. Also allow
passing a null surface. The API is now enabled to change the surface while the video is playing. This could allow orientation changes during playback or to allow the audio track from a video to play in the background. NOTE: There are still changes required to pmem driver to allow remapping shared physical memory into a process in order for this to work. This change only enables the API to send the appropriate calls when the lower level code supports it.
Diffstat (limited to 'media/java')
-rw-r--r--media/java/android/media/MediaPlayer.java12
1 files changed, 11 insertions, 1 deletions
diff --git a/media/java/android/media/MediaPlayer.java b/media/java/android/media/MediaPlayer.java
index 19ab0ad..d3743e6 100644
--- a/media/java/android/media/MediaPlayer.java
+++ b/media/java/android/media/MediaPlayer.java
@@ -468,6 +468,11 @@ public class MediaPlayer
*/
native_setup(new WeakReference<MediaPlayer>(this));
}
+
+ /*
+ * Update the MediaPlayer ISurface. Call after updating mSurface.
+ */
+ private native void _setVideoSurface();
/**
* Sets the SurfaceHolder to use for displaying the video portion of the media.
@@ -478,7 +483,12 @@ public class MediaPlayer
*/
public void setDisplay(SurfaceHolder sh) {
mSurfaceHolder = sh;
- mSurface = sh.getSurface();
+ if (sh != null) {
+ mSurface = sh.getSurface();
+ } else {
+ mSurface = null;
+ }
+ _setVideoSurface();
updateSurfaceScreenOn();
}