Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1e7fa9e9 authored by tedbo's avatar tedbo
Browse files

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

Change-Id: I05e343ab7e327478f60322af9373574b70c148f5
parent 5299258c
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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<ISurfaceTexture> getSurfaceTexture();

    // the lock/unlock APIs must be used from the same thread
    status_t    lock(SurfaceInfo* info, bool blocking = true);
+4 −0
Original line number Diff line number Diff line
@@ -421,6 +421,10 @@ status_t Surface::validate(bool inCancelBuffer) const
    return NO_ERROR;
}

sp<ISurfaceTexture> Surface::getSurfaceTexture() {
    return mSurface != NULL ? mSurface->getSurfaceTexture() : NULL;
}

sp<IBinder> Surface::asBinder() const {
    return mSurface!=0 ? mSurface->asBinder() : 0;
}