- Posts: 16
- Joined: Wed Apr 14, 2021 11:53 am
- Real Name: Marco Könemann
Thanks for providing the code segment. The runtime_error will only occur when the Desktop Video software is not installed (when CLSID_CDeckLinkIterator is not registered). To check whether a device is connected, you need to call IDeckLinkIterator::Next() to iterate through connected devices:
- Code: Select all
// Add to initializeDeckLink
IDeckLink* deckLink = nullptr;
result = deckLinkIterator->Next(&deckLink);
if (result == S_OK)
{
// Device connected, deckLink is valid
}
else if (result == S_FALSE)
{
// No (more) devices connected
}
// Ensure that you release deckLinkIterator
deckLinkIterator->Release();
deckLinkIterator = nullptr;
If you have multiple devices connected, then you can call IDeckLinkIterator::Next within a while loop to iterate each IDeckLink object.
Regards
Cameron