+void DeckLinkCapture::set_video_mode(uint32_t video_mode_id)
+{
+ BMDDisplayModeSupport support;
+ IDeckLinkDisplayMode *display_mode;
+ if (input->DoesSupportVideoMode(video_mode_id, bmdFormat8BitYUV, /*flags=*/0, &support, &display_mode)) {
+ fprintf(stderr, "Failed to query display mode for card %d\n", card_index);
+ exit(1);
+ }
+
+ if (support == bmdDisplayModeNotSupported) {
+ fprintf(stderr, "Card %d does not support display mode\n", card_index);
+ exit(1);
+ }
+
+ if (display_mode->GetFrameRate(&frame_duration, &time_scale) != S_OK) {
+ fprintf(stderr, "Could not get frame rate for card %d\n", card_index);
+ exit(1);
+ }
+
+ if (input->EnableVideoInput(video_mode_id, bmdFormat8BitYUV, 0) != S_OK) {
+ fprintf(stderr, "Failed to set 720p59.94 connection for card %d\n", card_index);
+ exit(1);
+ }
+
+ current_video_mode = video_mode_id;
+}