Reported by Marcus Nilsen.
-Subproject commit 0c0182f453e8bc26e630615ea6d2a2f05e868fde
+Subproject commit 327dca2d848e4c4656be1bfb54a2edf2e6587a71
DeckLinkCapture(IDeckLink *card, int card_index); // Takes ownership of <card>.
~DeckLinkCapture();
+ IDeckLinkInput *get_input() const { return input; }
+
// IDeckLinkInputCallback.
HRESULT STDMETHODCALLTYPE QueryInterface(REFIID, LPVOID *) override;
ULONG STDMETHODCALLTYPE AddRef() override;
});
}
-bool DeckLinkOutput::set_device(IDeckLink *decklink)
+bool DeckLinkOutput::set_device(IDeckLink *decklink, IDeckLinkInput *input_arg)
{
- if (decklink->QueryInterface(IID_IDeckLinkInput, (void**)&input) != S_OK) {
- input = nullptr;
- }
+ input_arg = input;
if (decklink->QueryInterface(IID_IDeckLinkOutput, (void**)&output) != S_OK) {
fprintf(stderr, "Warning: Card %u has no outputs\n", card_index);
return false;
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();
DeckLinkCapture *capture = new DeckLinkCapture(decklink, card_index);
DeckLinkOutput *output = new DeckLinkOutput(resource_pool.get(), decklink_output_surface, global_flags.width, global_flags.height, card_index);
- if (!output->set_device(decklink)) {
+ if (!output->set_device(decklink, capture->get_input())) {
delete output;
output = nullptr;
}