summaryrefslogtreecommitdiff
path: root/libs/gui/BufferQueue.cpp
diff options
context:
space:
mode:
author Dan Stoza <stoza@google.com> 2014-03-12 10:17:20 -0700
committer Dan Stoza <stoza@google.com> 2014-03-12 10:17:20 -0700
commitf522af7eb6048c2efae77d7b94960bc49c003e0e (patch)
tree166d856228efb8bee8ee37a7e5a6f9a01b0a0531 /libs/gui/BufferQueue.cpp
parentc9ed7d376882ff3c32913473fecd729c804dad0e (diff)
BufferQueue: Allow returning interfaces as I*/Bn*
This adds a second createBufferQueue method that returns sp<IGraphicBuffer*> interfaces instead of sp<BnGraphicBuffer*>, since most clients don't actually need the Binderized versions (but some might). Change-Id: Iaf4f719c96ddb6f704afc75cf52be22588173e32
Diffstat (limited to 'libs/gui/BufferQueue.cpp')
-rw-r--r--libs/gui/BufferQueue.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/libs/gui/BufferQueue.cpp b/libs/gui/BufferQueue.cpp
index 26e215b1d7..5000444d75 100644
--- a/libs/gui/BufferQueue.cpp
+++ b/libs/gui/BufferQueue.cpp
@@ -56,6 +56,19 @@ void BufferQueue::createBufferQueue(sp<BnGraphicBufferProducer>* outProducer,
*outConsumer = new BufferQueueConsumer(core);
}
+void BufferQueue::createBufferQueue(sp<IGraphicBufferProducer>* outProducer,
+ sp<IGraphicBufferConsumer>* outConsumer,
+ const sp<IGraphicBufferAlloc>& allocator) {
+ LOG_ALWAYS_FATAL_IF(outProducer == NULL,
+ "BufferQueue: outProducer must not be NULL");
+ LOG_ALWAYS_FATAL_IF(outConsumer == NULL,
+ "BufferQueue: outConsumer must not be NULL");
+
+ sp<BufferQueueCore> core(new BufferQueueCore(allocator));
+ *outProducer = new BufferQueueProducer(core);
+ *outConsumer = new BufferQueueConsumer(core);
+}
+
BufferQueue::BufferQueue(const sp<IGraphicBufferAlloc>& allocator) :
mProducer(),
mConsumer()