]> git.sesse.net Git - nageru/blobdiff - mixer.h
Implement oversampled peak detection.
[nageru] / mixer.h
diff --git a/mixer.h b/mixer.h
index 6725a7f46e242fe44bdba8a7c0e583b422b42102..0fd07aea05598f82ee0c1a3e2a46aeda821741f0 100644 (file)
--- a/mixer.h
+++ b/mixer.h
@@ -10,6 +10,7 @@
 
 #include <movit/effect_chain.h>
 #include <movit/flat_input.h>
+#include <zita-resampler/resampler.h>
 #include <atomic>
 #include <condition_variable>
 #include <cstddef>
@@ -27,7 +28,7 @@
 #include "pbo_frame_allocator.h"
 #include "ref_counted_frame.h"
 #include "ref_counted_gl_sync.h"
-#include "resampler.h"
+#include "resampling_queue.h"
 #include "theme.h"
 #include "timebase.h"
 #include "stereocompressor.h"
@@ -181,7 +182,7 @@ private:
                unsigned dropped_frames = 0;  // Before new_frame.
 
                std::mutex audio_mutex;
-               std::unique_ptr<Resampler> resampler;  // Under audio_mutex.
+               std::unique_ptr<ResamplingQueue> resampling_queue;  // Under audio_mutex.
                int last_timecode = -1;  // Unwrapped.
        };
        CaptureCard cards[MAX_CARDS];  // protected by <bmusb_mutex>
@@ -213,7 +214,7 @@ private:
        audio_level_callback_t audio_level_callback = nullptr;
        Ebu_r128_proc r128;
 
-       // TODO: Implement oversampled peak detection.
+       Resampler peak_resampler;
        std::atomic<float> peak{0.0f};
 
        StereoFilter locut;  // Default cutoff 150 Hz, 24 dB/oct.