From b4f766fb9d8f479ff8aadb4086a94a6b9e7c9758 Mon Sep 17 00:00:00 2001 From: Johanness Date: Sat, 30 May 2026 23:15:00 +0300 Subject: [PATCH] add HRESULT logging to CreateVideoFrame for debug --- nodes/decklink-out/src/decklink_out_node.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/nodes/decklink-out/src/decklink_out_node.cpp b/nodes/decklink-out/src/decklink_out_node.cpp index d836a9b..d358ad9 100644 --- a/nodes/decklink-out/src/decklink_out_node.cpp +++ b/nodes/decklink-out/src/decklink_out_node.cpp @@ -187,14 +187,19 @@ void DeckLinkOutNode::schedule_frame(void* mxl_payload, long width, long height, if (!output_) return; int32_t out_row_bytes = 0; - if (output_->RowBytesForPixelFormat(bmdFormat10BitYUV, width, &out_row_bytes) != S_OK || out_row_bytes <= 0) { + HRESULT row_hr = output_->RowBytesForPixelFormat(bmdFormat10BitYUV, width, &out_row_bytes); + if (row_hr != S_OK || out_row_bytes <= 0) { + spdlog::warn("DeckLink-out: RowBytesForPixelFormat failed hr=0x{:08x}, using fallback", static_cast(row_hr)); out_row_bytes = ((width + 5) / 6) * 16; } + spdlog::debug("DeckLink-out: creating frame {}x{} row_bytes={}", width, height, out_row_bytes); IDeckLinkMutableVideoFrame* frame = nullptr; - if (output_->CreateVideoFrame(width, height, out_row_bytes, bmdFormat10BitYUV, - bmdFrameFlagDefault, &frame) != S_OK) { - spdlog::warn("DeckLink-out: failed to create output frame {}x{}", width, height); + HRESULT hr = output_->CreateVideoFrame(width, height, out_row_bytes, bmdFormat10BitYUV, + bmdFrameFlagDefault, &frame); + if (hr != S_OK || !frame) { + spdlog::warn("DeckLink-out: failed to create output frame {}x{} row_bytes={} hr=0x{:08x}", + width, height, out_row_bytes, static_cast(hr)); return; }