From d891cab2ca7f15cfbabf3f05bcd1a4bc4eac8f81 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Fri, 1 Apr 2022 09:43:06 +0200 Subject: [PATCH] DeckLink cap.: use bmdNoVideoInputConversion for check Although the conversion shouldn't be set (see #215), still a valid value ('none' here) must be used for the check. Fixes #221 --- src/video_capture/decklink.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/video_capture/decklink.cpp b/src/video_capture/decklink.cpp index 8ee9a94f9..7789a3491 100644 --- a/src/video_capture/decklink.cpp +++ b/src/video_capture/decklink.cpp @@ -1200,7 +1200,7 @@ vidcap_decklink_init(struct vidcap_params *params, void **state) if (s->conversion_mode) { CALL_AND_CHECK(deckLinkConfiguration->SetInt(bmdDeckLinkConfigVideoInputConversionMode, s->conversion_mode), "Unable to set conversion mode"); } - + BMDVideoInputConversionMode supported_conversion_mode = s->conversion_mode ? s->conversion_mode : (BMDVideoInputConversionMode) bmdNoVideoInputConversion; if (s->passthrough) { EXIT_IF_FAILED(deckLinkConfiguration->SetInt(bmdDeckLinkConfigCapturePassThroughMode, s->passthrough), "Unable to set passthrough mode"); } @@ -1269,7 +1269,7 @@ vidcap_decklink_init(struct vidcap_params *params, void **state) } BMDPixelFormat pf = it->second; BMD_BOOL supported = 0; - EXIT_IF_FAILED(deckLinkInput->DoesSupportVideoMode(s->connection, displayMode->GetDisplayMode(), pf, s->conversion_mode, s->supported_flags, nullptr, &supported), "DoesSupportVideoMode"); + EXIT_IF_FAILED(deckLinkInput->DoesSupportVideoMode(s->connection, displayMode->GetDisplayMode(), pf, supported_conversion_mode, s->supported_flags, nullptr, &supported), "DoesSupportVideoMode"); if (supported) { break; } @@ -1331,7 +1331,7 @@ vidcap_decklink_init(struct vidcap_params *params, void **state) } BMD_BOOL supported = 0; - EXIT_IF_FAILED(deckLinkInput->DoesSupportVideoMode(s->connection, displayMode->GetDisplayMode(), pf, s->conversion_mode, s->supported_flags, nullptr, &supported), "DoesSupportVideoMode"); + EXIT_IF_FAILED(deckLinkInput->DoesSupportVideoMode(s->connection, displayMode->GetDisplayMode(), pf, supported_conversion_mode, s->supported_flags, nullptr, &supported), "DoesSupportVideoMode"); if (!supported) { LOG(LOG_LEVEL_ERROR) << MOD_NAME "Requested display mode not supported with the selected pixel format\n";