Loading media/codec2/sfplugin/CCodecBufferChannel.cpp +4 −0 Original line number Original line Diff line number Diff line Loading @@ -1402,6 +1402,7 @@ void CCodecBufferChannel::stop() { if (mInputSurface != nullptr) { if (mInputSurface != nullptr) { mInputSurface.reset(); mInputSurface.reset(); } } mPipelineWatcher.lock()->flush(); } } void CCodecBufferChannel::reset() { void CCodecBufferChannel::reset() { Loading @@ -1409,6 +1410,7 @@ void CCodecBufferChannel::reset() { { { Mutexed<Input>::Locked input(mInput); Mutexed<Input>::Locked input(mInput); input->buffers.reset(new DummyInputBuffers("")); input->buffers.reset(new DummyInputBuffers("")); input->extraBuffers.flush(); } } { { Mutexed<Output>::Locked output(mOutput); Mutexed<Output>::Locked output(mOutput); Loading @@ -1425,6 +1427,8 @@ void CCodecBufferChannel::release() { blockPools->inputPool.reset(); blockPools->inputPool.reset(); blockPools->outputPoolIntf.reset(); blockPools->outputPoolIntf.reset(); } } setCrypto(nullptr); setDescrambler(nullptr); } } Loading media/libstagefright/MediaCodec.cpp +12 −11 Original line number Original line Diff line number Diff line Loading @@ -3036,11 +3036,11 @@ void MediaCodec::onMessageReceived(const sp<AMessage> &msg) { int32_t async = 0; int32_t async = 0; if (msg->findInt32("async", &async) && async) { if (msg->findInt32("async", &async) && async) { if ((mState == CONFIGURED || mState == STARTED || mState == FLUSHED) if (mSurface != NULL) { && mSurface != NULL) { if (!mReleaseSurface) { if (!mReleaseSurface) { mReleaseSurface.reset(new ReleaseSurface); mReleaseSurface.reset(new ReleaseSurface); } } if (mSurface != mReleaseSurface->getSurface()) { status_t err = connectToSurface(mReleaseSurface->getSurface()); status_t err = connectToSurface(mReleaseSurface->getSurface()); ALOGW_IF(err != OK, "error connecting to release surface: err = %d", err); ALOGW_IF(err != OK, "error connecting to release surface: err = %d", err); if (err == OK && !(mFlags & kFlagUsesSoftwareRenderer)) { if (err == OK && !(mFlags & kFlagUsesSoftwareRenderer)) { Loading @@ -3053,6 +3053,7 @@ void MediaCodec::onMessageReceived(const sp<AMessage> &msg) { } } } } } } } mReplyID = replyID; mReplyID = replyID; setState(msg->what() == kWhatStop ? STOPPING : RELEASING); setState(msg->what() == kWhatStop ? STOPPING : RELEASING); Loading Loading
media/codec2/sfplugin/CCodecBufferChannel.cpp +4 −0 Original line number Original line Diff line number Diff line Loading @@ -1402,6 +1402,7 @@ void CCodecBufferChannel::stop() { if (mInputSurface != nullptr) { if (mInputSurface != nullptr) { mInputSurface.reset(); mInputSurface.reset(); } } mPipelineWatcher.lock()->flush(); } } void CCodecBufferChannel::reset() { void CCodecBufferChannel::reset() { Loading @@ -1409,6 +1410,7 @@ void CCodecBufferChannel::reset() { { { Mutexed<Input>::Locked input(mInput); Mutexed<Input>::Locked input(mInput); input->buffers.reset(new DummyInputBuffers("")); input->buffers.reset(new DummyInputBuffers("")); input->extraBuffers.flush(); } } { { Mutexed<Output>::Locked output(mOutput); Mutexed<Output>::Locked output(mOutput); Loading @@ -1425,6 +1427,8 @@ void CCodecBufferChannel::release() { blockPools->inputPool.reset(); blockPools->inputPool.reset(); blockPools->outputPoolIntf.reset(); blockPools->outputPoolIntf.reset(); } } setCrypto(nullptr); setDescrambler(nullptr); } } Loading
media/libstagefright/MediaCodec.cpp +12 −11 Original line number Original line Diff line number Diff line Loading @@ -3036,11 +3036,11 @@ void MediaCodec::onMessageReceived(const sp<AMessage> &msg) { int32_t async = 0; int32_t async = 0; if (msg->findInt32("async", &async) && async) { if (msg->findInt32("async", &async) && async) { if ((mState == CONFIGURED || mState == STARTED || mState == FLUSHED) if (mSurface != NULL) { && mSurface != NULL) { if (!mReleaseSurface) { if (!mReleaseSurface) { mReleaseSurface.reset(new ReleaseSurface); mReleaseSurface.reset(new ReleaseSurface); } } if (mSurface != mReleaseSurface->getSurface()) { status_t err = connectToSurface(mReleaseSurface->getSurface()); status_t err = connectToSurface(mReleaseSurface->getSurface()); ALOGW_IF(err != OK, "error connecting to release surface: err = %d", err); ALOGW_IF(err != OK, "error connecting to release surface: err = %d", err); if (err == OK && !(mFlags & kFlagUsesSoftwareRenderer)) { if (err == OK && !(mFlags & kFlagUsesSoftwareRenderer)) { Loading @@ -3053,6 +3053,7 @@ void MediaCodec::onMessageReceived(const sp<AMessage> &msg) { } } } } } } } mReplyID = replyID; mReplyID = replyID; setState(msg->what() == kWhatStop ? STOPPING : RELEASING); setState(msg->what() == kWhatStop ? STOPPING : RELEASING); Loading