Skip to content

Commit

Permalink
vdisp,vcap/decklink: do not fail if insuff drv ver
Browse files Browse the repository at this point in the history
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
  • Loading branch information
MartinPulec committed Nov 28, 2024
1 parent 9e736df commit cac114d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/blackmagic_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
7 changes: 2 additions & 5 deletions src/video_capture/decklink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
7 changes: 2 additions & 5 deletions src/video_display/decklink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit cac114d

Please sign in to comment.