commit | 05575b11d336e40ba9bf8406347df1bdc5e673ab | [log] [tgz] |
---|---|---|
author | Harish Mahendrakar <harish.mahendrakar@ittiam.com> | Wed Oct 19 18:17:07 2022 -0700 |
committer | Harish Mahendrakar <harish.mahendrakar@ittiam.com> | Thu Oct 20 01:26:32 2022 +0000 |
tree | 2d47d1f91ccf352aa59517cc24994c52ee2ed5c0 | |
parent | eac834646943be31cbf88a993afb6caf9f5cc4f0 [diff] |
Codec2 decoders: Invalidate allocated graphic buffer in stop() Bug: 243583691 Test: atest CtsMediaV2TestCases -- --module-arg \ CtsMediaV2TestCases:instrumentation-arg:codec-prefix:=c2.android. Change-Id: I312c106350b2eb072f0e6f2f9a83f16eb8424cb2
diff --git a/media/codec2/components/avc/C2SoftAvcDec.cpp b/media/codec2/components/avc/C2SoftAvcDec.cpp index 953afc5..96a4c4a 100644 --- a/media/codec2/components/avc/C2SoftAvcDec.cpp +++ b/media/codec2/components/avc/C2SoftAvcDec.cpp
@@ -671,6 +671,9 @@ void C2SoftAvcDec::resetPlugin() { mSignalledOutputEos = false; mTimeStart = mTimeEnd = systemTime(); + if (mOutBlock) { + mOutBlock.reset(); + } } status_t C2SoftAvcDec::deleteDecoder() {
diff --git a/media/codec2/components/hevc/C2SoftHevcDec.cpp b/media/codec2/components/hevc/C2SoftHevcDec.cpp index a27c218..15d6dcd 100644 --- a/media/codec2/components/hevc/C2SoftHevcDec.cpp +++ b/media/codec2/components/hevc/C2SoftHevcDec.cpp
@@ -664,6 +664,9 @@ void C2SoftHevcDec::resetPlugin() { mSignalledOutputEos = false; mTimeStart = mTimeEnd = systemTime(); + if (mOutBlock) { + mOutBlock.reset(); + } } status_t C2SoftHevcDec::deleteDecoder() {
diff --git a/media/codec2/components/mpeg2/C2SoftMpeg2Dec.cpp b/media/codec2/components/mpeg2/C2SoftMpeg2Dec.cpp index 9a41910..439323c 100644 --- a/media/codec2/components/mpeg2/C2SoftMpeg2Dec.cpp +++ b/media/codec2/components/mpeg2/C2SoftMpeg2Dec.cpp
@@ -732,6 +732,9 @@ void C2SoftMpeg2Dec::resetPlugin() { mSignalledOutputEos = false; mTimeStart = mTimeEnd = systemTime(); + if (mOutBlock) { + mOutBlock.reset(); + } } status_t C2SoftMpeg2Dec::deleteDecoder() {
diff --git a/media/codec2/components/mpeg4_h263/C2SoftMpeg4Dec.cpp b/media/codec2/components/mpeg4_h263/C2SoftMpeg4Dec.cpp index 54a1d0e..3bf9c48 100644 --- a/media/codec2/components/mpeg4_h263/C2SoftMpeg4Dec.cpp +++ b/media/codec2/components/mpeg4_h263/C2SoftMpeg4Dec.cpp
@@ -256,7 +256,9 @@ mFramesConfigured = false; mSignalledOutputEos = false; mSignalledError = false; - + if (mOutBlock) { + mOutBlock.reset(); + } return C2_OK; }