diff --git a/configure b/configure index a7b0c18d9c..883539e361 100755 --- a/configure +++ b/configure @@ -7405,8 +7405,8 @@ fi if enabled decklink; then case $target_os in mingw32*|mingw64*|win32|win64) - decklink_outdev_extralibs="$decklink_outdev_extralibs -lole32 -loleaut32" - decklink_indev_extralibs="$decklink_indev_extralibs -lole32 -loleaut32" + decklink_outdev_extralibs="$decklink_outdev_extralibs -lole32 -luuid -loleaut32" + decklink_indev_extralibs="$decklink_indev_extralibs -lole32 -luuid -loleaut32" ;; esac fi diff --git a/libavdevice/decklink_enc.cpp b/libavdevice/decklink_enc.cpp index cb8f91730e..195f005c17 100644 --- a/libavdevice/decklink_enc.cpp +++ b/libavdevice/decklink_enc.cpp @@ -47,6 +47,16 @@ extern "C" { #include "libklvanc/pixels.h" #endif +#ifdef _WIN32 +#include +#else +/* There is no guiddef.h in Linux builds, so we provide our own IsEqualIID() */ +static bool IsEqualIID(REFIID riid1, REFIID riid2) +{ + return memcmp(&riid1, &riid2, sizeof(REFIID)) == 0; +} +#endif + /* DeckLink callback class declaration */ class decklink_frame : public IDeckLinkVideoFrame { @@ -111,7 +121,21 @@ public: _ancillary->AddRef(); return S_OK; } - virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID iid, LPVOID *ppv) { return E_NOINTERFACE; } + virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, LPVOID *ppv) + { + if (IsEqualIID(riid, IID_IUnknown)) { + *ppv = static_cast(this); + } else if (IsEqualIID(riid, IID_IDeckLinkVideoFrame)) { + *ppv = static_cast(this); + } else { + *ppv = NULL; + return E_NOINTERFACE; + } + + AddRef(); + return S_OK; + } + virtual ULONG STDMETHODCALLTYPE AddRef(void) { return ++_refs; } virtual ULONG STDMETHODCALLTYPE Release(void) {