* commit '1160e89d31810f2ba66f8ab502281579115b39b0': GLConsumer: Add query for current frame number.
This commit is contained in:
commit
3473e814a4
@ -141,6 +141,13 @@ public:
|
|||||||
// documented by the source.
|
// documented by the source.
|
||||||
int64_t getTimestamp();
|
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
|
// setDefaultBufferSize is used to set the size of buffers returned by
|
||||||
// requestBuffers when a with and height of zero is requested.
|
// requestBuffers when a with and height of zero is requested.
|
||||||
// A call to setDefaultBufferSize() may trigger requestBuffers() to
|
// A call to setDefaultBufferSize() may trigger requestBuffers() to
|
||||||
@ -337,6 +344,10 @@ private:
|
|||||||
// gets set each time updateTexImage is called.
|
// gets set each time updateTexImage is called.
|
||||||
int64_t mCurrentTimestamp;
|
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;
|
uint32_t mDefaultWidth, mDefaultHeight;
|
||||||
|
|
||||||
// mFilteringEnabled indicates whether the transform matrix is computed for
|
// mFilteringEnabled indicates whether the transform matrix is computed for
|
||||||
|
@ -96,6 +96,7 @@ GLConsumer::GLConsumer(const sp<IGraphicBufferConsumer>& bq, uint32_t tex,
|
|||||||
mCurrentScalingMode(NATIVE_WINDOW_SCALING_MODE_FREEZE),
|
mCurrentScalingMode(NATIVE_WINDOW_SCALING_MODE_FREEZE),
|
||||||
mCurrentFence(Fence::NO_FENCE),
|
mCurrentFence(Fence::NO_FENCE),
|
||||||
mCurrentTimestamp(0),
|
mCurrentTimestamp(0),
|
||||||
|
mCurrentFrameNumber(0),
|
||||||
mDefaultWidth(1),
|
mDefaultWidth(1),
|
||||||
mDefaultHeight(1),
|
mDefaultHeight(1),
|
||||||
mFilteringEnabled(true),
|
mFilteringEnabled(true),
|
||||||
@ -380,6 +381,7 @@ status_t GLConsumer::updateAndReleaseLocked(const BufferQueue::BufferItem& item)
|
|||||||
mCurrentScalingMode = item.mScalingMode;
|
mCurrentScalingMode = item.mScalingMode;
|
||||||
mCurrentTimestamp = item.mTimestamp;
|
mCurrentTimestamp = item.mTimestamp;
|
||||||
mCurrentFence = item.mFence;
|
mCurrentFence = item.mFence;
|
||||||
|
mCurrentFrameNumber = item.mFrameNumber;
|
||||||
|
|
||||||
computeCurrentTransformMatrixLocked();
|
computeCurrentTransformMatrixLocked();
|
||||||
|
|
||||||
@ -819,6 +821,12 @@ nsecs_t GLConsumer::getTimestamp() {
|
|||||||
return mCurrentTimestamp;
|
return mCurrentTimestamp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nsecs_t GLConsumer::getFrameNumber() {
|
||||||
|
ST_LOGV("getFrameNumber");
|
||||||
|
Mutex::Autolock lock(mMutex);
|
||||||
|
return mCurrentFrameNumber;
|
||||||
|
}
|
||||||
|
|
||||||
EGLImageKHR GLConsumer::createImage(EGLDisplay dpy,
|
EGLImageKHR GLConsumer::createImage(EGLDisplay dpy,
|
||||||
const sp<GraphicBuffer>& graphicBuffer) {
|
const sp<GraphicBuffer>& graphicBuffer) {
|
||||||
EGLClientBuffer cbuf = (EGLClientBuffer)graphicBuffer->getNativeBuffer();
|
EGLClientBuffer cbuf = (EGLClientBuffer)graphicBuffer->getNativeBuffer();
|
||||||
|
Loading…
Reference in New Issue
Block a user