+ // Check if we the card supports input autodetection.
+ if (attr->GetFlag(BMDDeckLinkSupportsInputFormatDetection, &supports_autodetect) != S_OK) {
+ fprintf(stderr, "Warning: Failed to ask card %d whether it supports input format autodetection\n", card_index);
+ supports_autodetect = false;
+ }
+
+ // If there's more than one subdevice on this card, label them.
+ int64_t num_subdevices, subdevice_idx;
+ if (attr->GetInt(BMDDeckLinkNumberOfSubDevices, &num_subdevices) == S_OK && num_subdevices > 1) {
+ if (attr->GetInt(BMDDeckLinkSubDeviceIndex, &subdevice_idx) == S_OK) {
+ char buf[256];
+ snprintf(buf, sizeof(buf), " (subdevice %d)", int(subdevice_idx));
+ description += buf;
+ }
+ }
+