28 cout <<
"Prints temperatures for all BMD devices. Takes no argument.\n\n";
29 IDeckLinkIterator *deckLinkIterator =
nullptr;
32 HRESULT result = CoInitializeEx(
nullptr, COINIT_MULTITHREADED);
36 result = CoCreateInstance(CLSID_CDeckLinkIterator,
nullptr, CLSCTX_ALL,
37 IID_IDeckLinkIterator, (
void **) &deckLinkIterator);
42 deckLinkIterator = CreateDeckLinkIteratorInstance();
44 if (deckLinkIterator ==
nullptr) {
50 IDeckLink *deckLink =
nullptr;
51 while (deckLinkIterator->Next(&deckLink) == S_OK)
53 IDeckLinkStatus *stat =
nullptr;
54 deckLink->QueryInterface(IID_IDeckLinkStatus,
reinterpret_cast<void**
>(&stat));
56 cout <<
"Device " << numDevices++ <<
" temperature: ";
57 if (HRESULT res = stat->GetInt(bmdDeckLinkStatusDeviceTemperature, &temp); res != S_OK) {
58 if (res == E_NOTIMPL) {
59 cout <<
"NOT IMPLEMENTED\n";
61 cout <<
"error: 0x" << hex <<
"\n";
69 if (numDevices == 0) {
70 cout <<
"\tno devices found!\n";
73 deckLinkIterator->Release();