]> git.sesse.net Git - nageru/blobdiff - video_encoder.h
Support audio-only FFmpeg inputs. Somewhat wonky, though.
[nageru] / video_encoder.h
index d51399e17a82c71bcbf31fbe7ba28115fc768b85..21595a380c992b7df76c0d3531e0cee72b5b2cfe 100644 (file)
@@ -20,6 +20,7 @@ extern "C" {
 #include <libavformat/avio.h>
 }
 
+#include "mux.h"
 #include "ref_counted_gl_sync.h"
 
 class AudioEncoder;
@@ -78,8 +79,8 @@ private:
        int write_packet2(uint8_t *buf, int buf_size, AVIODataMarkerType type, int64_t time);
 
        AVOutputFormat *oformat;
-       mutable std::mutex qs_mu;
-       std::unique_ptr<QuickSyncEncoder> quicksync_encoder;  // Under <qs_mu>.
+       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;
        QSurface *surface;
        std::string va_display;
@@ -94,6 +95,7 @@ private:
        std::unique_ptr<X264Encoder> x264_encoder;  // nullptr if not using x264.
 
        std::string stream_mux_header;
+       MuxMetrics stream_mux_metrics;
 
        std::atomic<int> quicksync_encoders_in_shutdown{0};
        std::atomic<int> overriding_bitrate{0};