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

@@ -401,9 +401,7 @@ void MJPEGServerImpl::SendStream(wpi::raw_socket_ostream& os) {
// print the individual mimetype and the length
// sending the content-length fixes random stream disruption observed
// with firefox
double timestamp = std::chrono::duration_cast<std::chrono::seconds>(
frame.time().time_since_epoch())
.count();
double timestamp = frame.time() / 10000000.0;
header.clear();
oss << "Content-Type: image/jpeg\r\n"
<< "Content-Length: " << frame.size() << "\r\n"