add HRESULT logging to CreateVideoFrame for debug

This commit is contained in:
Johanness
2026-05-30 23:15:00 +03:00
parent b5d9c7cd3f
commit b4f766fb9d
+9 -4
View File
@@ -187,14 +187,19 @@ void DeckLinkOutNode::schedule_frame(void* mxl_payload, long width, long height,
if (!output_) return; if (!output_) return;
int32_t out_row_bytes = 0; 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<uint32_t>(row_hr));
out_row_bytes = ((width + 5) / 6) * 16; out_row_bytes = ((width + 5) / 6) * 16;
} }
spdlog::debug("DeckLink-out: creating frame {}x{} row_bytes={}", width, height, out_row_bytes);
IDeckLinkMutableVideoFrame* frame = nullptr; IDeckLinkMutableVideoFrame* frame = nullptr;
if (output_->CreateVideoFrame(width, height, out_row_bytes, bmdFormat10BitYUV, HRESULT hr = output_->CreateVideoFrame(width, height, out_row_bytes, bmdFormat10BitYUV,
bmdFrameFlagDefault, &frame) != S_OK) { bmdFrameFlagDefault, &frame);
spdlog::warn("DeckLink-out: failed to create output frame {}x{}", width, height); 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<uint32_t>(hr));
return; return;
} }