From 83bac216a7ba8493a7916e40b2555e73c3a5cc1a Mon Sep 17 00:00:00 2001 From: Jamie Gennis Date: Wed, 2 Feb 2011 15:31:47 -0800 Subject: Pass the IGraphicBufferAlloc to SurfaceTextureClient. This change passes a reference to the IGraphicBufferAlloc binder object to SurfaceTextureClient objects. When STC objects are created they query their associated ISurfaceTexture object for the IGraphicBufferAlloc that the SurfaceTexture uses to allocate buffers. Having the SurfaceTextureClient hold this reference prevents the GraphicBufferAlloc in SurfaceFlinger from freeing the allocated buffers before the SurfaceTextureClient is done with them. Change-Id: Ib8e30e8b37fdd60438cbb4cb7e9174d0ba6d661c related-bug: 3362519 --- include/gui/SurfaceTextureClient.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/gui/SurfaceTextureClient.h') 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 mSurfaceTexture; + // mAllocator is the binder object that is referenced to prevent the + // dequeued buffers from being freed prematurely. + sp 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 -- cgit v1.2.3-59-g8ed1b