X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=x264_speed_control.h;h=b0a1739d022e462c48c7e80e7b73b905fcdb6411;hb=ec67a4b205b93f3d260470485949b29abac6ad21;hp=de88f66705a7f15a068c91cb84f6e3e815852c34;hpb=0556d8cb8416bdc7b432a432c3d58239a94358d2;p=nageru diff --git a/x264_speed_control.h b/x264_speed_control.h index de88f66..b0a1739 100644 --- a/x264_speed_control.h +++ b/x264_speed_control.h @@ -1,3 +1,6 @@ +#ifndef _X264_SPEED_CONTROL_H +#define _X264_SPEED_CONTROL_H 1 + // The x264 speed control tries to encode video at maximum possible quality // without skipping frames (at the expense of higher encoding latency and // less even output rates, although VBV is still respected). It does this @@ -44,6 +47,7 @@ // some cleanup, but it's much, much better than just using a static preset. #include +#include #include #include @@ -51,6 +55,7 @@ extern "C" { #include } +#include "metrics.h" #include "x264_dynamic.h" class X264SpeedControl { @@ -127,4 +132,13 @@ private: } stat; std::function override_func = nullptr; + + // Metrics. + Histogram metric_x264_speedcontrol_preset_used_frames; + std::atomic metric_x264_speedcontrol_buffer_available_seconds{0.0}; + std::atomic metric_x264_speedcontrol_buffer_size_seconds{0.0}; + std::atomic metric_x264_speedcontrol_idle_frames{0}; + std::atomic metric_x264_speedcontrol_late_frames{0}; }; + +#endif // !defined(_X264_SPEED_CONTROL_H)