From f522af7eb6048c2efae77d7b94960bc49c003e0e Mon Sep 17 00:00:00 2001 From: Dan Stoza Date: Wed, 12 Mar 2014 10:17:20 -0700 Subject: BufferQueue: Allow returning interfaces as I*/Bn* This adds a second createBufferQueue method that returns sp interfaces instead of sp, since most clients don't actually need the Binderized versions (but some might). Change-Id: Iaf4f719c96ddb6f704afc75cf52be22588173e32 --- libs/gui/BufferQueue.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'libs/gui/BufferQueue.cpp') 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* outProducer, *outConsumer = new BufferQueueConsumer(core); } +void BufferQueue::createBufferQueue(sp* outProducer, + sp* outConsumer, + const sp& 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 core(new BufferQueueCore(allocator)); + *outProducer = new BufferQueueProducer(core); + *outConsumer = new BufferQueueConsumer(core); +} + BufferQueue::BufferQueue(const sp& allocator) : mProducer(), mConsumer() -- cgit v1.2.3-59-g8ed1b