am eb0d1296
: CpuConsumer: Add optional asynchronous mode
* commit 'eb0d12963d271052c24abb025d698504df9e7573': CpuConsumer: Add optional asynchronous mode
This commit is contained in:
commit
19483dacfd
@ -57,7 +57,7 @@ class CpuConsumer: public ConsumerBase
|
|||||||
|
|
||||||
// Create a new CPU consumer. The maxLockedBuffers parameter specifies
|
// Create a new CPU consumer. The maxLockedBuffers parameter specifies
|
||||||
// how many buffers can be locked for user access at the same time.
|
// how many buffers can be locked for user access at the same time.
|
||||||
CpuConsumer(uint32_t maxLockedBuffers);
|
CpuConsumer(uint32_t maxLockedBuffers, bool synchronousMode = true);
|
||||||
|
|
||||||
virtual ~CpuConsumer();
|
virtual ~CpuConsumer();
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
namespace android {
|
namespace android {
|
||||||
|
|
||||||
CpuConsumer::CpuConsumer(uint32_t maxLockedBuffers) :
|
CpuConsumer::CpuConsumer(uint32_t maxLockedBuffers, bool synchronousMode) :
|
||||||
ConsumerBase(new BufferQueue(true) ),
|
ConsumerBase(new BufferQueue(true) ),
|
||||||
mMaxLockedBuffers(maxLockedBuffers),
|
mMaxLockedBuffers(maxLockedBuffers),
|
||||||
mCurrentLockedBuffers(0)
|
mCurrentLockedBuffers(0)
|
||||||
@ -38,7 +38,7 @@ CpuConsumer::CpuConsumer(uint32_t maxLockedBuffers) :
|
|||||||
mLockedSlots[i].mBufferPointer = NULL;
|
mLockedSlots[i].mBufferPointer = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
mBufferQueue->setSynchronousMode(true);
|
mBufferQueue->setSynchronousMode(synchronousMode);
|
||||||
mBufferQueue->setConsumerUsageBits(GRALLOC_USAGE_SW_READ_OFTEN);
|
mBufferQueue->setConsumerUsageBits(GRALLOC_USAGE_SW_READ_OFTEN);
|
||||||
mBufferQueue->setMaxAcquiredBufferCount(maxLockedBuffers);
|
mBufferQueue->setMaxAcquiredBufferCount(maxLockedBuffers);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user