diff options
| author | 2011-02-02 16:21:24 -0800 | |
|---|---|---|
| committer | 2011-02-02 16:21:24 -0800 | |
| commit | a257be1895218e5c3e153313db9dd703fd9cc84f (patch) | |
| tree | 457726588b7e414388795ed24f1c38a67dc96dd6 /include | |
| parent | 9d3fb3717f2acec71a3330e448ecf63ee997b1f8 (diff) | |
| parent | 421d94c20321e1de528416b279bf148baba47b39 (diff) | |
am 421d94c2: am ecb4b3f0: Merge "Pass the IGraphicBufferAlloc to SurfaceTextureClient." into honeycomb
* commit '421d94c20321e1de528416b279bf148baba47b39':
Pass the IGraphicBufferAlloc to SurfaceTextureClient.
Diffstat (limited to 'include')
| -rw-r--r-- | include/gui/ISurfaceTexture.h | 6 | ||||
| -rw-r--r-- | include/gui/SurfaceTexture.h | 6 | ||||
| -rw-r--r-- | include/gui/SurfaceTextureClient.h | 4 |
3 files changed, 16 insertions, 0 deletions
diff --git a/include/gui/ISurfaceTexture.h b/include/gui/ISurfaceTexture.h index 77d37f13ceb0..168310cf06c9 100644 --- a/include/gui/ISurfaceTexture.h +++ b/include/gui/ISurfaceTexture.h @@ -72,6 +72,12 @@ public: virtual status_t setCrop(const Rect& reg) = 0; virtual status_t setTransform(uint32_t transform) = 0; + + // getAllocator retrieves the binder object that must be referenced as long + // as the GraphicBuffers dequeued from this ISurfaceTexture are referenced. + // Holding this binder reference prevents SurfaceFlinger from freeing the + // buffers before the client is done with them. + virtual sp<IBinder> getAllocator() = 0; }; // ---------------------------------------------------------------------------- diff --git a/include/gui/SurfaceTexture.h b/include/gui/SurfaceTexture.h index 79c33f54f559..31615d008e29 100644 --- a/include/gui/SurfaceTexture.h +++ b/include/gui/SurfaceTexture.h @@ -101,6 +101,12 @@ public: // when a new frame becomes available. void setFrameAvailableListener(const sp<FrameAvailableListener>& l); + // getAllocator retrieves the binder object that must be referenced as long + // as the GraphicBuffers dequeued from this SurfaceTexture are referenced. + // Holding this binder reference prevents SurfaceFlinger from freeing the + // buffers before the client is done with them. + sp<IBinder> getAllocator(); + private: // freeAllBuffers frees the resources (both GraphicBuffer and EGLImage) for diff --git a/include/gui/SurfaceTextureClient.h b/include/gui/SurfaceTextureClient.h index dd1d490aebb9..ff2251d893a8 100644 --- a/include/gui/SurfaceTextureClient.h +++ b/include/gui/SurfaceTextureClient.h @@ -83,6 +83,10 @@ private: // interactions with the server using this interface. sp<ISurfaceTexture> mSurfaceTexture; + // mAllocator is the binder object that is referenced to prevent the + // dequeued buffers from being freed prematurely. + sp<IBinder> mAllocator; + // mSlots stores the buffers that have been allocated for each buffer slot. // It is initialized to null pointers, and gets filled in with the result of // ISurfaceTexture::requestBuffer when the client dequeues a buffer from a |