BufferQueue: use max acquired buffer count
This change makes BufferQueue derive the min undequeued buffer count from a max
acquired buffer count that is set by the consumer. This value may be set at
any time that a producer is not connected to the BufferQueue rather than at
BufferQueue construction time.
Change-Id: Icf9f1d91ec612a079968ba0a4621deffe48f4e22
diff --git a/libs/gui/BufferItemConsumer.cpp b/libs/gui/BufferItemConsumer.cpp
index 218d929..57df39c 100644
--- a/libs/gui/BufferItemConsumer.cpp
+++ b/libs/gui/BufferItemConsumer.cpp
@@ -31,10 +31,11 @@
BufferItemConsumer::BufferItemConsumer(uint32_t consumerUsage,
int bufferCount, bool synchronousMode) :
- ConsumerBase(new BufferQueue(true, bufferCount) )
+ ConsumerBase(new BufferQueue(true) )
{
mBufferQueue->setConsumerUsageBits(consumerUsage);
mBufferQueue->setSynchronousMode(synchronousMode);
+ mBufferQueue->setMaxAcquiredBufferCount(bufferCount);
}
BufferItemConsumer::~BufferItemConsumer() {