X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=x264_encoder.h;h=2e64e66118328cd99e7240d5fcef22a257f7a0fe;hb=ee7da87b4aa284b7babd59dc21db925f7c384ce7;hp=8adb42ae19102808b2f35d3395aeb3a83e50d9e0;hpb=336009fd7baf47b4ad71adf8d7ead8a526045788;p=nageru diff --git a/x264_encoder.h b/x264_encoder.h index 8adb42a..2e64e66 100644 --- a/x264_encoder.h +++ b/x264_encoder.h @@ -33,6 +33,8 @@ extern "C" { #include } +#include + #include "print_latency.h" class Mux; @@ -51,7 +53,7 @@ public: // is taken to be raw NV12 data of WIDTHxHEIGHT resolution. // Does not block. - void add_frame(int64_t pts, int64_t duration, const uint8_t *data, const ReceivedTimestamps &received_ts); + void add_frame(int64_t pts, int64_t duration, movit::YCbCrLumaCoefficients ycbcr_coefficients, const uint8_t *data, const ReceivedTimestamps &received_ts); std::string get_global_headers() const { while (!x264_init_done) { @@ -67,6 +69,7 @@ public: private: struct QueuedFrame { int64_t pts, duration; + movit::YCbCrLumaCoefficients ycbcr_coefficients; uint8_t *data; ReceivedTimestamps received_ts; }; @@ -91,6 +94,8 @@ private: 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.