diff options
author | Dan Stoza <stoza@google.com> | 2015-04-03 14:22:05 -0700 |
---|---|---|
committer | Dan Stoza <stoza@google.com> | 2015-04-07 15:05:40 -0700 |
commit | 634f5ee6a713b3cf4086a2af8e9b56e76cba245f (patch) | |
tree | 0e7bac84fd1a5c0986f794e62957aa33e8700010 /libs/gui | |
parent | 1cd030be59c108cde25234f0d2da83a68a7cdd26 (diff) | |
download | frameworks_native-634f5ee6a713b3cf4086a2af8e9b56e76cba245f.zip frameworks_native-634f5ee6a713b3cf4086a2af8e9b56e76cba245f.tar.gz frameworks_native-634f5ee6a713b3cf4086a2af8e9b56e76cba245f.tar.bz2 |
libgui: Plumb detachBuffer through ConsumerBase
Exposes IGraphicBufferConsumer::detachBuffer as a ConsumerBase
method. attachBuffer is not currently exposed, because all current
clients will be recycling buffers through the allocator.
Bug: 19628705
Change-Id: I3e519767fa43d5d880c1d5695e31b60f6ad588af
Diffstat (limited to 'libs/gui')
-rw-r--r-- | libs/gui/ConsumerBase.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/libs/gui/ConsumerBase.cpp b/libs/gui/ConsumerBase.cpp index b874e3a..e576018 100644 --- a/libs/gui/ConsumerBase.cpp +++ b/libs/gui/ConsumerBase.cpp @@ -163,6 +163,21 @@ void ConsumerBase::setFrameAvailableListener( mFrameAvailableListener = listener; } +status_t ConsumerBase::detachBuffer(int slot) { + CB_LOGV("detachBuffer"); + Mutex::Autolock lock(mMutex); + + status_t result = mConsumer->detachBuffer(slot); + if (result != NO_ERROR) { + CB_LOGE("Failed to detach buffer: %d", result); + return result; + } + + freeBufferLocked(slot); + + return result; +} + void ConsumerBase::dump(String8& result) const { dump(result, ""); } |