Skip to content

Commit 9a0594d

Browse files
committed
blackmagic_api_version_check more inteligent
return false only if using the incompatible ABI in other cases just issue a warning
1 parent ff2c259 commit 9a0594d

File tree

1 file changed

+26
-5
lines changed

1 file changed

+26
-5
lines changed

src/blackmagic_common.cpp

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@
7070
#include "utils/windows.h"
7171
#include "utils/worker.h"
7272

73+
// BMD sometimes do a ABI bump that entirely breaks compatibility (eg. changing
74+
// GUIDs), this can be inspected by checking the "versioned" DeckLinkAPI here:
75+
// <https://github.com/MartinPulec/desktopvideo_sdk-api/tree/main/Linux/include>
76+
#define BMD_LAST_INCOMPATIBLE_ABI 0x0b050100 // 11.5.1
77+
7378
#if BLACKMAGIC_DECKLINK_API_VERSION > 0x0c080000
7479
#warning \
7580
"Increased BMD API - enum diffs recheck recommends (or just increase the compared API version)"
@@ -238,14 +243,30 @@ bool blackmagic_api_version_check()
238243
goto cleanup;
239244
}
240245

241-
if (BLACKMAGIC_DECKLINK_API_VERSION > value) { // this is safe comparision, for internal structure please see SDK documentation
242-
log_msg(LOG_LEVEL_ERROR, "The DeckLink drivers are be outdated.\n");
243-
log_msg(LOG_LEVEL_ERROR, "You should have at least the version UltraGrid has been linked with.\n");
244-
log_msg(LOG_LEVEL_ERROR, "Vendor download page is http://www.blackmagic-design.com/support\n");
246+
// this is safe comparision, for internal structure please see SDK
247+
// documentation
248+
if (value <= BMD_LAST_INCOMPATIBLE_ABI) {
249+
MSG(ERROR, "The DeckLink drivers are be outdated.\n");
250+
MSG(ERROR, "You must have drivers newer than %d.%d.%d.\n",
251+
BMD_LAST_INCOMPATIBLE_ABI >> 24,
252+
(BMD_LAST_INCOMPATIBLE_ABI >> 16) & 0xFF,
253+
(BMD_LAST_INCOMPATIBLE_ABI >> 8) & 0xFF);
254+
MSG(ERROR, "Vendor download page is "
255+
"http://www.blackmagic-design.com/support\n");
245256
print_decklink_version();
246-
ret = false;
247257
} else {
248258
ret = true;
259+
if (BLACKMAGIC_DECKLINK_API_VERSION > value) {
260+
MSG(WARNING, "The DeckLink drivers are be outdated.\n");
261+
MSG(WARNING,
262+
"Although it will likely work, it is recommended "
263+
"to use drivers at least as the API that "
264+
"UltraGrid is linked with.\n");
265+
print_decklink_version();
266+
MSG(WARNING,
267+
"Vendor download page is "
268+
"http://www.blackmagic-design.com/support\n\n");
269+
}
249270
}
250271

251272
cleanup:

0 commit comments

Comments
 (0)