From 1173118eace0e9e347cb007f0da817cee87579ed Mon Sep 17 00:00:00 2001 From: Glenn Kasten Date: Tue, 8 Feb 2011 17:26:17 -0800 Subject: Bug 3438258 Add SurfaceTexture as MediaPlayer sink This change enables the use of a SurfaceTexture in place of a Surface as the video sink for an android.media.MediaPlayer. The new API MediaPlayer.setTexture is currently hidden. This includes: - New Java and C++ interfaces - C++ plumbing and implementation (JNI, Binder) - Stagefright AwesomePlayer and NuPlayer use ANativeWindow (either Surface or SurfaceTextureClient) Change-Id: I2b568bee143d9eaf3dfc6cc4533c1bebbd5afc51 --- media/libmedia/mediaplayer.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'media/libmedia/mediaplayer.cpp') diff --git a/media/libmedia/mediaplayer.cpp b/media/libmedia/mediaplayer.cpp index 87c8fe4..0ee0249 100644 --- a/media/libmedia/mediaplayer.cpp +++ b/media/libmedia/mediaplayer.cpp @@ -201,6 +201,16 @@ status_t MediaPlayer::setVideoSurface(const sp& surface) return mPlayer->setVideoSurface(surface); } +status_t MediaPlayer::setVideoSurfaceTexture( + const sp& surfaceTexture) +{ + LOGV("setVideoSurfaceTexture"); + Mutex::Autolock _l(mLock); + if (mPlayer == 0) return NO_INIT; + + return mPlayer->setVideoSurfaceTexture(surfaceTexture); +} + // must call with lock held status_t MediaPlayer::prepareAsync_l() { -- cgit v1.1