From 1e7fa9e945d98eab76ff92f37c25040429a6c0a0 Mon Sep 17 00:00:00 2001 From: tedbo Date: Wed, 22 Jun 2011 15:52:53 -0700 Subject: [PATCH] Add method to create a ParcelSurfaceTexture from android.view.Surface. Change-Id: I05e343ab7e327478f60322af9373574b70c148f5 --- include/surfaceflinger/Surface.h | 2 ++ libs/gui/Surface.cpp | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/include/surfaceflinger/Surface.h b/include/surfaceflinger/Surface.h index 8845dc9e1..dc2a84562 100644 --- a/include/surfaceflinger/Surface.h +++ b/include/surfaceflinger/Surface.h @@ -40,6 +40,7 @@ namespace android { class GraphicBuffer; class GraphicBufferMapper; class IOMX; +class ISurfaceTexture; class Rect; class Surface; class SurfaceComposerClient; @@ -154,6 +155,7 @@ public: bool isValid(); uint32_t getFlags() const { return mFlags; } uint32_t getIdentity() const { return mIdentity; } + sp getSurfaceTexture(); // the lock/unlock APIs must be used from the same thread status_t lock(SurfaceInfo* info, bool blocking = true); diff --git a/libs/gui/Surface.cpp b/libs/gui/Surface.cpp index 4d1d923a4..9185e1e99 100644 --- a/libs/gui/Surface.cpp +++ b/libs/gui/Surface.cpp @@ -421,6 +421,10 @@ status_t Surface::validate(bool inCancelBuffer) const return NO_ERROR; } +sp Surface::getSurfaceTexture() { + return mSurface != NULL ? mSurface->getSurfaceTexture() : NULL; +} + sp Surface::asBinder() const { return mSurface!=0 ? mSurface->asBinder() : 0; }