X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=print_latency.h;h=3b0adb1e77244e0b422e93118e6c36c1e92295d4;hb=96cb6414f85e0ef4d660b7bd56267303e80fcd05;hp=9d8a93b0ff47a751826dd44206268fb307b18775;hpb=63a912898083c06cc75f336f8d9a367a707e378a;p=nageru diff --git a/print_latency.h b/print_latency.h index 9d8a93b..3b0adb1 100644 --- a/print_latency.h +++ b/print_latency.h @@ -7,15 +7,26 @@ #include #include +#include + +#include "ref_counted_frame.h" +#include "metrics.h" // 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”. +// more than one start timestamp; one for each input. +// For all of these, steady_clock::time_point::min() is used for “not set”. struct ReceivedTimestamps { - std::chrono::steady_clock::time_point min_ts, max_ts; + std::vector ts; +}; +struct LatencyHistogram { + void init(const std::string &measuring_point); // Initializes histograms and registers them in global_metrics. + + // Indices: card number, frame history number, b-frame or not (1/0). + std::vector>> histograms; }; -void print_latency(const std::string &header, const ReceivedTimestamps &received_ts, bool is_b_frame, int *frameno); +ReceivedTimestamps find_received_timestamp(const std::vector &input_frames); + +void print_latency(const std::string &header, const ReceivedTimestamps &received_ts, bool is_b_frame, int *frameno, LatencyHistogram *histogram); #endif // !defined(_PRINT_LATENCY_H)