Implement frame timestamps and use wpi::Now() for generation.

This commit is contained in:
Peter Johnson
2016-10-22 22:09:47 -07:00
parent aad1266a94
commit 1f6b386325
6 changed files with 23 additions and 7 deletions

View File

@@ -32,6 +32,16 @@ SourceImpl::~SourceImpl() {
// Everything else can clean up itself.
}
uint64_t SourceImpl::GetCurFrameTime() {
std::unique_lock<std::mutex> lock{m_frameMutex};
return m_frame.time();
}
Frame SourceImpl::GetCurFrame() {
std::unique_lock<std::mutex> lock{m_frameMutex};
return m_frame;
}
Frame SourceImpl::GetNextFrame() {
std::unique_lock<std::mutex> lock{m_frameMutex};
// TODO: handle spurious wakeup by comparing frame timestamps