]> git.sesse.net Git - nageru/blobdiff - mixer.h
Remove redundant constant declaration.
[nageru] / mixer.h
diff --git a/mixer.h b/mixer.h
index b9acfc4c607e2a9b880ef8dea5bc7867da9fa286..db6db15155bacb85fd0fe011296cf770422039f5 100644 (file)
--- a/mixer.h
+++ b/mixer.h
@@ -34,6 +34,7 @@
 #include "timebase.h"
 #include "stereocompressor.h"
 #include "filter.h"
+#include "input_state.h"
 
 class H264Encoder;
 class QSurface;
@@ -168,18 +169,13 @@ public:
                compressor_enabled = enabled;
        }
 
-       void reset_meters();
-
-       struct BufferedFrame {
-               RefCountedFrame frame;
-               unsigned field_number;
-       };
-
-       BufferedFrame get_buffered_frame(int card, int history_pos)
+       void schedule_cut()
        {
-               return buffered_frames[card][history_pos];
+               should_cut = true;
        }
 
+       void reset_meters();
+
 private:
        void bm_frame(unsigned card_index, uint16_t timecode,
                FrameAllocator::Frame video_frame, size_t video_offset, uint16_t video_format,
@@ -237,12 +233,7 @@ private:
        };
        CaptureCard cards[MAX_CARDS];  // protected by <bmusb_mutex>
 
-       // For each card, the last three frames (or fields), with 0 being the
-       // most recent one. Note that we only need the actual history if we have
-       // interlaced output (for deinterlacing), so if we detect progressive input,
-       // we immediately clear out all history and all entries will point to the same
-       // frame.
-       BufferedFrame buffered_frames[MAX_CARDS][FRAME_HISTORY_LENGTH];
+       InputState input_state;
 
        class OutputChannel {
        public:
@@ -266,9 +257,11 @@ private:
        std::thread mixer_thread;
        std::thread audio_thread;
        std::atomic<bool> should_quit{false};
+       std::atomic<bool> should_cut{false};
 
        audio_level_callback_t audio_level_callback = nullptr;
-       Ebu_r128_proc r128;
+       std::mutex r128_mutex;
+       Ebu_r128_proc r128;  // Under r128_mutex.
 
        Resampler peak_resampler;
        std::atomic<float> peak{0.0f};