Skip to content

Commit

Permalink
[FIXUP] decklink producer
Browse files Browse the repository at this point in the history
  • Loading branch information
niklaspandersson committed Apr 24, 2024
1 parent e8d8e88 commit 10f39d6
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/modules/decklink/producer/decklink_producer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -357,23 +357,21 @@ struct Decoder
}
};

core::color_space get_color_space(IDeckLinkVideoInputFrame* raw_video)
core::color_space get_color_space(IDeckLinkVideoInputFrame* video)
{
auto video = wrap_raw<com_ptr>(raw_video);
auto metadata = iface_cast<IDeckLinkVideoFrameMetadataExtensions>(video);
IDeckLinkVideoFrameMetadataExtensions* md = nullptr;

auto result = core::color_space::bt709;

if (metadata) {
if (SUCCEEDED(video->QueryInterface(IID_IDeckLinkVideoFrameMetadataExtensions, (void**)&md))) {
auto metadata = wrap_raw<com_ptr>(md, true);
LONGLONG color_space;
if (SUCCEEDED(metadata->GetInt(bmdDeckLinkFrameMetadataColorspace, &color_space))) {
if (SUCCEEDED(md->GetInt(bmdDeckLinkFrameMetadataColorspace, &color_space))) {
if (color_space == bmdColorspaceRec2020) {
return core::color_space::bt2020;
}
}
}

return result;
return core::color_space::bt709;
}

com_ptr<IDeckLinkDisplayMode> get_display_mode(const com_iface_ptr<IDeckLinkInput>& device,
Expand Down

0 comments on commit 10f39d6

Please sign in to comment.