diff options
author | Mathias Agopian <mathias@google.com> | 2011-05-11 15:05:29 -0700 |
---|---|---|
committer | Mathias Agopian <mathias@google.com> | 2011-05-11 18:01:51 -0700 |
commit | e845c352c8eb93412fa7caedb5435d3597c795d0 (patch) | |
tree | 615a7bacd4bf4112fb9fc443d565ab1805c7fed9 /include/gui/SurfaceTexture.h | |
parent | 7f3289c95ec489651f1c04f1a71cfc7a8b535805 (diff) | |
download | frameworks_base-e845c352c8eb93412fa7caedb5435d3597c795d0.zip frameworks_base-e845c352c8eb93412fa7caedb5435d3597c795d0.tar.gz frameworks_base-e845c352c8eb93412fa7caedb5435d3597c795d0.tar.bz2 |
fix onFrameAvailable
Change-Id: I391fe9f6684ac9fd4f91416ce18b583f7087d966
Diffstat (limited to 'include/gui/SurfaceTexture.h')
-rw-r--r-- | include/gui/SurfaceTexture.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/gui/SurfaceTexture.h b/include/gui/SurfaceTexture.h index 45f1821..43b2fa9 100644 --- a/include/gui/SurfaceTexture.h +++ b/include/gui/SurfaceTexture.h @@ -46,6 +46,11 @@ public: enum { NUM_BUFFER_SLOTS = 32 }; struct FrameAvailableListener : public virtual RefBase { + // onFrameAvailable() is called from queueBuffer() is the FIFO is + // empty. You can use SurfaceTexture::getQueuedCount() to + // figure out if there are more frames waiting. + // This is called without any lock held can be called concurrently by + // multiple threads. virtual void onFrameAvailable() = 0; }; @@ -96,6 +101,11 @@ public: // target texture belongs is bound to the calling thread. status_t updateTexImage(); + // getqueuedCount returns the number of queued frames waiting in the + // FIFO. In asynchronous mode, this always returns 0 or 1 since + // frames are not accumulating in the FIFO. + size_t getQueuedCount() const; + // setBufferCountServer set the buffer count. If the client has requested // a buffer count using setBufferCount, the server-buffer count will // take effect once the client sets the count back to zero. |