]> git.sesse.net Git - nageru/blobdiff - nageru/video_encoder.h
Support AV1 streaming over HTTP, via SVT-AV1.
[nageru] / nageru / video_encoder.h
index 76dd92fa12cb12ef7dc2d439f9f335d75dcaf6b4..7a5fef1ac4dfd9cadc07bc6492b1281213a327f4 100644 (file)
@@ -24,6 +24,7 @@ extern "C" {
 #include "shared/ref_counted_gl_sync.h"
 
 class AudioEncoder;
+class AV1Encoder;
 class DiskSpaceEstimator;
 class HTTPD;
 class Mux;
@@ -51,7 +52,7 @@ public:
        //
        // The semantics of y_tex and cbcr_tex depend on is_zerocopy():
        //
-       //   - If false, the are input parameters, ie., the caller
+       //   - If false, they are input parameters, ie., the caller
        //     allocates textures. (The contents are not read before
        //     end_frame() is called.)
        //   - If true, they are output parameters, ie., VideoEncoder
@@ -78,7 +79,7 @@ private:
        static int write_packet2_thunk(void *opaque, uint8_t *buf, int buf_size, AVIODataMarkerType type, int64_t time);
        int write_packet2(uint8_t *buf, int buf_size, AVIODataMarkerType type, int64_t time);
 
-       AVOutputFormat *oformat;
+       const AVOutputFormat *oformat;
        mutable std::mutex qs_mu, qs_audio_mu;
        std::unique_ptr<QuickSyncEncoder> quicksync_encoder;  // Under <qs_mu> _and_ <qs_audio_mu>.
        movit::ResourcePool *resource_pool;
@@ -93,6 +94,10 @@ private:
        std::unique_ptr<Mux> stream_mux;  // To HTTP.
        std::unique_ptr<AudioEncoder> stream_audio_encoder;
        std::unique_ptr<X264Encoder> x264_encoder;  // nullptr if not using x264.
+       std::unique_ptr<X264Encoder> x264_disk_encoder;  // nullptr if not using x264, or if not having separate disk encodes.
+#ifdef HAVE_AV1
+       std::unique_ptr<AV1Encoder> av1_encoder;  // nullptr if not using SVT-AV1.
+#endif
 
        std::string stream_mux_header;
        MuxMetrics stream_mux_metrics;