Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 80f79034 authored by Alvin.Liu's avatar Alvin.Liu Committed by daren.liao
Browse files

[surfacetexture] Add patch to release current EglImage

[Description]
Add test patch to release current texture image when freeing the
corresponding buffer, in order to prevent EglImage reference leak
which would result in destructor not called.

Bug: 214353180

[Test Report]
Test Platform: palmer
1. AC ON/OFF: PASS
2. Launcher UI: PASS
3. CTS: PASS
4. CTS Command:
run cts -m CtsMediaTestCases -t android.media.cts.DecodeEditEncodeTest
run cts -m CtsMediaTestCases -t android.media.cts.EncodeDecodeTest

Change-Id: I4a02d62fe72e2b3013e7c352b77977a3b6b515ae
parent b0a8f735
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -593,6 +593,10 @@ status_t EGLConsumer::doGLFenceWaitLocked(SurfaceTexture& st) const {
}

void EGLConsumer::onFreeBufferLocked(int slotIndex) {
    if (mEglSlots[slotIndex].mEglImage != nullptr &&
        mEglSlots[slotIndex].mEglImage == mCurrentTextureImage) {
        mCurrentTextureImage.clear();
    }
    mEglSlots[slotIndex].mEglImage.clear();
}