From 618affd6127212bd07977b912d545b118eccc10a Mon Sep 17 00:00:00 2001 From: Julian Waller Date: Sat, 4 Jan 2025 17:19:27 +0000 Subject: [PATCH] fix: decklink output with driver 14.3 broken due to missing QueryInterface implementation on IDecklinkVideoFrame --- .../decklink/consumer/decklink_consumer.cpp | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/src/modules/decklink/consumer/decklink_consumer.cpp b/src/modules/decklink/consumer/decklink_consumer.cpp index fef9e5c40a..1226f83dbf 100644 --- a/src/modules/decklink/consumer/decklink_consumer.cpp +++ b/src/modules/decklink/consumer/decklink_consumer.cpp @@ -253,20 +253,10 @@ class decklink_frame HRESULT STDMETHODCALLTYPE QueryInterface(REFIID iid, LPVOID* ppv) override { - /* Implementation from the SignalGenHDR example in the Decklink SDK */ - -#ifdef _WIN32 - IID iunknown = IID_IUnknown; -#else - REFIID iunknown = IID_IUnknown; -#endif - HRESULT result = E_NOINTERFACE; - if (ppv == nullptr) return E_INVALIDARG; - //// Initialise the return result - *ppv = nullptr; + REFIID iunknown = IID_IUnknown; if (std::memcmp(&iid, &iunknown, sizeof(REFIID)) == 0) { *ppv = this; @@ -277,9 +267,12 @@ class decklink_frame } else if (hdr_ && std::memcmp(&iid, &IID_IDeckLinkVideoFrameMetadataExtensions, sizeof(REFIID)) == 0) { *ppv = static_cast(this); AddRef(); + } else { + *ppv = nullptr; + return E_NOINTERFACE; } - return result; + return S_OK; } ULONG STDMETHODCALLTYPE AddRef() override { return ++ref_count_; }