X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=nageru%2Fx264_encoder.h;h=8e1648288dc8600b6f04f37948c74ea4e60c926a;hb=a0e57ec99e9dfdd7e79bcf21e8c996dc43b6cb49;hp=9995c3f370452ba300b97d34e952f5c60f514a51;hpb=8202dbe236c5e206989c383004f9dba116ea12bd;p=nageru diff --git a/nageru/x264_encoder.h b/nageru/x264_encoder.h index 9995c3f..8e16482 100644 --- a/nageru/x264_encoder.h +++ b/nageru/x264_encoder.h @@ -16,7 +16,6 @@ #include #include #include -#include #include #include #include @@ -32,30 +31,29 @@ extern "C" { #include -#include "defs.h" -#include "shared/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, bool use_separate_disk_params); // 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); } // 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(); }