2.3 Accessing DeckLink devices¶
Most DeckLink API object interfaces are accessed via the IDeckLinkIterator object. How a reference to an IDeckLinkIterator is obtained varies between platforms depending on their level of support for COM.
2.3.1 Windows¶
The main entry point to the DeckLink API is the IDeckLinkIterator interface. This interface should be obtained from COM using CoCreateInstance:
IDeckLinkIterator *deckLinkIterator = NULL;
CoCreateInstance(CLSID_CDeckLinkIterator, NULL, CLSCTX_ALL,
IID_IDeckLinkIterator, (void*)&deckLinkIterator);
On success, CoCreateInstance returns an HRESULT of S_OK and deckLinkIterator points to a new IDeckLinkIterator object interface.
2.3.2 macOS and Linux¶
On platforms without native COM support, a C entry point is provided to access an IDeckLinkIterator object:
IDeckLinkIterator *deckLinkIterator = CreateDeckLinkIteratorInstance();
On success, deckLinkIterator will point to a new IDeckLinkIterator object interface otherwise it will be set to NULL.