]> git.sesse.net Git - nageru/blobdiff - decklink_output.h
Release Nageru 1.7.2.
[nageru] / decklink_output.h
index 7c0a17fad2d483c88a5232113f1bc1601bbb3bfb..44eb86dea9860e6480c4552aeaf352a5990bf979 100644 (file)
@@ -19,6 +19,7 @@
 
 #include "context.h"
 #include "print_latency.h"
+#include "quittable_sleeper.h"
 #include "ref_counted_frame.h"
 #include "ref_counted_gl_sync.h"
 
@@ -37,7 +38,7 @@ class DeckLinkOutput : public IDeckLinkVideoOutputCallback {
 public:
        DeckLinkOutput(movit::ResourcePool *resource_pool, QSurface *surface, unsigned width, unsigned height, unsigned card_index);
 
-       void set_device(IDeckLink *output);
+       bool set_device(IDeckLink *output);
        void start_output(uint32_t mode, int64_t base_pts);  // Mode comes from get_available_video_modes().
        void end_output();
 
@@ -127,7 +128,7 @@ private:
        std::map<uint32_t, bmusb::VideoMode> video_modes;
 
        std::thread present_thread;
-       std::atomic<bool> should_quit{false};
+       QuittableSleeper should_quit;
 
        std::mutex frame_queue_mutex;
        std::queue<std::unique_ptr<Frame>> pending_video_frames;  // Under <frame_queue_mutex>.