diff options
Diffstat (limited to 'include/gui/ISurfaceTexture.h')
-rw-r--r-- | include/gui/ISurfaceTexture.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/include/gui/ISurfaceTexture.h b/include/gui/ISurfaceTexture.h index 168310c..d2d3bb8 100644 --- a/include/gui/ISurfaceTexture.h +++ b/include/gui/ISurfaceTexture.h @@ -36,6 +36,8 @@ class ISurfaceTexture : public IInterface public: DECLARE_META_INTERFACE(SurfaceTexture); + enum { BUFFER_NEEDS_REALLOCATION = 1 }; + // requestBuffer requests a new buffer for the given index. The server (i.e. // the ISurfaceTexture implementation) assigns the newly created buffer to // the given slot index, and the client is expected to mirror the @@ -56,14 +58,19 @@ public: // should call requestBuffer to assign a new buffer to that slot. The client // is expected to either call cancelBuffer on the dequeued slot or to fill // in the contents of its associated buffer contents and call queueBuffer. + // If dequeueBuffer return BUFFER_NEEDS_REALLOCATION, the client is + // expected to call requestBuffer immediately. virtual status_t dequeueBuffer(int *slot) = 0; // queueBuffer indicates that the client has finished filling in the // contents of the buffer associated with slot and transfers ownership of // that slot back to the server. It is not valid to call queueBuffer on a // slot that is not owned by the client or one for which a buffer associated - // via requestBuffer. - virtual status_t queueBuffer(int slot) = 0; + // via requestBuffer. In addition, a timestamp must be provided by the + // client for this buffer. The timestamp is measured in nanoseconds, and + // must be monotonically increasing. Its other properties (zero point, etc) + // are client-dependent, and should be documented by the client. + virtual status_t queueBuffer(int slot, int64_t timestamp) = 0; // cancelBuffer indicates that the client does not wish to fill in the // buffer associated with slot and transfers ownership of the slot back to |