]> git.sesse.net Git - nageru/blobdiff - shared/mux.h
Fix a Clang 19 warning.
[nageru] / shared / mux.h
index 075da1688f76d4dcba6a1760913657602463638d..5020f37d943c64e98ee73c1d8e7771a2da88659d 100644 (file)
@@ -51,7 +51,6 @@ public:
        enum Codec {
                CODEC_H264,
                CODEC_AV1,
-               CODEC_NV12,  // Uncompressed 4:2:0.
                CODEC_MJPEG
        };
        enum WriteStrategy {
@@ -93,10 +92,17 @@ public:
        void plug();
        void unplug();
 
+       // Temporary stop the mux; any packets coming in are discarded, and any existing ones
+       // in the queue will be dropped. Any writes in progress will finish as usual.
+       // Incompatible with plug().
+       void drain();
+       void undrain();
+
 private:
        // If write_strategy == WRITE_FOREGORUND, Must be called with <mu> held.
        void write_packet_or_die(const AVPacket &pkt, int64_t unscaled_pts);
        void thread_func();
+       void write_header();
 
        WriteStrategy write_strategy;
 
@@ -108,6 +114,7 @@ private:
 
        AVFormatContext *avctx;  // Protected by <mu>, iff write_strategy == WRITE_BACKGROUND.
        int plug_count = 0;  // Protected by <mu>.
+       bool drained = false;  // Protected by <mu>.
 
        // Protected by <mu>. If write_strategy == WRITE_FOREGROUND,
        // this is only in use when plugging.