X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=x264_encoder.h;h=687bf718679c316a3b2e6a24a41c8e449d79c776;hb=9e47a2f661b9d292598ef0277e507458e3dad62f;hp=34cf70242b75dbb60cf806386bfcca74700c0e06;hpb=bd5b2de9a277b87c75d71d94bd8c5095ab14ecf7;p=nageru diff --git a/x264_encoder.h b/x264_encoder.h index 34cf702..687bf71 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; @@ -74,6 +77,9 @@ private: void init_x264(); void encode_frame(QueuedFrame qf); + // bitrate_kbit can be 0 for no change. + static void speed_control_override_func(unsigned bitrate_kbit, movit::YCbCrLumaCoefficients coefficients, x264_param_t *param); + // One big memory chunk of all 50 (or whatever) frames, allocated in // the constructor. All data functions just use pointers into this // pool. @@ -88,11 +94,10 @@ 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; - std::function bitrate_override_func; - std::atomic new_bitrate_kbit{0}; // 0 for no change. // Protects everything below it.