X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=nageru%2Fdecklink_output.h;h=8213f498a9d0677df7fe77b928acc7dce8951825;hb=ccc2b89c9cf879ccbd948e169a029917cc16f0ee;hp=90b89a22a18f1f6e0de7a9352d94d437415f79f3;hpb=eeda8995329601f9f4e35047358400833eeae68e;p=nageru diff --git a/nageru/decklink_output.h b/nageru/decklink_output.h index 90b89a2..8213f49 100644 --- a/nageru/decklink_output.h +++ b/nageru/decklink_output.h @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include @@ -38,7 +39,11 @@ class DeckLinkOutput : public IDeckLinkVideoOutputCallback { public: DeckLinkOutput(movit::ResourcePool *resource_pool, QSurface *surface, unsigned width, unsigned height, unsigned card_index); - bool set_device(IDeckLink *output); + // The IDecklinkInput argument is to work around a bug + // in the 11.7 and newer drivers against older SDKs, + // where you get a freeze if querying an IDeckLinkInput interface + // on an already-started card. + bool set_device(IDeckLink *decklink, IDeckLinkInput *input_arg); void start_output(uint32_t mode, int64_t base_pts); // Mode comes from get_available_video_modes(). void end_output(); @@ -133,7 +138,8 @@ private: std::mutex frame_queue_mutex; std::queue> pending_video_frames; // Under . std::queue> frame_freelist; // Under . - int num_frames_in_flight = 0; // Number of frames allocated but not on the freelist. Under . + std::deque scheduled_frames; // Owned by the driver, so no unique_ptr. Under . + std::condition_variable frame_queues_changed; bool playback_initiated = false, playback_started = false; int64_t base_pts, frame_duration; @@ -141,6 +147,7 @@ private: bool last_frame_had_mode_mismatch = false; movit::ResourcePool *resource_pool; + IDeckLinkInput *input = nullptr; IDeckLinkOutput *output = nullptr; BMDVideoConnection video_connection; QSurface *surface;