diff options
author | Dan Stoza <stoza@google.com> | 2014-03-03 10:16:19 -0800 |
---|---|---|
committer | Dan Stoza <stoza@google.com> | 2014-03-04 15:58:03 -0800 |
commit | 3e96f1982fda358424b0b75f394cbf7c1794a072 (patch) | |
tree | b5a25e2624e31ee016e8f3f2a9f3f7697591e8c5 /include/gui/BufferQueueConsumer.h | |
parent | 289ade165e60b5f71734d30e535f16eb1f4313ad (diff) | |
download | frameworks_native-3e96f1982fda358424b0b75f394cbf7c1794a072.zip frameworks_native-3e96f1982fda358424b0b75f394cbf7c1794a072.tar.gz frameworks_native-3e96f1982fda358424b0b75f394cbf7c1794a072.tar.bz2 |
Change BufferQueue into producer/consumer wrapper
Now that BufferQueue has been split into core + producer + consumer,
rewrite BufferQueue to be a thin layer over a producer and consumer
interface. Eventually, this layer will be deprecated in favor of
only using either the producer or consumer interface, as applicable.
Change-Id: I340ae5f5b633b244fb594615ff52ba50b9e2f7e4
Diffstat (limited to 'include/gui/BufferQueueConsumer.h')
-rw-r--r-- | include/gui/BufferQueueConsumer.h | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/include/gui/BufferQueueConsumer.h b/include/gui/BufferQueueConsumer.h index 0980ebb..20db98c 100644 --- a/include/gui/BufferQueueConsumer.h +++ b/include/gui/BufferQueueConsumer.h @@ -20,7 +20,7 @@ #include <EGL/egl.h> #include <EGL/eglext.h> -#include <gui/BufferQueueCore.h> +#include <gui/BufferQueueDefs.h> #include <gui/IGraphicBufferConsumer.h> namespace android { @@ -136,10 +136,34 @@ public: // dump our state in a String virtual void dump(String8& result, const char* prefix) const; + // Functions required for backwards compatibility. + // These will be modified/renamed in IGraphicBufferConsumer and will be + // removed from this class at that time. See b/13306289. + + virtual status_t releaseBuffer(int buf, uint64_t frameNumber, + EGLDisplay display, EGLSyncKHR fence, + const sp<Fence>& releaseFence) { + return releaseBuffer(buf, frameNumber, releaseFence, display, fence); + } + + virtual status_t consumerConnect(const sp<IConsumerListener>& consumer, + bool controlledByApp) { + return connect(consumer, controlledByApp); + } + + virtual status_t consumerDisconnect() { return disconnect(); } + + // End functions required for backwards compatibility + private: sp<BufferQueueCore> mCore; - BufferQueueCore::SlotsType& mSlots; - String8 mConsumerName; // Cached from mCore. Updated on setConsumerName. + + // This references mCore->mSlots. Lock mCore->mMutex while accessing. + BufferQueueDefs::SlotsType& mSlots; + + // This is a cached copy of the name stored in the BufferQueueCore. + // It's updated during setConsumerName. + String8 mConsumerName; }; // class BufferQueueConsumer |