diff options
| author | 2016-07-21 17:06:58 -0700 | |
|---|---|---|
| committer | 2016-09-09 15:11:02 -0700 | |
| commit | 8211047138ea7892c73f4e6f6291a85a11759e0c (patch) | |
| tree | a203d0338086a05099054f2924a3e8c945f39bb1 /libs/gui/BufferQueueConsumer.cpp | |
| parent | 083f4ecca201e508f0f5cbe0aa95882a82abdf5e (diff) | |
DO NOT MERGE ANYWHERE: BufferQueue consumers: Add discardFreeBuffer method
This method releases all free buffers owned by the buffer queue,
in order to save memory (at the cost of potential future
reallocation of buffers).
Bug: 28695173
Change-Id: I458d10373e639e3144faf673af2ba01aca36e65a
Diffstat (limited to 'libs/gui/BufferQueueConsumer.cpp')
| -rw-r--r-- | libs/gui/BufferQueueConsumer.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libs/gui/BufferQueueConsumer.cpp b/libs/gui/BufferQueueConsumer.cpp index cbc88932ac..525938e7f2 100644 --- a/libs/gui/BufferQueueConsumer.cpp +++ b/libs/gui/BufferQueueConsumer.cpp @@ -717,6 +717,12 @@ sp<NativeHandle> BufferQueueConsumer::getSidebandStream() const { return mCore->mSidebandStream; } +status_t BufferQueueConsumer::discardFreeBuffers() { + Mutex::Autolock lock(mCore->mMutex); + mCore->discardFreeBuffersLocked(); + return NO_ERROR; +} + void BufferQueueConsumer::dump(String8& result, const char* prefix) const { const IPCThreadState* ipc = IPCThreadState::self(); const pid_t pid = ipc->getCallingPid(); |