diff options
Diffstat (limited to 'include/gui/BufferQueue.h')
-rw-r--r-- | include/gui/BufferQueue.h | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/include/gui/BufferQueue.h b/include/gui/BufferQueue.h index 7e404fe842..408956b6e7 100644 --- a/include/gui/BufferQueue.h +++ b/include/gui/BufferQueue.h @@ -20,6 +20,8 @@ #include <EGL/egl.h> #include <EGL/eglext.h> +#include <binder/IBinder.h> + #include <gui/IConsumerListener.h> #include <gui/IGraphicBufferAlloc.h> #include <gui/IGraphicBufferProducer.h> @@ -35,7 +37,9 @@ namespace android { // ---------------------------------------------------------------------------- -class BufferQueue : public BnGraphicBufferProducer, public BnGraphicBufferConsumer { +class BufferQueue : public BnGraphicBufferProducer, + public BnGraphicBufferConsumer, + private IBinder::DeathRecipient { public: enum { MIN_UNDEQUEUED_BUFFERS = 2 }; enum { NUM_BUFFER_SLOTS = 32 }; @@ -79,6 +83,12 @@ public: virtual ~BufferQueue(); /* + * IBinder::DeathRecipient interface + */ + + virtual void binderDied(const wp<IBinder>& who); + + /* * IGraphicBufferProducer interface */ @@ -184,7 +194,8 @@ public: // it's still connected to a producer). // // APIs are enumerated in window.h (e.g. NATIVE_WINDOW_API_CPU). - virtual status_t connect(int api, bool producerControlledByApp, QueueBufferOutput* output); + virtual status_t connect(const sp<IBinder>& token, + int api, bool producerControlledByApp, QueueBufferOutput* output); // disconnect attempts to disconnect a producer API from the BufferQueue. // Calling this method will cause any subsequent calls to other @@ -552,6 +563,9 @@ private: // mTransformHint is used to optimize for screen rotations uint32_t mTransformHint; + + // mConnectedProducerToken is used to set a binder death notification on the producer + sp<IBinder> mConnectedProducerToken; }; // ---------------------------------------------------------------------------- |