summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Stoza <stoza@google.com>2014-03-12 14:32:29 -0700
committerDan Stoza <stoza@google.com>2014-03-13 11:12:04 -0700
commitfe50d2a0a13116238d5321e16c06e6ed533618dc (patch)
tree07ff1c9f16d1b26738c414aa029e1d7ff7e2c312
parent685c0ae8de5582913770032a25ed0b0b0035b609 (diff)
downloadframeworks_native-fe50d2a0a13116238d5321e16c06e6ed533618dc.zip
frameworks_native-fe50d2a0a13116238d5321e16c06e6ed533618dc.tar.gz
frameworks_native-fe50d2a0a13116238d5321e16c06e6ed533618dc.tar.bz2
BufferItemConsumer: Use IGBC instead of BQ
Change-Id: Id1756ac62954ba412f2c23c5fa6e5d760c299347
-rw-r--r--include/gui/BufferItemConsumer.h6
-rw-r--r--libs/gui/BufferItemConsumer.cpp22
2 files changed, 14 insertions, 14 deletions
diff --git a/include/gui/BufferItemConsumer.h b/include/gui/BufferItemConsumer.h
index 2c58ca5..5494ff1 100644
--- a/include/gui/BufferItemConsumer.h
+++ b/include/gui/BufferItemConsumer.h
@@ -44,7 +44,7 @@ class BufferItemConsumer: public ConsumerBase
typedef BufferQueue::BufferItem BufferItem;
- enum { MIN_UNDEQUEUED_BUFFERS = -1 };
+ enum { DEFAULT_MAX_BUFFERS = -1 };
enum { INVALID_BUFFER_SLOT = BufferQueue::INVALID_BUFFER_SLOT };
enum { NO_BUFFER_AVAILABLE = BufferQueue::NO_BUFFER_AVAILABLE };
@@ -54,8 +54,8 @@ class BufferItemConsumer: public ConsumerBase
// access at the same time.
// controlledByApp tells whether this consumer is controlled by the
// application.
- BufferItemConsumer(const sp<BufferQueue>& bq, uint32_t consumerUsage,
- int bufferCount = MIN_UNDEQUEUED_BUFFERS,
+ BufferItemConsumer(const sp<IGraphicBufferConsumer>& consumer,
+ uint32_t consumerUsage, int bufferCount = DEFAULT_MAX_BUFFERS,
bool controlledByApp = false);
virtual ~BufferItemConsumer();
diff --git a/libs/gui/BufferItemConsumer.cpp b/libs/gui/BufferItemConsumer.cpp
index 74a65ed..fe50c55 100644
--- a/libs/gui/BufferItemConsumer.cpp
+++ b/libs/gui/BufferItemConsumer.cpp
@@ -29,19 +29,19 @@
namespace android {
-BufferItemConsumer::BufferItemConsumer(const sp<BufferQueue>& bq,
- uint32_t consumerUsage, int bufferCount, bool controlledByApp) :
- ConsumerBase(bq, controlledByApp)
+BufferItemConsumer::BufferItemConsumer(
+ const sp<IGraphicBufferConsumer>& consumer, uint32_t consumerUsage,
+ int bufferCount, bool controlledByApp) :
+ ConsumerBase(consumer, controlledByApp)
{
- if (bufferCount == MIN_UNDEQUEUED_BUFFERS) {
- status_t res;
- res = bq->query(NATIVE_WINDOW_MIN_UNDEQUEUED_BUFFERS, &bufferCount);
- LOG_ALWAYS_FATAL_IF(res != OK || bufferCount < 0,
- "Failed to query min buffer count");
+ status_t err = mConsumer->setConsumerUsageBits(consumerUsage);
+ LOG_ALWAYS_FATAL_IF(err != OK,
+ "Failed to set consumer usage bits to %#x", consumerUsage);
+ if (bufferCount != DEFAULT_MAX_BUFFERS) {
+ err = mConsumer->setMaxAcquiredBufferCount(bufferCount);
+ LOG_ALWAYS_FATAL_IF(err != OK,
+ "Failed to set max acquired buffer count to %d", bufferCount);
}
-
- mConsumer->setConsumerUsageBits(consumerUsage);
- mConsumer->setMaxAcquiredBufferCount(bufferCount);
}
BufferItemConsumer::~BufferItemConsumer() {