Loading media/libstagefright/codecs/aacenc/SoftAACEncoder.cpp +12 −2 Original line number Diff line number Diff line Loading @@ -62,8 +62,7 @@ SoftAACEncoder::SoftAACEncoder( } SoftAACEncoder::~SoftAACEncoder() { delete[] mInputFrame; mInputFrame = NULL; onReset(); if (mEncoderHandle) { CHECK_EQ(VO_ERR_NONE, mApiHandle->Uninit(mEncoderHandle)); Loading Loading @@ -579,6 +578,17 @@ void SoftAACEncoder::onQueueFilled(OMX_U32 portIndex) { } } void SoftAACEncoder::onReset() { delete[] mInputFrame; mInputFrame = NULL; mInputSize = 0; mSentCodecSpecificData = false; mInputTimeUs = -1ll; mSawInputEOS = false; mSignalledError = false; } } // namespace android android::SoftOMXComponent *createSoftOMXComponent( Loading media/libstagefright/codecs/aacenc/SoftAACEncoder.h +2 −0 Original line number Diff line number Diff line Loading @@ -43,6 +43,8 @@ protected: virtual void onQueueFilled(OMX_U32 portIndex); virtual void onReset(); private: enum { kNumBuffers = 4, Loading media/libstagefright/codecs/aacenc/SoftAACEncoder2.cpp +12 −2 Original line number Diff line number Diff line Loading @@ -59,8 +59,7 @@ SoftAACEncoder2::SoftAACEncoder2( SoftAACEncoder2::~SoftAACEncoder2() { aacEncClose(&mAACEncoder); delete[] mInputFrame; mInputFrame = NULL; onReset(); } void SoftAACEncoder2::initPorts() { Loading Loading @@ -597,6 +596,17 @@ void SoftAACEncoder2::onQueueFilled(OMX_U32 portIndex) { } } void SoftAACEncoder2::onReset() { delete[] mInputFrame; mInputFrame = NULL; mInputSize = 0; mSentCodecSpecificData = false; mInputTimeUs = -1ll; mSawInputEOS = false; mSignalledError = false; } } // namespace android android::SoftOMXComponent *createSoftOMXComponent( Loading media/libstagefright/codecs/aacenc/SoftAACEncoder2.h +2 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,8 @@ protected: virtual void onQueueFilled(OMX_U32 portIndex); virtual void onReset(); private: enum { kNumBuffers = 4, Loading media/libstagefright/codecs/m4v_h263/enc/SoftMPEG4Encoder.cpp +21 −14 Original line number Diff line number Diff line Loading @@ -112,6 +112,7 @@ SoftMPEG4Encoder::SoftMPEG4Encoder( SoftMPEG4Encoder::~SoftMPEG4Encoder() { ALOGV("Destruct SoftMPEG4Encoder"); onReset(); releaseEncoder(); List<BufferInfo *> &outQueue = getPortQueue(1); List<BufferInfo *> &inQueue = getPortQueue(0); Loading Loading @@ -221,22 +222,15 @@ OMX_ERRORTYPE SoftMPEG4Encoder::initEncoder() { } OMX_ERRORTYPE SoftMPEG4Encoder::releaseEncoder() { if (!mStarted) { return OMX_ErrorNone; } PVCleanUpVideoEncoder(mHandle); delete mInputFrameData; mInputFrameData = NULL; if (mEncParams) { delete mEncParams; mEncParams = NULL; } if (mHandle) { delete mHandle; mHandle = NULL; mStarted = false; } return OMX_ErrorNone; } Loading Loading @@ -861,6 +855,19 @@ void SoftMPEG4Encoder::releaseGrallocData(buffer_handle_t buffer) { } } void SoftMPEG4Encoder::onReset() { if (!mStarted) { return; } PVCleanUpVideoEncoder(mHandle); free(mInputFrameData); mInputFrameData = NULL; mStarted = false; } } // namespace android android::SoftOMXComponent *createSoftOMXComponent( Loading Loading
media/libstagefright/codecs/aacenc/SoftAACEncoder.cpp +12 −2 Original line number Diff line number Diff line Loading @@ -62,8 +62,7 @@ SoftAACEncoder::SoftAACEncoder( } SoftAACEncoder::~SoftAACEncoder() { delete[] mInputFrame; mInputFrame = NULL; onReset(); if (mEncoderHandle) { CHECK_EQ(VO_ERR_NONE, mApiHandle->Uninit(mEncoderHandle)); Loading Loading @@ -579,6 +578,17 @@ void SoftAACEncoder::onQueueFilled(OMX_U32 portIndex) { } } void SoftAACEncoder::onReset() { delete[] mInputFrame; mInputFrame = NULL; mInputSize = 0; mSentCodecSpecificData = false; mInputTimeUs = -1ll; mSawInputEOS = false; mSignalledError = false; } } // namespace android android::SoftOMXComponent *createSoftOMXComponent( Loading
media/libstagefright/codecs/aacenc/SoftAACEncoder.h +2 −0 Original line number Diff line number Diff line Loading @@ -43,6 +43,8 @@ protected: virtual void onQueueFilled(OMX_U32 portIndex); virtual void onReset(); private: enum { kNumBuffers = 4, Loading
media/libstagefright/codecs/aacenc/SoftAACEncoder2.cpp +12 −2 Original line number Diff line number Diff line Loading @@ -59,8 +59,7 @@ SoftAACEncoder2::SoftAACEncoder2( SoftAACEncoder2::~SoftAACEncoder2() { aacEncClose(&mAACEncoder); delete[] mInputFrame; mInputFrame = NULL; onReset(); } void SoftAACEncoder2::initPorts() { Loading Loading @@ -597,6 +596,17 @@ void SoftAACEncoder2::onQueueFilled(OMX_U32 portIndex) { } } void SoftAACEncoder2::onReset() { delete[] mInputFrame; mInputFrame = NULL; mInputSize = 0; mSentCodecSpecificData = false; mInputTimeUs = -1ll; mSawInputEOS = false; mSignalledError = false; } } // namespace android android::SoftOMXComponent *createSoftOMXComponent( Loading
media/libstagefright/codecs/aacenc/SoftAACEncoder2.h +2 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,8 @@ protected: virtual void onQueueFilled(OMX_U32 portIndex); virtual void onReset(); private: enum { kNumBuffers = 4, Loading
media/libstagefright/codecs/m4v_h263/enc/SoftMPEG4Encoder.cpp +21 −14 Original line number Diff line number Diff line Loading @@ -112,6 +112,7 @@ SoftMPEG4Encoder::SoftMPEG4Encoder( SoftMPEG4Encoder::~SoftMPEG4Encoder() { ALOGV("Destruct SoftMPEG4Encoder"); onReset(); releaseEncoder(); List<BufferInfo *> &outQueue = getPortQueue(1); List<BufferInfo *> &inQueue = getPortQueue(0); Loading Loading @@ -221,22 +222,15 @@ OMX_ERRORTYPE SoftMPEG4Encoder::initEncoder() { } OMX_ERRORTYPE SoftMPEG4Encoder::releaseEncoder() { if (!mStarted) { return OMX_ErrorNone; } PVCleanUpVideoEncoder(mHandle); delete mInputFrameData; mInputFrameData = NULL; if (mEncParams) { delete mEncParams; mEncParams = NULL; } if (mHandle) { delete mHandle; mHandle = NULL; mStarted = false; } return OMX_ErrorNone; } Loading Loading @@ -861,6 +855,19 @@ void SoftMPEG4Encoder::releaseGrallocData(buffer_handle_t buffer) { } } void SoftMPEG4Encoder::onReset() { if (!mStarted) { return; } PVCleanUpVideoEncoder(mHandle); free(mInputFrameData); mInputFrameData = NULL; mStarted = false; } } // namespace android android::SoftOMXComponent *createSoftOMXComponent( Loading