Add method to create a ParcelSurfaceTexture from android.view.Surface.

Change-Id: I05e343ab7e327478f60322af9373574b70c148f5
This commit is contained in:
tedbo 2011-06-22 15:52:53 -07:00
parent 5299258ce2
commit 1e7fa9e945
2 changed files with 6 additions and 0 deletions

View File

@ -40,6 +40,7 @@ namespace android {
class GraphicBuffer; class GraphicBuffer;
class GraphicBufferMapper; class GraphicBufferMapper;
class IOMX; class IOMX;
class ISurfaceTexture;
class Rect; class Rect;
class Surface; class Surface;
class SurfaceComposerClient; class SurfaceComposerClient;
@ -154,6 +155,7 @@ public:
bool isValid(); bool isValid();
uint32_t getFlags() const { return mFlags; } uint32_t getFlags() const { return mFlags; }
uint32_t getIdentity() const { return mIdentity; } uint32_t getIdentity() const { return mIdentity; }
sp<ISurfaceTexture> getSurfaceTexture();
// the lock/unlock APIs must be used from the same thread // the lock/unlock APIs must be used from the same thread
status_t lock(SurfaceInfo* info, bool blocking = true); status_t lock(SurfaceInfo* info, bool blocking = true);

View File

@ -421,6 +421,10 @@ status_t Surface::validate(bool inCancelBuffer) const
return NO_ERROR; return NO_ERROR;
} }
sp<ISurfaceTexture> Surface::getSurfaceTexture() {
return mSurface != NULL ? mSurface->getSurfaceTexture() : NULL;
}
sp<IBinder> Surface::asBinder() const { sp<IBinder> Surface::asBinder() const {
return mSurface!=0 ? mSurface->asBinder() : 0; return mSurface!=0 ? mSurface->asBinder() : 0;
} }