summaryrefslogtreecommitdiffstats
path: root/include/gui/BufferSlot.h
diff options
context:
space:
mode:
authorDan Stoza <stoza@google.com>2014-03-06 15:14:33 -0800
committerDan Stoza <stoza@google.com>2014-03-10 16:45:38 -0700
commit9f3053de78630815d60cf48a2cf2348cc5867c45 (patch)
treee87e2a86d1ca837a80fc7730daece3f28a41e800 /include/gui/BufferSlot.h
parent544b09523b791935ffe9aa64d1f20335f7e2dc78 (diff)
downloadframeworks_native-9f3053de78630815d60cf48a2cf2348cc5867c45.zip
frameworks_native-9f3053de78630815d60cf48a2cf2348cc5867c45.tar.gz
frameworks_native-9f3053de78630815d60cf48a2cf2348cc5867c45.tar.bz2
BufferQueue: Allow detaching/reattaching buffers
Adds detachBuffer and attachBuffer calls to both the producer and consumer sides of BufferQueue. Buffers may be detached while dequeued by the producer or acquired by the consumer, and when attached, enter the dequeued and acquired states, respectively. Bug: 13173343 Change-Id: Ic152692b0a94d99e0135b9bfa62747dab2a54220
Diffstat (limited to 'include/gui/BufferSlot.h')
-rw-r--r--include/gui/BufferSlot.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/gui/BufferSlot.h b/include/gui/BufferSlot.h
index 2c4b43f..6085e11 100644
--- a/include/gui/BufferSlot.h
+++ b/include/gui/BufferSlot.h
@@ -38,7 +38,8 @@ struct BufferSlot {
mFrameNumber(0),
mEglFence(EGL_NO_SYNC_KHR),
mAcquireCalled(false),
- mNeedsCleanupOnRelease(false) {
+ mNeedsCleanupOnRelease(false),
+ mAttachedByConsumer(false) {
}
// mGraphicBuffer points to the buffer allocated for this slot or is NULL
@@ -129,6 +130,11 @@ struct BufferSlot {
// consumer. This is set when a buffer in ACQUIRED state is freed.
// It causes releaseBuffer to return STALE_BUFFER_SLOT.
bool mNeedsCleanupOnRelease;
+
+ // Indicates whether the buffer was attached on the consumer side.
+ // If so, it needs to set the BUFFER_NEEDS_REALLOCATION flag when dequeued
+ // to prevent the producer from using a stale cached buffer.
+ bool mAttachedByConsumer;
};
} // namespace android