Loading media/codec2/components/aac/C2SoftAacEnc.cpp +8 −1 Original line number Diff line number Diff line Loading @@ -151,6 +151,7 @@ C2SoftAacEnc::C2SoftAacEnc( mNumBytesPerInputFrame(0u), mOutBufferSize(0u), mSentCodecSpecificData(false), mInputTimeSet(false), mInputSize(0), mInputTimeUs(-1ll), mSignalledError(false), Loading @@ -176,6 +177,7 @@ status_t C2SoftAacEnc::initEncoder() { c2_status_t C2SoftAacEnc::onStop() { mSentCodecSpecificData = false; mInputTimeSet = false; mInputSize = 0u; mInputTimeUs = -1ll; mSignalledError = false; Loading @@ -193,6 +195,7 @@ void C2SoftAacEnc::onRelease() { c2_status_t C2SoftAacEnc::onFlush_sm() { mSentCodecSpecificData = false; mInputTimeSet = false; mInputSize = 0u; return C2_OK; } Loading Loading @@ -337,7 +340,6 @@ void C2SoftAacEnc::process( mOutBufferSize = encInfo.maxOutBufBytes; mNumBytesPerInputFrame = encInfo.frameLength * channelCount * sizeof(int16_t); mInputTimeUs = work->input.ordinal.timestamp; mSentCodecSpecificData = true; } Loading @@ -351,6 +353,10 @@ void C2SoftAacEnc::process( data = view.data(); capacity = view.capacity(); } if (!mInputTimeSet && capacity > 0) { mInputTimeUs = work->input.ordinal.timestamp; mInputTimeSet = true; } size_t numFrames = (capacity + mInputSize + (eos ? mNumBytesPerInputFrame - 1 : 0)) / mNumBytesPerInputFrame; Loading Loading @@ -550,6 +556,7 @@ c2_status_t C2SoftAacEnc::drain( (void)pool; mSentCodecSpecificData = false; mInputTimeSet = false; mInputSize = 0u; // TODO: we don't have any pending work at this time to drain. Loading media/codec2/components/aac/C2SoftAacEnc.h +1 −0 Original line number Diff line number Diff line Loading @@ -57,6 +57,7 @@ private: UINT mOutBufferSize; bool mSentCodecSpecificData; bool mInputTimeSet; size_t mInputSize; c2_cntr64_t mInputTimeUs; Loading media/codec2/components/amr_nb_wb/C2SoftAmrNbEnc.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -271,7 +271,7 @@ void C2SoftAmrNbEnc::process( mFilledLen = 0; } ALOGV("causal sample size %d", mFilledLen); if (mIsFirst) { if (mIsFirst && outPos != 0) { mIsFirst = false; mAnchorTimeStamp = work->input.ordinal.timestamp.peekull(); } Loading media/codec2/components/amr_nb_wb/C2SoftAmrWbEnc.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -347,7 +347,7 @@ void C2SoftAmrWbEnc::process( mFilledLen = 0; } ALOGV("causal sample size %d", mFilledLen); if (mIsFirst) { if (mIsFirst && outPos != 0) { mIsFirst = false; mAnchorTimeStamp = work->input.ordinal.timestamp.peekull(); } Loading media/codec2/components/opus/C2SoftOpusEnc.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -350,7 +350,7 @@ void C2SoftOpusEnc::process(const std::unique_ptr<C2Work>& work, return; } } if (mIsFirstFrame) { if (mIsFirstFrame && inSize > 0) { mAnchorTimeStamp = work->input.ordinal.timestamp.peekull(); mIsFirstFrame = false; } Loading Loading
media/codec2/components/aac/C2SoftAacEnc.cpp +8 −1 Original line number Diff line number Diff line Loading @@ -151,6 +151,7 @@ C2SoftAacEnc::C2SoftAacEnc( mNumBytesPerInputFrame(0u), mOutBufferSize(0u), mSentCodecSpecificData(false), mInputTimeSet(false), mInputSize(0), mInputTimeUs(-1ll), mSignalledError(false), Loading @@ -176,6 +177,7 @@ status_t C2SoftAacEnc::initEncoder() { c2_status_t C2SoftAacEnc::onStop() { mSentCodecSpecificData = false; mInputTimeSet = false; mInputSize = 0u; mInputTimeUs = -1ll; mSignalledError = false; Loading @@ -193,6 +195,7 @@ void C2SoftAacEnc::onRelease() { c2_status_t C2SoftAacEnc::onFlush_sm() { mSentCodecSpecificData = false; mInputTimeSet = false; mInputSize = 0u; return C2_OK; } Loading Loading @@ -337,7 +340,6 @@ void C2SoftAacEnc::process( mOutBufferSize = encInfo.maxOutBufBytes; mNumBytesPerInputFrame = encInfo.frameLength * channelCount * sizeof(int16_t); mInputTimeUs = work->input.ordinal.timestamp; mSentCodecSpecificData = true; } Loading @@ -351,6 +353,10 @@ void C2SoftAacEnc::process( data = view.data(); capacity = view.capacity(); } if (!mInputTimeSet && capacity > 0) { mInputTimeUs = work->input.ordinal.timestamp; mInputTimeSet = true; } size_t numFrames = (capacity + mInputSize + (eos ? mNumBytesPerInputFrame - 1 : 0)) / mNumBytesPerInputFrame; Loading Loading @@ -550,6 +556,7 @@ c2_status_t C2SoftAacEnc::drain( (void)pool; mSentCodecSpecificData = false; mInputTimeSet = false; mInputSize = 0u; // TODO: we don't have any pending work at this time to drain. Loading
media/codec2/components/aac/C2SoftAacEnc.h +1 −0 Original line number Diff line number Diff line Loading @@ -57,6 +57,7 @@ private: UINT mOutBufferSize; bool mSentCodecSpecificData; bool mInputTimeSet; size_t mInputSize; c2_cntr64_t mInputTimeUs; Loading
media/codec2/components/amr_nb_wb/C2SoftAmrNbEnc.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -271,7 +271,7 @@ void C2SoftAmrNbEnc::process( mFilledLen = 0; } ALOGV("causal sample size %d", mFilledLen); if (mIsFirst) { if (mIsFirst && outPos != 0) { mIsFirst = false; mAnchorTimeStamp = work->input.ordinal.timestamp.peekull(); } Loading
media/codec2/components/amr_nb_wb/C2SoftAmrWbEnc.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -347,7 +347,7 @@ void C2SoftAmrWbEnc::process( mFilledLen = 0; } ALOGV("causal sample size %d", mFilledLen); if (mIsFirst) { if (mIsFirst && outPos != 0) { mIsFirst = false; mAnchorTimeStamp = work->input.ordinal.timestamp.peekull(); } Loading
media/codec2/components/opus/C2SoftOpusEnc.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -350,7 +350,7 @@ void C2SoftOpusEnc::process(const std::unique_ptr<C2Work>& work, return; } } if (mIsFirstFrame) { if (mIsFirstFrame && inSize > 0) { mAnchorTimeStamp = work->input.ordinal.timestamp.peekull(); mIsFirstFrame = false; } Loading