// HDMI or SDI generally mean “both HDMI and SDI at the same time” on DeckLink cards
// that support both; pick_default_video_connection() will generally pick one of those
- // if they exist. We're not very likely to need analog outputs, so we don't need a way
- // to change beyond that.
+ // if they exist. (--prefer-hdmi-input would also affect the selection despite the name
+ // of the option, but since either generally means both, it's inconsequential.)
+ // We're not very likely to need analog outputs, so we don't need a way to change
+ // beyond that.
video_connection = pick_default_video_connection(decklink, BMDDeckLinkVideoOutputConnections, card_index);
return true;
}
#include <assert.h>
#include "decklink_util.h"
+#include "flags.h"
using namespace bmusb;
using namespace std;
if (attribute_id == BMDDeckLinkVideoInputConnections) {
fprintf(stderr, "Card %u has no input connections\n", card_index);
} else {
- fprintf(stderr, "Card %u has no outpu connectionss\n", card_index);
+ fprintf(stderr, "Card %u has no output connections\n", card_index);
}
exit(1);
}
- if (connection_mask & bmdVideoConnectionHDMI) {
+ if ((connection_mask & bmdVideoConnectionHDMI) &&
+ global_flags.default_hdmi_input) {
return bmdVideoConnectionHDMI;
} else if (connection_mask & bmdVideoConnectionSDI) {
return bmdVideoConnectionSDI;
+ } else if (connection_mask & bmdVideoConnectionHDMI) {
+ return bmdVideoConnectionHDMI;
} else {
// Fallback: Return lowest-set bit, whatever that might be.
return connection_mask & (-connection_mask);
OPTION_HELP = 1000,
OPTION_MULTICHANNEL,
OPTION_MIDI_MAPPING,
+ OPTION_DEFAULT_HDMI_INPUT,
OPTION_FAKE_CARDS_AUDIO,
OPTION_HTTP_UNCOMPRESSED_VIDEO,
OPTION_HTTP_X264_VIDEO,
fprintf(stderr, " -M, --input-mapping=FILE start with the given audio input mapping (implies --multichannel)\n");
fprintf(stderr, " --multichannel start in multichannel audio mapping mode\n");
fprintf(stderr, " --midi-mapping=FILE start with the given MIDI controller mapping (implies --multichannel)\n");
+ fprintf(stderr, " --default-hdmi-input default to HDMI over SDI inputs for cards that have both\n");
fprintf(stderr, " --fake-cards-audio make fake (disconnected) cards output a simple tone\n");
fprintf(stderr, " --http-uncompressed-video send uncompressed NV12 video to HTTP clients\n");
fprintf(stderr, " --http-x264-video send x264-compressed video to HTTP clients\n");
{ "va-display", required_argument, 0, 'v' },
{ "multichannel", no_argument, 0, OPTION_MULTICHANNEL },
{ "midi-mapping", required_argument, 0, OPTION_MIDI_MAPPING },
+ { "default-hdmi-input", no_argument, 0, OPTION_DEFAULT_HDMI_INPUT },
{ "fake-cards-audio", no_argument, 0, OPTION_FAKE_CARDS_AUDIO },
{ "http-uncompressed-video", no_argument, 0, OPTION_HTTP_UNCOMPRESSED_VIDEO },
{ "http-x264-video", no_argument, 0, OPTION_HTTP_X264_VIDEO },
global_flags.midi_mapping_filename = optarg;
global_flags.multichannel_mapping_mode = true;
break;
+ case OPTION_DEFAULT_HDMI_INPUT:
+ global_flags.default_hdmi_input = true;
+ break;
case OPTION_FAKE_CARDS_AUDIO:
global_flags.fake_cards_audio = true;
break;
bool multichannel_mapping_mode = false; // Implicitly true if input_mapping_filename is nonempty.
std::string input_mapping_filename; // Empty for none.
std::string midi_mapping_filename; // Empty for none.
+ bool default_hdmi_input = false;
bool print_video_latency = false;
double audio_queue_length_ms = 100.0;
bool ycbcr_rec709_coefficients = false; // Will be overridden by HDMI/SDI output if ycbcr_auto_coefficients == true.