]> git.sesse.net Git - nageru/blobdiff - x264_encoder.h
Fix so that you can't right-click on non-signal channels anymore.
[nageru] / x264_encoder.h
index 9b6f74d31eb017ee2cdc150ec50f3d524babb4bf..7a155e341bd0e64b0f0153b8a2977058cd001bf3 100644 (file)
@@ -24,6 +24,7 @@
 #include <string>
 #include <thread>
 #include <unordered_map>
+#include <vector>
 
 extern "C" {
 #include <libavformat/avformat.h>
@@ -31,7 +32,10 @@ extern "C" {
 
 #include <movit/image_format.h>
 
+#include "defs.h"
+#include "metrics.h"
 #include "print_latency.h"
+#include "x264_dynamic.h"
 
 class Mux;
 class X264SpeedControl;
@@ -45,7 +49,7 @@ public:
        ~X264Encoder();
 
        // Must be called before first frame. Does not take ownership.
-       void set_mux(Mux *mux) { this->mux = mux; }
+       void add_mux(Mux *mux) { muxes.push_back(mux); }
 
        // <data> is taken to be raw NV12 data of WIDTHxHEIGHT resolution.
        // Does not block.
@@ -78,7 +82,7 @@ private:
        // pool.
        std::unique_ptr<uint8_t[]> frame_pool;
 
-       Mux *mux = nullptr;
+       std::vector<Mux *> muxes;
        bool wants_global_headers;
 
        std::string global_headers;
@@ -87,6 +91,7 @@ private:
        std::thread encoder_thread;
        std::atomic<bool> x264_init_done{false};
        std::atomic<bool> should_quit{false};
+       X264Dynamic dyn;
        x264_t *x264;
        std::unique_ptr<X264SpeedControl> speed_control;