X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=x264_speed_control.h;h=bd58dcbf8773c6624706f23e6775ce2bc758bf0a;hb=e284d1c7a2e18ee7e4aea082c4a57a3504a0f5e8;hp=b45e6c6de285c90e866293f0aa95e52258601b2a;hpb=cf7b9ee186d4ef8e5da0531b75854c97b821be44;p=nageru diff --git a/x264_speed_control.h b/x264_speed_control.h index b45e6c6..bd58dcb 100644 --- a/x264_speed_control.h +++ b/x264_speed_control.h @@ -44,13 +44,17 @@ // some cleanup, but it's much, much better than just using a static preset. #include +#include #include #include extern "C" { -#include "x264.h" +#include } +#include "metrics.h" +#include "x264_dynamic.h" + class X264SpeedControl { public: // x264: Encoding object we are using; must be opened. Assumed to be @@ -95,6 +99,8 @@ private: int dither_preset(float f); void apply_preset(int new_preset); + X264Dynamic dyn; + // Not owned by us. x264_t *x264; @@ -123,4 +129,11 @@ 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}; };