diff options
-rw-r--r-- | media/libstagefright/AwesomePlayer.cpp | 13 | ||||
-rw-r--r-- | media/libstagefright/include/AwesomePlayer.h | 7 |
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; |