X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=x264_encoder.h;h=2f9c81c4f51e91748680bb8f84234b4f313414e1;hb=1836dccf699779d9092a75755cec96cea1734a2a;hp=34cf70242b75dbb60cf806386bfcca74700c0e06;hpb=bd5b2de9a277b87c75d71d94bd8c5095ab14ecf7;p=nageru diff --git a/x264_encoder.h b/x264_encoder.h index 34cf702..2f9c81c 100644 --- a/x264_encoder.h +++ b/x264_encoder.h @@ -32,7 +32,10 @@ extern "C" { #include +#include "defs.h" +#include "metrics.h" #include "print_latency.h" +#include "x264_dynamic.h" class Mux; class X264SpeedControl; @@ -88,6 +91,7 @@ private: std::thread encoder_thread; std::atomic x264_init_done{false}; std::atomic should_quit{false}; + X264Dynamic dyn; x264_t *x264; std::unique_ptr speed_control; @@ -111,6 +115,16 @@ private: // Key is the pts of the frame. std::unordered_map frames_being_encoded; + + // Metrics. + std::atomic metric_x264_queued_frames{0}; + std::atomic metric_x264_max_queued_frames{X264_QUEUE_LENGTH}; + std::atomic metric_x264_dropped_frames{0}; + std::atomic metric_x264_output_frames_i{0}; + std::atomic metric_x264_output_frames_p{0}; + std::atomic metric_x264_output_frames_b{0}; + Histogram metric_x264_crf; + LatencyHistogram latency_histogram; }; #endif // !defined(_X264ENCODE_H)