From 64f3a629801567370bc3f2dbda47f9981f2731be Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Sat, 21 Jan 2017 21:38:51 +0100 Subject: [PATCH] If a DeckLink card has multiple subdevices, label them. Makes it slightly easier to tell the devices apart on e.g. a Duo 2. --- decklink_capture.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/decklink_capture.cpp b/decklink_capture.cpp index 892660d..348ee28 100644 --- a/decklink_capture.cpp +++ b/decklink_capture.cpp @@ -205,6 +205,16 @@ DeckLinkCapture::DeckLinkCapture(IDeckLink *card, int card_index) } } + // 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; + } + } + attr->Release(); /* Set up the video and audio sources. */ -- 2.39.2