Loading media/codec2/sfplugin/CCodecBufferChannel.cpp +13 −0 Original line number Diff line number Diff line Loading @@ -2041,6 +2041,9 @@ void CCodecBufferChannel::sendOutputBuffers() { sp<MediaCodecBuffer> outBuffer; std::shared_ptr<C2Buffer> c2Buffer; constexpr int kMaxReallocTry = 5; int reallocTryNum = 0; while (true) { Mutexed<Output>::Locked output(mOutput); if (!output->buffers) { Loading @@ -2048,6 +2051,9 @@ void CCodecBufferChannel::sendOutputBuffers() { } action = output->buffers->popFromStashAndRegister( &c2Buffer, &index, &outBuffer); if (action != OutputBuffers::REALLOCATE) { reallocTryNum = 0; } switch (action) { case OutputBuffers::SKIP: return; Loading @@ -2058,6 +2064,13 @@ void CCodecBufferChannel::sendOutputBuffers() { mCallback->onOutputBufferAvailable(index, outBuffer); break; case OutputBuffers::REALLOCATE: if (++reallocTryNum > kMaxReallocTry) { output.unlock(); ALOGE("[%s] sendOutputBuffers: tried %d realloc and failed", mName, kMaxReallocTry); mCCodecCallback->onError(UNKNOWN_ERROR, ACTION_CODE_FATAL); return; } if (!output->buffers->isArrayMode()) { output->buffers = output->buffers->toArrayMode(output->numSlots); Loading Loading
media/codec2/sfplugin/CCodecBufferChannel.cpp +13 −0 Original line number Diff line number Diff line Loading @@ -2041,6 +2041,9 @@ void CCodecBufferChannel::sendOutputBuffers() { sp<MediaCodecBuffer> outBuffer; std::shared_ptr<C2Buffer> c2Buffer; constexpr int kMaxReallocTry = 5; int reallocTryNum = 0; while (true) { Mutexed<Output>::Locked output(mOutput); if (!output->buffers) { Loading @@ -2048,6 +2051,9 @@ void CCodecBufferChannel::sendOutputBuffers() { } action = output->buffers->popFromStashAndRegister( &c2Buffer, &index, &outBuffer); if (action != OutputBuffers::REALLOCATE) { reallocTryNum = 0; } switch (action) { case OutputBuffers::SKIP: return; Loading @@ -2058,6 +2064,13 @@ void CCodecBufferChannel::sendOutputBuffers() { mCallback->onOutputBufferAvailable(index, outBuffer); break; case OutputBuffers::REALLOCATE: if (++reallocTryNum > kMaxReallocTry) { output.unlock(); ALOGE("[%s] sendOutputBuffers: tried %d realloc and failed", mName, kMaxReallocTry); mCCodecCallback->onError(UNKNOWN_ERROR, ACTION_CODE_FATAL); return; } if (!output->buffers->isArrayMode()) { output->buffers = output->buffers->toArrayMode(output->numSlots); Loading