Loading media/libmediaplayerservice/StagefrightPlayer.cpp +2 −4 Original line number Diff line number Diff line Loading @@ -72,16 +72,14 @@ status_t StagefrightPlayer::setDataSource(const sp<IStreamSource> &source) { status_t StagefrightPlayer::setVideoSurface(const sp<Surface> &surface) { LOGV("setVideoSurface"); mPlayer->setSurface(surface); return OK; return mPlayer->setSurface(surface); } status_t StagefrightPlayer::setVideoSurfaceTexture( const sp<ISurfaceTexture> &surfaceTexture) { LOGV("setVideoSurfaceTexture"); mPlayer->setSurfaceTexture(surfaceTexture); return OK; return mPlayer->setSurfaceTexture(surfaceTexture); } status_t StagefrightPlayer::prepare() { Loading media/libstagefright/AwesomePlayer.cpp +19 −8 Original line number Diff line number Diff line Loading @@ -1152,22 +1152,26 @@ bool AwesomePlayer::isPlaying() const { return (mFlags & PLAYING) || (mFlags & CACHE_UNDERRUN); } void AwesomePlayer::setSurface(const sp<Surface> &surface) { status_t AwesomePlayer::setSurface(const sp<Surface> &surface) { Mutex::Autolock autoLock(mLock); mSurface = surface; setNativeWindow_l(surface); return setNativeWindow_l(surface); } void AwesomePlayer::setSurfaceTexture(const sp<ISurfaceTexture> &surfaceTexture) { status_t AwesomePlayer::setSurfaceTexture(const sp<ISurfaceTexture> &surfaceTexture) { Mutex::Autolock autoLock(mLock); mSurface.clear(); status_t err; if (surfaceTexture != NULL) { setNativeWindow_l(new SurfaceTextureClient(surfaceTexture)); err = setNativeWindow_l(new SurfaceTextureClient(surfaceTexture)); } else { setNativeWindow_l(NULL); err = setNativeWindow_l(NULL); } return err; } void AwesomePlayer::shutdownVideoDecoder_l() { Loading @@ -1190,11 +1194,11 @@ void AwesomePlayer::shutdownVideoDecoder_l() { LOGI("video decoder shutdown completed"); } void AwesomePlayer::setNativeWindow_l(const sp<ANativeWindow> &native) { status_t AwesomePlayer::setNativeWindow_l(const sp<ANativeWindow> &native) { mNativeWindow = native; if (mVideoSource == NULL) { return; return OK; } LOGI("attempting to reconfigure to use new surface"); Loading @@ -1206,7 +1210,12 @@ void AwesomePlayer::setNativeWindow_l(const sp<ANativeWindow> &native) { shutdownVideoDecoder_l(); CHECK_EQ(initVideoDecoder(), (status_t)OK); status_t err = initVideoDecoder(); if (err != OK) { LOGE("failed to reinstantiate video decoder after surface change."); return err; } if (mLastVideoTimeUs >= 0) { mSeeking = SEEK; Loading @@ -1217,6 +1226,8 @@ void AwesomePlayer::setNativeWindow_l(const sp<ANativeWindow> &native) { if (wasPlaying) { play_l(); } return OK; } void AwesomePlayer::setAudioSink( Loading media/libstagefright/include/AwesomePlayer.h +3 −3 Original line number Diff line number Diff line Loading @@ -84,8 +84,8 @@ struct AwesomePlayer { bool isPlaying() const; void setSurface(const sp<Surface> &surface); void setSurfaceTexture(const sp<ISurfaceTexture> &surfaceTexture); 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); Loading Loading @@ -298,7 +298,7 @@ private: void postAudioSeekComplete_l(); void shutdownVideoDecoder_l(); void setNativeWindow_l(const sp<ANativeWindow> &native); status_t setNativeWindow_l(const sp<ANativeWindow> &native); bool isStreamingHTTP() const; void sendCacheStats(); Loading Loading
media/libmediaplayerservice/StagefrightPlayer.cpp +2 −4 Original line number Diff line number Diff line Loading @@ -72,16 +72,14 @@ status_t StagefrightPlayer::setDataSource(const sp<IStreamSource> &source) { status_t StagefrightPlayer::setVideoSurface(const sp<Surface> &surface) { LOGV("setVideoSurface"); mPlayer->setSurface(surface); return OK; return mPlayer->setSurface(surface); } status_t StagefrightPlayer::setVideoSurfaceTexture( const sp<ISurfaceTexture> &surfaceTexture) { LOGV("setVideoSurfaceTexture"); mPlayer->setSurfaceTexture(surfaceTexture); return OK; return mPlayer->setSurfaceTexture(surfaceTexture); } status_t StagefrightPlayer::prepare() { Loading
media/libstagefright/AwesomePlayer.cpp +19 −8 Original line number Diff line number Diff line Loading @@ -1152,22 +1152,26 @@ bool AwesomePlayer::isPlaying() const { return (mFlags & PLAYING) || (mFlags & CACHE_UNDERRUN); } void AwesomePlayer::setSurface(const sp<Surface> &surface) { status_t AwesomePlayer::setSurface(const sp<Surface> &surface) { Mutex::Autolock autoLock(mLock); mSurface = surface; setNativeWindow_l(surface); return setNativeWindow_l(surface); } void AwesomePlayer::setSurfaceTexture(const sp<ISurfaceTexture> &surfaceTexture) { status_t AwesomePlayer::setSurfaceTexture(const sp<ISurfaceTexture> &surfaceTexture) { Mutex::Autolock autoLock(mLock); mSurface.clear(); status_t err; if (surfaceTexture != NULL) { setNativeWindow_l(new SurfaceTextureClient(surfaceTexture)); err = setNativeWindow_l(new SurfaceTextureClient(surfaceTexture)); } else { setNativeWindow_l(NULL); err = setNativeWindow_l(NULL); } return err; } void AwesomePlayer::shutdownVideoDecoder_l() { Loading @@ -1190,11 +1194,11 @@ void AwesomePlayer::shutdownVideoDecoder_l() { LOGI("video decoder shutdown completed"); } void AwesomePlayer::setNativeWindow_l(const sp<ANativeWindow> &native) { status_t AwesomePlayer::setNativeWindow_l(const sp<ANativeWindow> &native) { mNativeWindow = native; if (mVideoSource == NULL) { return; return OK; } LOGI("attempting to reconfigure to use new surface"); Loading @@ -1206,7 +1210,12 @@ void AwesomePlayer::setNativeWindow_l(const sp<ANativeWindow> &native) { shutdownVideoDecoder_l(); CHECK_EQ(initVideoDecoder(), (status_t)OK); status_t err = initVideoDecoder(); if (err != OK) { LOGE("failed to reinstantiate video decoder after surface change."); return err; } if (mLastVideoTimeUs >= 0) { mSeeking = SEEK; Loading @@ -1217,6 +1226,8 @@ void AwesomePlayer::setNativeWindow_l(const sp<ANativeWindow> &native) { if (wasPlaying) { play_l(); } return OK; } void AwesomePlayer::setAudioSink( Loading
media/libstagefright/include/AwesomePlayer.h +3 −3 Original line number Diff line number Diff line Loading @@ -84,8 +84,8 @@ struct AwesomePlayer { bool isPlaying() const; void setSurface(const sp<Surface> &surface); void setSurfaceTexture(const sp<ISurfaceTexture> &surfaceTexture); 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); Loading Loading @@ -298,7 +298,7 @@ private: void postAudioSeekComplete_l(); void shutdownVideoDecoder_l(); void setNativeWindow_l(const sp<ANativeWindow> &native); status_t setNativeWindow_l(const sp<ANativeWindow> &native); bool isStreamingHTTP() const; void sendCacheStats(); Loading