All consumers now take an IGraphicBufferConsumer instead of a BufferQueue
this means they only have access to the consumer end of
the interface. we had a lot of code that assumed consumers
where holding a BufferQueue (i.e.: both ends), so most of
this change is untangling in fix that
Bug: 9265647
Change-Id: Ic2e2596ee14c7535f51bf26d9a897a0fc036d22c
diff --git a/libs/gui/CpuConsumer.cpp b/libs/gui/CpuConsumer.cpp
index b8c00af..3db46bc 100644
--- a/libs/gui/CpuConsumer.cpp
+++ b/libs/gui/CpuConsumer.cpp
@@ -30,7 +30,7 @@
namespace android {
-CpuConsumer::CpuConsumer(const sp<BufferQueue>& bq,
+CpuConsumer::CpuConsumer(const sp<IGraphicBufferConsumer>& bq,
uint32_t maxLockedBuffers, bool controlledByApp) :
ConsumerBase(bq, controlledByApp),
mMaxLockedBuffers(maxLockedBuffers),
@@ -39,8 +39,8 @@
// Create tracking entries for locked buffers
mAcquiredBuffers.insertAt(0, maxLockedBuffers);
- mBufferQueue->setConsumerUsageBits(GRALLOC_USAGE_SW_READ_OFTEN);
- mBufferQueue->setMaxAcquiredBufferCount(maxLockedBuffers);
+ mConsumer->setConsumerUsageBits(GRALLOC_USAGE_SW_READ_OFTEN);
+ mConsumer->setMaxAcquiredBufferCount(maxLockedBuffers);
}
CpuConsumer::~CpuConsumer() {
@@ -52,19 +52,19 @@
void CpuConsumer::setName(const String8& name) {
Mutex::Autolock _l(mMutex);
mName = name;
- mBufferQueue->setConsumerName(name);
+ mConsumer->setConsumerName(name);
}
status_t CpuConsumer::setDefaultBufferSize(uint32_t width, uint32_t height)
{
Mutex::Autolock _l(mMutex);
- return mBufferQueue->setDefaultBufferSize(width, height);
+ return mConsumer->setDefaultBufferSize(width, height);
}
status_t CpuConsumer::setDefaultBufferFormat(uint32_t defaultFormat)
{
Mutex::Autolock _l(mMutex);
- return mBufferQueue->setDefaultBufferFormat(defaultFormat);
+ return mConsumer->setDefaultBufferFormat(defaultFormat);
}
status_t CpuConsumer::lockNextBuffer(LockedBuffer *nativeBuffer) {