diff options
author | Shalaj Jain <shalajj@codeaurora.org> | 2016-01-25 13:20:10 -0800 |
---|---|---|
committer | Steve Kondik <steve@cyngn.com> | 2016-03-08 22:38:20 -0800 |
commit | 2fd815ffc3cac5655d0809bf762400e452734114 (patch) | |
tree | 033bc0d41ba12426e2f7f122c167414a478b69ef | |
parent | c3902bb77957a98082d03ec1cf8ff938495a674a (diff) | |
download | frameworks_av-2fd815ffc3cac5655d0809bf762400e452734114.zip frameworks_av-2fd815ffc3cac5655d0809bf762400e452734114.tar.gz frameworks_av-2fd815ffc3cac5655d0809bf762400e452734114.tar.bz2 |
stagefright: Clear RenderQueue on port settings changed
Clear the RenderTracker RenderQueue before allocating new set of
buffers during port settings change. The graphicBuffers inside
the RenderQueue hold the actual buffer references which prevents
them from being freed until this queue is cleared.
Do not wait till executing state to clear the queue as then
overall memory consumption goes up for the brief period.
CRs-Fixed: 972394
Change-Id: If50ffc2d517f793a59c88d3fb213bf4c23b8c9f7
-rw-r--r-- | media/libstagefright/ACodec.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp index 8cf38ef..b83d6c6 100644 --- a/media/libstagefright/ACodec.cpp +++ b/media/libstagefright/ACodec.cpp @@ -6781,6 +6781,11 @@ bool ACodec::OutputPortSettingsChangedState::onOMXEvent( mCodec->mNode, OMX_CommandPortEnable, kPortIndexOutput); } + /* Clear the RenderQueue in which queued GraphicBuffers hold the + * actual buffer references in order to free them early. + */ + mCodec->mRenderTracker.clear(systemTime(CLOCK_MONOTONIC)); + if (err == OK) { err = mCodec->allocateBuffersOnPort(kPortIndexOutput); ALOGE_IF(err != OK, "Failed to allocate output port buffers after port " |