summaryrefslogtreecommitdiff
path: root/libavdevice/decklink_common.cpp
diff options
context:
space:
mode:
authorMarton Balint <cus@passwd.hu>2020-10-08 21:31:24 +0200
committerMarton Balint <cus@passwd.hu>2020-12-03 18:32:57 +0100
commita6f6726a815922f14723440029a96bdc93ea15a1 (patch)
treebd7e8df2c1dfc0c5124ef3372d7126ef3d2c8efd /libavdevice/decklink_common.cpp
parentacaf6c625bb1961565d43284e922a038b38f735d (diff)
downloadffmpeg-a6f6726a815922f14723440029a96bdc93ea15a1.tar.gz
avdevice/decklink: warn about too old decklink API version
Signed-off-by: Marton Balint <cus@passwd.hu>
Diffstat (limited to 'libavdevice/decklink_common.cpp')
-rw-r--r--libavdevice/decklink_common.cpp23
1 files changed, 22 insertions, 1 deletions
diff --git a/libavdevice/decklink_common.cpp b/libavdevice/decklink_common.cpp
index 8b58ede1ef..24aa9b1d13 100644
--- a/libavdevice/decklink_common.cpp
+++ b/libavdevice/decklink_common.cpp
@@ -70,9 +70,30 @@ static IDeckLinkIterator *decklink_create_iterator(AVFormatContext *avctx)
#else
iter = CreateDeckLinkIteratorInstance();
#endif
- if (!iter)
+ if (!iter) {
av_log(avctx, AV_LOG_ERROR, "Could not create DeckLink iterator. "
"Make sure you have DeckLink drivers " BLACKMAGIC_DECKLINK_API_VERSION_STRING " or newer installed.\n");
+ } else {
+ IDeckLinkAPIInformation *api;
+ int64_t version;
+#ifdef _WIN32
+ if (CoCreateInstance(CLSID_CDeckLinkAPIInformation, NULL, CLSCTX_ALL,
+ IID_IDeckLinkAPIInformation, (void**) &api) != S_OK) {
+ api = NULL;
+ }
+#else
+ api = CreateDeckLinkAPIInformationInstance();
+#endif
+ if (api && api->GetInt(BMDDeckLinkAPIVersion, &version) == S_OK) {
+ if (version < BLACKMAGIC_DECKLINK_API_VERSION)
+ av_log(avctx, AV_LOG_WARNING, "Installed DeckLink drivers are too old and may be incompatible with the SDK this module was built against. "
+ "Make sure you have DeckLink drivers " BLACKMAGIC_DECKLINK_API_VERSION_STRING " or newer installed.\n");
+ } else {
+ av_log(avctx, AV_LOG_ERROR, "Failed to check installed DeckLink API version.\n");
+ }
+ if (api)
+ api->Release();
+ }
return iter;
}