]> git.sesse.net Git - nageru/blobdiff - nageru/x264_encoder.h
Fix a Clang 19 warning.
[nageru] / nageru / x264_encoder.h
index 687bf718679c316a3b2e6a24a41c8e449d79c776..8e1648288dc8600b6f04f37948c74ea4e60c926a 100644 (file)
@@ -16,7 +16,6 @@
 #include <stdint.h>
 #include <x264.h>
 #include <atomic>
-#include <chrono>
 #include <condition_variable>
 #include <memory>
 #include <mutex>
@@ -32,30 +31,29 @@ extern "C" {
 
 #include <movit/image_format.h>
 
-#include "defs.h"
-#include "metrics.h"
 #include "print_latency.h"
+#include "video_codec_interface.h"
 #include "x264_dynamic.h"
 
 class Mux;
 class X264SpeedControl;
 
-class X264Encoder {
+class X264Encoder : public VideoCodecInterface {
 public:
-       X264Encoder(AVOutputFormat *oformat);  // Does not take ownership.
+       X264Encoder(const AVOutputFormat *oformat, bool use_separate_disk_params);  // Does not take ownership.
 
        // Called after the last frame. Will block; once this returns,
        // the last data is flushed.
-       ~X264Encoder();
+       ~X264Encoder() override;
 
        // Must be called before first frame. Does not take ownership.
-       void add_mux(Mux *mux) { muxes.push_back(mux); }
+       void add_mux(Mux *mux) override { muxes.push_back(mux); }
 
        // <data> is taken to be raw NV12 data of WIDTHxHEIGHT resolution.
        // Does not block.
-       void add_frame(int64_t pts, int64_t duration, movit::YCbCrLumaCoefficients ycbcr_coefficients, 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) override;
 
-       std::string get_global_headers() const {
+       std::string get_global_headers() const override {
                while (!x264_init_done) {
                        sched_yield();
                }
@@ -86,7 +84,8 @@ private:
        std::unique_ptr<uint8_t[]> frame_pool;
 
        std::vector<Mux *> muxes;
-       bool wants_global_headers;
+       const bool wants_global_headers;
+       const bool use_separate_disk_params;
 
        std::string global_headers;
        std::string buffered_sei;  // Will be output before first frame, if any.