From cac114d6e5cf20332783aa05ef71061cd22afe70 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Thu, 28 Nov 2024 10:32:51 +0100 Subject: [PATCH] vdisp,vcap/decklink: do not fail if insuff drv ver The motivation is to allow (although not recommend) running even with old drivers - it will usually work and just the DeckLink IP features won't be available (and warnings about that). + print it again at the beginning (== print also when :help requested) + change the message not_inst-or-outdated jus to outdated because in that place it is obvious that the drivers are present --- src/blackmagic_common.cpp | 2 +- src/video_capture/decklink.cpp | 7 ++----- src/video_display/decklink.cpp | 7 ++----- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/src/blackmagic_common.cpp b/src/blackmagic_common.cpp index 94fe646ec..06d25a416 100644 --- a/src/blackmagic_common.cpp +++ b/src/blackmagic_common.cpp @@ -238,7 +238,7 @@ bool blackmagic_api_version_check() } if (BLACKMAGIC_DECKLINK_API_VERSION > value) { // this is safe comparision, for internal structure please see SDK documentation - log_msg(LOG_LEVEL_ERROR, "The DeckLink drivers may not be installed or are outdated.\n"); + log_msg(LOG_LEVEL_ERROR, "The DeckLink drivers are be outdated.\n"); log_msg(LOG_LEVEL_ERROR, "You should have at least the version UltraGrid has been linked with.\n"); log_msg(LOG_LEVEL_ERROR, "Vendor download page is http://www.blackmagic-design.com/support\n"); print_decklink_version(); diff --git a/src/video_capture/decklink.cpp b/src/video_capture/decklink.cpp index c396b1b6a..b01487500 100644 --- a/src/video_capture/decklink.cpp +++ b/src/video_capture/decklink.cpp @@ -1426,6 +1426,8 @@ vidcap_decklink_init(struct vidcap_params *params, void **state) { const char *fmt = vidcap_params_get_fmt(params); + blackmagic_api_version_check(); + if (strcmp(fmt, "help") == 0 || strcmp(fmt, "fullhelp") == 0) { decklink_help(strcmp(fmt, "fullhelp") == 0); return VIDCAP_INIT_NOERR; @@ -1459,11 +1461,6 @@ vidcap_decklink_init(struct vidcap_params *params, void **state) return VIDCAP_INIT_FAIL; } - if (!blackmagic_api_version_check()) { - delete s; - return VIDCAP_INIT_FAIL; - } - switch (get_bits_per_component(s->codec)) { case 0: s->requested_bit_depth = 0; break; case 8: s->requested_bit_depth = bmdDetectedVideoInput8BitDepth; break; diff --git a/src/video_display/decklink.cpp b/src/video_display/decklink.cpp index a32691ffa..62532bb59 100644 --- a/src/video_display/decklink.cpp +++ b/src/video_display/decklink.cpp @@ -1416,6 +1416,8 @@ static void *display_decklink_init(struct module *parent, const char *fmt, unsig IDeckLinkConfiguration* deckLinkConfiguration = NULL; // for Decklink Studio which has switchable XLR - analog 3 and 4 or AES/EBU 3,4 and 5,6 + blackmagic_api_version_check(); + if (strcmp(fmt, "help") == 0 || strcmp(fmt, "fullhelp") == 0) { show_help(strcmp(fmt, "fullhelp") == 0); return INIT_NOERR; @@ -1444,11 +1446,6 @@ static void *display_decklink_init(struct module *parent, const char *fmt, unsig return NULL; } - if (!blackmagic_api_version_check()) { - delete s; - return NULL; - } - // Connect to the first DeckLink instance for (auto &d : bmd_get_sorted_devices(&s->com_initialized, true)) { s->deckLink = get<0>(d).release(); // unmanage