summaryrefslogtreecommitdiffstats
path: root/include/gui
diff options
context:
space:
mode:
authorJamie Gennis <jgennis@google.com>2012-08-30 18:36:22 -0700
committerJamie Gennis <jgennis@google.com>2012-09-04 14:54:34 -0700
commitc68f2ecfa02037144d1a3856f637a77f523cf416 (patch)
tree070c904edf7d136ab08a31b5cd0ae72de1ba436e /include/gui
parent9e75ddda93888755d0b14144b62e896cd9f78f3a (diff)
downloadframeworks_native-c68f2ecfa02037144d1a3856f637a77f523cf416.zip
frameworks_native-c68f2ecfa02037144d1a3856f637a77f523cf416.tar.gz
frameworks_native-c68f2ecfa02037144d1a3856f637a77f523cf416.tar.bz2
BufferQueue: add a setMaxAcquiredBufferCount check
This change adds a check to verify the validity of the value passed to setMaxAcquiredBufferCount. Change-Id: I39730557aa58261e678bd6e4fce11bab78e98362
Diffstat (limited to 'include/gui')
-rw-r--r--include/gui/BufferQueue.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/gui/BufferQueue.h b/include/gui/BufferQueue.h
index 0a95bb3..3481c6f 100644
--- a/include/gui/BufferQueue.h
+++ b/include/gui/BufferQueue.h
@@ -41,6 +41,10 @@ public:
enum { INVALID_BUFFER_SLOT = -1 };
enum { STALE_BUFFER_SLOT = 1, NO_BUFFER_AVAILABLE };
+ // When in async mode we reserve two slots in order to guarantee that the
+ // producer and consumer can run asynchronously.
+ enum { MAX_MAX_ACQUIRED_BUFFERS = NUM_BUFFER_SLOTS - 2 };
+
// ConsumerListener is the interface through which the BufferQueue notifies
// the consumer of events that the consumer may wish to react to. Because
// the consumer will generally have a mutex that is locked during calls from