本文整理汇总了C++中IDeckLinkIterator::QueryInterface方法的典型用法代码示例。如果您正苦于以下问题:C++ IDeckLinkIterator::QueryInterface方法的具体用法?C++ IDeckLinkIterator::QueryInterface怎么用?C++ IDeckLinkIterator::QueryInterface使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDeckLinkIterator
的用法示例。
在下文中一共展示了IDeckLinkIterator::QueryInterface方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CoInitialize
int _tmain (int argc, _TCHAR* argv[])
{
IDeckLinkIterator* deckLinkIterator;
IDeckLinkAPIInformation* deckLinkAPIInformation;
IDeckLink* deckLink;
int numDevices = 0;
HRESULT result;
// Initialize COM on this thread
result = CoInitialize(NULL);
if (FAILED(result))
{
fprintf(stderr, "Initialization of COM failed - result = %08x.\n", result);
return 1;
}
// Create an IDeckLinkIterator object to enumerate all DeckLink cards in the system
result = CoCreateInstance(CLSID_CDeckLinkIterator, NULL, CLSCTX_ALL, IID_IDeckLinkIterator, (void**)&deckLinkIterator);
if (FAILED(result))
{
fprintf(stderr, "A DeckLink iterator could not be created. The DeckLink drivers may not be installed.\n");
return 1;
}
// We can get the version of the API like this:
result = deckLinkIterator->QueryInterface(IID_IDeckLinkAPIInformation, (void**)&deckLinkAPIInformation);
if (result == S_OK)
{
LONGLONG deckLinkVersion;
int dlVerMajor, dlVerMinor, dlVerPoint;
// We can also use the BMDDeckLinkAPIVersion flag with GetString
deckLinkAPIInformation->GetInt(BMDDeckLinkAPIVersion, &deckLinkVersion);
dlVerMajor = (deckLinkVersion & 0xFF000000) >> 24;
dlVerMinor = (deckLinkVersion & 0x00FF0000) >> 16;
dlVerPoint = (deckLinkVersion & 0x0000FF00) >> 8;
printf("DeckLinkAPI version: %d.%d.%d\n", dlVerMajor, dlVerMinor, dlVerPoint);
deckLinkAPIInformation->Release();
}