Skip to content
Snippets Groups Projects
Commit bd2684b6 authored by Nicolas Pope's avatar Nicolas Pope
Browse files

Display time in playback

parent 302f396d
No related branches found
No related tags found
1 merge request!127Implements #196 stream capturing
...@@ -71,6 +71,8 @@ int main(int argc, char **argv) { ...@@ -71,6 +71,8 @@ int main(int argc, char **argv) {
} }
if (!frame.empty()) { if (!frame.empty()) {
double time = (double)(spkt.timestamp - r.getStartTime()) / 1000.0;
cv::putText(frame, std::string("Time: ") + std::to_string(time) + std::string("s"), cv::Point(10,20), cv::FONT_HERSHEY_PLAIN, 1, cv::Scalar(0,0,255));
cv::imshow("Player", frame); cv::imshow("Player", frame);
} }
int key = cv::waitKey(20); int key = cv::waitKey(20);
......
...@@ -39,6 +39,8 @@ class Reader { ...@@ -39,6 +39,8 @@ class Reader {
bool begin(); bool begin();
bool end(); bool end();
inline int64_t getStartTime() const { return timestart_; };
private: private:
std::istream *stream_; std::istream *stream_;
msgpack::unpacker buffer_; msgpack::unpacker buffer_;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment