GLConsumer: Add query for current frame number.
Surface the underlying frame number of the current texture.
Bug: 10830400
Change-Id: Ide3a7da12ea0aac54588beb6bf00dbfe2cd37653
diff --git a/include/gui/GLConsumer.h b/include/gui/GLConsumer.h
index 00f38b4..75ee30c 100644
--- a/include/gui/GLConsumer.h
+++ b/include/gui/GLConsumer.h
@@ -141,6 +141,13 @@
// documented by the source.
int64_t getTimestamp();
+ // getFrameNumber retrieves the frame number associated with the texture
+ // image set by the most recent call to updateTexImage.
+ //
+ // The frame number is an incrementing counter set to 0 at the creation of
+ // the BufferQueue associated with this consumer.
+ int64_t getFrameNumber();
+
// setDefaultBufferSize is used to set the size of buffers returned by
// requestBuffers when a with and height of zero is requested.
// A call to setDefaultBufferSize() may trigger requestBuffers() to
@@ -337,6 +344,10 @@
// gets set each time updateTexImage is called.
int64_t mCurrentTimestamp;
+ // mCurrentFrameNumber is the frame counter for the current texture.
+ // It gets set each time updateTexImage is called.
+ int64_t mCurrentFrameNumber;
+
uint32_t mDefaultWidth, mDefaultHeight;
// mFilteringEnabled indicates whether the transform matrix is computed for