+ // And then the available audio inputs.
+ int64_t audio_input_mask;
+ if (attr->GetInt(BMDDeckLinkAudioInputConnections, &audio_input_mask) != S_OK) {
+ fprintf(stderr, "Failed to enumerate audio inputs for card %d\n", card_index);
+ exit(1);
+ }
+ const vector<pair<BMDAudioConnection, string>> audio_input_types = {
+ { bmdAudioConnectionEmbedded, "Embedded" },
+ { bmdAudioConnectionAESEBU, "AES/EBU" },
+ { bmdAudioConnectionAnalog, "Analog" },
+ { bmdAudioConnectionAnalogXLR, "Analog XLR" },
+ { bmdAudioConnectionAnalogRCA, "Analog RCA" },
+ { bmdAudioConnectionMicrophone, "Microphone" },
+ { bmdAudioConnectionHeadphones, "Headphones" }
+ };
+ for (const auto &audio_input : audio_input_types) {
+ if (audio_input_mask & audio_input.first) {
+ audio_inputs.emplace(audio_input.first, audio_input.second);
+ }
+ }
+
+ attr->Release();
+
+ /* Set up the video and audio sources. */
+ if (card->QueryInterface(IID_IDeckLinkConfiguration, (void**)&config) != S_OK) {
+ fprintf(stderr, "Failed to get configuration interface for card %d\n", card_index);