summaryrefslogtreecommitdiffstats
path: root/include/gui
diff options
context:
space:
mode:
Diffstat (limited to 'include/gui')
-rw-r--r--include/gui/BufferQueue.h18
-rw-r--r--include/gui/IGraphicBufferProducer.h7
2 files changed, 21 insertions, 4 deletions
diff --git a/include/gui/BufferQueue.h b/include/gui/BufferQueue.h
index 7e404fe..408956b 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;
};
// ----------------------------------------------------------------------------
diff --git a/include/gui/IGraphicBufferProducer.h b/include/gui/IGraphicBufferProducer.h
index c3ede5e..342ba08 100644
--- a/include/gui/IGraphicBufferProducer.h
+++ b/include/gui/IGraphicBufferProducer.h
@@ -189,8 +189,11 @@ public:
//
// outWidth, outHeight and outTransform are filled with the default width
// and height of the window and current transform applied to buffers,
- // respectively.
- virtual status_t connect(int api, bool producerControlledByApp, QueueBufferOutput* output) = 0;
+ // respectively. The token needs to be any binder object that lives in the
+ // producer process -- it is solely used for obtaining a death notification
+ // when the producer is killed.
+ virtual status_t connect(const sp<IBinder>& token,
+ int api, bool producerControlledByApp, QueueBufferOutput* output) = 0;
// disconnect attempts to disconnect a client API from the
// IGraphicBufferProducer. Calling this method will cause any subsequent