Skip to content

Commit

Permalink
Codec2 decoders: Invalidate allocated graphic buffer in stop()
Browse files Browse the repository at this point in the history
Bug: 243583691
Test: atest CtsMediaV2TestCases -- --module-arg \
CtsMediaV2TestCases:instrumentation-arg:codec-prefix:=c2.android.

Change-Id: I312c106350b2eb072f0e6f2f9a83f16eb8424cb2
  • Loading branch information
harishdm authored and thestinger committed Sep 18, 2023
1 parent f06d23d commit 9c7408a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
3 changes: 3 additions & 0 deletions media/codec2/components/avc/C2SoftAvcDec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -671,6 +671,9 @@ status_t C2SoftAvcDec::resetDecoder() {
void C2SoftAvcDec::resetPlugin() {
mSignalledOutputEos = false;
mTimeStart = mTimeEnd = systemTime();
if (mOutBlock) {
mOutBlock.reset();
}
}

status_t C2SoftAvcDec::deleteDecoder() {
Expand Down
3 changes: 3 additions & 0 deletions media/codec2/components/hevc/C2SoftHevcDec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,9 @@ status_t C2SoftHevcDec::resetDecoder() {
void C2SoftHevcDec::resetPlugin() {
mSignalledOutputEos = false;
mTimeStart = mTimeEnd = systemTime();
if (mOutBlock) {
mOutBlock.reset();
}
}

status_t C2SoftHevcDec::deleteDecoder() {
Expand Down
3 changes: 3 additions & 0 deletions media/codec2/components/mpeg2/C2SoftMpeg2Dec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -732,6 +732,9 @@ status_t C2SoftMpeg2Dec::resetDecoder() {
void C2SoftMpeg2Dec::resetPlugin() {
mSignalledOutputEos = false;
mTimeStart = mTimeEnd = systemTime();
if (mOutBlock) {
mOutBlock.reset();
}
}

status_t C2SoftMpeg2Dec::deleteDecoder() {
Expand Down
4 changes: 3 additions & 1 deletion media/codec2/components/mpeg4_h263/C2SoftMpeg4Dec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,9 @@ c2_status_t C2SoftMpeg4Dec::onStop() {
mFramesConfigured = false;
mSignalledOutputEos = false;
mSignalledError = false;

if (mOutBlock) {
mOutBlock.reset();
}
return C2_OK;
}

Expand Down

0 comments on commit 9c7408a

Please sign in to comment.