diff options
author | Igor Murashkin <iam@google.com> | 2013-04-16 11:24:40 -0700 |
---|---|---|
committer | Igor Murashkin <iam@google.com> | 2013-04-16 11:24:40 -0700 |
commit | 87d1e3427b536b5cb1123ddc357539cb4075687a (patch) | |
tree | 53c8865ac5a5d2a6f8ca24f53abd2ff0409d4f27 | |
parent | 1df59c93fea8bec21b8084c34aface086f1e0896 (diff) | |
download | frameworks_native-87d1e3427b536b5cb1123ddc357539cb4075687a.zip frameworks_native-87d1e3427b536b5cb1123ddc357539cb4075687a.tar.gz frameworks_native-87d1e3427b536b5cb1123ddc357539cb4075687a.tar.bz2 |
BufferItemConsumer: add functions to set default buffer format/size
Bug: 8629088
Change-Id: I06f2e26a70d6dbcfcd70b08b4461e8e401f6e83f
-rw-r--r-- | include/gui/BufferItemConsumer.h | 8 | ||||
-rw-r--r-- | libs/gui/BufferItemConsumer.cpp | 10 |
2 files changed, 18 insertions, 0 deletions
diff --git a/include/gui/BufferItemConsumer.h b/include/gui/BufferItemConsumer.h index 0840891..98b450c 100644 --- a/include/gui/BufferItemConsumer.h +++ b/include/gui/BufferItemConsumer.h @@ -84,6 +84,14 @@ class BufferItemConsumer: public ConsumerBase sp<IGraphicBufferProducer> getProducerInterface() const { return getBufferQueue(); } + // setDefaultBufferSize is used to set the size of buffers returned by + // requestBuffers when a with and height of zero is requested. + status_t setDefaultBufferSize(uint32_t w, uint32_t h); + + // setDefaultBufferFormat allows the BufferQueue to create + // GraphicBuffers of a defaultFormat if no format is specified + // in dequeueBuffer + status_t setDefaultBufferFormat(uint32_t defaultFormat); }; } // namespace android diff --git a/libs/gui/BufferItemConsumer.cpp b/libs/gui/BufferItemConsumer.cpp index 885b4e4..90619ab 100644 --- a/libs/gui/BufferItemConsumer.cpp +++ b/libs/gui/BufferItemConsumer.cpp @@ -93,4 +93,14 @@ status_t BufferItemConsumer::releaseBuffer(const BufferItem &item, return err; } +status_t BufferItemConsumer::setDefaultBufferSize(uint32_t w, uint32_t h) { + Mutex::Autolock _l(mMutex); + return mBufferQueue->setDefaultBufferSize(w, h); +} + +status_t BufferItemConsumer::setDefaultBufferFormat(uint32_t defaultFormat) { + Mutex::Autolock _l(mMutex); + return mBufferQueue->setDefaultBufferFormat(defaultFormat); +} + } // namespace android |