diff --git a/src/modules/decklink/consumer/decklink_consumer.cpp b/src/modules/decklink/consumer/decklink_consumer.cpp index a16de94557..4ef9696a29 100644 --- a/src/modules/decklink/consumer/decklink_consumer.cpp +++ b/src/modules/decklink/consumer/decklink_consumer.cpp @@ -208,7 +208,26 @@ class decklink_frame : public IDeckLinkVideoFrame // IUnknown - HRESULT STDMETHODCALLTYPE QueryInterface(REFIID, LPVOID*) override { return E_NOINTERFACE; } + HRESULT STDMETHODCALLTYPE QueryInterface(REFIID iid, LPVOID* ppv) override { + CFUUIDBytes iunknown = CFUUIDGetUUIDBytes(IUnknownUUID); + if (memcmp(&iid, &iunknown, sizeof(REFIID)) == 0) + { + *ppv = this; + AddRef(); + } + else if (memcmp(&iid, &IID_IDeckLinkVideoFrame, sizeof(REFIID)) == 0) + { + *ppv = static_cast(this); + AddRef(); + } + else + { + *ppv = nullptr; + return E_NOINTERFACE; + } + + return S_OK; + } ULONG STDMETHODCALLTYPE AddRef() override { return ++ref_count_; } @@ -228,7 +247,7 @@ class decklink_frame : public IDeckLinkVideoFrame long STDMETHODCALLTYPE GetWidth() override { return static_cast(format_desc_.width); } long STDMETHODCALLTYPE GetHeight() override { return static_cast(format_desc_.height); } long STDMETHODCALLTYPE GetRowBytes() override { return static_cast(format_desc_.width) * 4; } - BMDPixelFormat STDMETHODCALLTYPE GetPixelFormat() override { return bmdFormat8BitBGRA; } + BMDPixelFormat STDMETHODCALLTYPE GetPixelFormat() override { return bmdFormat10BitYUV; } BMDFrameFlags STDMETHODCALLTYPE GetFlags() override { return bmdFrameFlagDefault; } HRESULT STDMETHODCALLTYPE GetBytes(void** buffer) override @@ -633,6 +652,8 @@ struct decklink_consumer final : public IDeckLinkVideoOutputCallback CASPAR_THROW_EXCEPTION(caspar_exception() << msg_info(print() + L" Failed to schedule primary playback.")); } + CASPAR_LOG(info) << "started playback"; + for (auto& context : secondary_port_contexts_) { context->start_playback([this]() { return print(); }); }