]> git.sesse.net Git - nageru/blobdiff - x264_encoder.h
Move InputMapping and friends into its own header file.
[nageru] / x264_encoder.h
index 729cb7f02bcc0063861aa946ec700e6321e566b8..bb9f1dc066dd43b0b544b744452a1c93251a56da 100644 (file)
@@ -31,6 +31,7 @@ extern "C" {
 }
 
 class Mux;
+class X264SpeedControl;
 
 class X264Encoder {
 public:
@@ -49,6 +50,10 @@ public:
 
        std::string get_global_headers() const { return global_headers; }
 
+       void change_bitrate(unsigned rate_kbit) {
+               new_bitrate_kbit = rate_kbit;
+       }
+
 private:
        struct QueuedFrame {
                int64_t pts, duration;
@@ -72,6 +77,9 @@ private:
        std::thread encoder_thread;
        std::atomic<bool> should_quit{false};
        x264_t *x264;
+       std::unique_ptr<X264SpeedControl> speed_control;
+
+       std::atomic<unsigned> new_bitrate_kbit{0};  // 0 for no change.
 
        // Protects everything below it.
        std::mutex mu;