summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrik Ryd <patrik.ryd@linaro.org>2012-06-29 13:46:02 +0200
committerPatrik Ryd <patrik.ryd@linaro.org>2012-06-29 13:46:32 +0200
commit67f48cbb09c8d1d0629c6fb000c625221ce9f921 (patch)
treea359d9b73f960a5d66579dd755a2f78d2bb15506
parentfab8206b662c3cb4191185ac10db8d386656a44b (diff)
downloadbase-linaro_android_4.0.4_snowball_mm.tar.gz
Snowball: changes for awesomeplayerlinaro_android_4.0.4_snowball_mm
To avoid hang of android applications add setSurface in Awesomeplayer Signed-off-by: Raghavendra Patil <raghavendra.patil_2@stericsson.com> Change-Id: I9401af3e1f5235943c898bea5b52925a1f7d69cf Signed-off-by: Patrik Ryd <patrik.ryd@linaro.org>
-rw-r--r--media/libstagefright/AwesomePlayer.cpp13
-rw-r--r--media/libstagefright/include/AwesomePlayer.h7
2 files changed, 19 insertions, 1 deletions
diff --git a/media/libstagefright/AwesomePlayer.cpp b/media/libstagefright/AwesomePlayer.cpp
index ae78c8e9cfe5..ec1915f6874d 100644
--- a/media/libstagefright/AwesomePlayer.cpp
+++ b/media/libstagefright/AwesomePlayer.cpp
@@ -1143,9 +1143,22 @@ bool AwesomePlayer::isPlaying() const {
return (mFlags & PLAYING) || (mFlags & CACHE_UNDERRUN);
}
+#ifdef STERICSSON_CODEC_SUPPORT
+status_t AwesomePlayer::setSurface(const sp<Surface> &surface) {
+ Mutex::Autolock autoLock(mLock);
+
+ mSurface = surface;
+ return setNativeWindow_l(surface);
+}
+#endif
+
status_t AwesomePlayer::setSurfaceTexture(const sp<ISurfaceTexture> &surfaceTexture) {
Mutex::Autolock autoLock(mLock);
+#ifdef STERICSSON_CODEC_SUPPORT
+ mSurface.clear();
+#endif
+
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..549a3356c700 100644
--- a/media/libstagefright/include/AwesomePlayer.h
+++ b/media/libstagefright/include/AwesomePlayer.h
@@ -80,7 +80,9 @@ struct AwesomePlayer {
status_t pause();
bool isPlaying() const;
-
+#ifdef STERICSSON_CODEC_SUPPORT
+ status_t setSurface(const sp<Surface> &surface);
+#endif
status_t setSurfaceTexture(const sp<ISurfaceTexture> &surfaceTexture);
void setAudioSink(const sp<MediaPlayerBase::AudioSink> &audioSink);
status_t setLooping(bool shouldLoop);
@@ -153,6 +155,9 @@ private:
bool mUIDValid;
uid_t mUID;
+#ifdef STERICSSON_CODEC_SUPPORT
+ sp<Surface> mSurface;
+#endif
sp<ANativeWindow> mNativeWindow;
sp<MediaPlayerBase::AudioSink> mAudioSink;