summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaghavendra Patil <raghavendra.patil_2@stericsson.com>2012-04-10 09:08:54 -0600
committerMathieu J. Poirier <mathieu.poirier@linaro.org>2012-04-10 09:14:37 -0600
commite26f4921731f71b29ef0fe38d8d35cff6c5addce (patch)
treeec8c54efa9a3d3d091f44141aa9eef5b3b7b1da2
parente8cfc22c08e32b463186362ed40abb4d34eedca8 (diff)
downloadbase-e26f4921731f71b29ef0fe38d8d35cff6c5addce.tar.gz
changes for awesomeplayer
To avoid hang of android applications add setSurface in Awesomeplayer Change-Id: I4dad4c64d65277499faf0d84291aa9690dc2b670 Signed-off-by: Raghavendra Patil <raghavendra.patil_2@stericsson.com> Committed-by: Mathieu Poirier <mathieu.poirier@linaro.org>
-rwxr-xr-x[-rw-r--r--]media/libstagefright/AwesomePlayer.cpp9
-rwxr-xr-x[-rw-r--r--]media/libstagefright/include/AwesomePlayer.h2
2 files changed, 11 insertions, 0 deletions
diff --git a/media/libstagefright/AwesomePlayer.cpp b/media/libstagefright/AwesomePlayer.cpp
index 91e622bede6e..4197da524e01 100644..100755
--- a/media/libstagefright/AwesomePlayer.cpp
+++ b/media/libstagefright/AwesomePlayer.cpp
@@ -1141,9 +1141,18 @@ bool AwesomePlayer::isPlaying() const {
return (mFlags & PLAYING) || (mFlags & CACHE_UNDERRUN);
}
+status_t AwesomePlayer::setSurface(const sp<Surface> &surface) {
+ Mutex::Autolock autoLock(mLock);
+
+ mSurface = surface;
+ return setNativeWindow_l(surface);
+}
+
status_t AwesomePlayer::setSurfaceTexture(const sp<ISurfaceTexture> &surfaceTexture) {
Mutex::Autolock autoLock(mLock);
+ mSurface.clear();
+
status_t err;
if (surfaceTexture != NULL) {
err = setNativeWindow_l(new SurfaceTextureClient(surfaceTexture));
diff --git a/media/libstagefright/include/AwesomePlayer.h b/media/libstagefright/include/AwesomePlayer.h
index 0985f479d561..d9c54e1a9dea 100644..100755
--- a/media/libstagefright/include/AwesomePlayer.h
+++ b/media/libstagefright/include/AwesomePlayer.h
@@ -81,6 +81,7 @@ struct AwesomePlayer {
bool isPlaying() const;
+ status_t setSurface(const sp<Surface> &surface);
status_t setSurfaceTexture(const sp<ISurfaceTexture> &surfaceTexture);
void setAudioSink(const sp<MediaPlayerBase::AudioSink> &audioSink);
status_t setLooping(bool shouldLoop);
@@ -153,6 +154,7 @@ private:
bool mUIDValid;
uid_t mUID;
+ sp<Surface> mSurface;
sp<ANativeWindow> mNativeWindow;
sp<MediaPlayerBase::AudioSink> mAudioSink;