X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=print_latency.h;fp=print_latency.h;h=9d8a93b0ff47a751826dd44206268fb307b18775;hb=63a912898083c06cc75f336f8d9a367a707e378a;hp=0000000000000000000000000000000000000000;hpb=112ce67402abfb6163403697c8a4f0fb736101ca;p=nageru diff --git a/print_latency.h b/print_latency.h new file mode 100644 index 0000000..9d8a93b --- /dev/null +++ b/print_latency.h @@ -0,0 +1,21 @@ +#ifndef _PRINT_LATENCY_H +#define _PRINT_LATENCY_H 1 + +// A small utility function to print the latency between two end points +// (typically when the frame was received from the video card, and some +// point when the frame is ready to be output in some form). + +#include +#include + +// Since every output frame is based on multiple input frames, we need +// more than one start timestamp. For now, we keep just the smallest +// and largest timestamp, so that we can print out a range. +// For both of these, steady_clock::time_point::min() is used for “not set”. +struct ReceivedTimestamps { + std::chrono::steady_clock::time_point min_ts, max_ts; +}; + +void print_latency(const std::string &header, const ReceivedTimestamps &received_ts, bool is_b_frame, int *frameno); + +#endif // !defined(_PRINT_LATENCY_H)