Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Julusian committed Aug 4, 2023
1 parent 6c14b57 commit 6ad47e1
Showing 1 changed file with 27 additions and 26 deletions.
53 changes: 27 additions & 26 deletions src/modules/decklink/consumer/monitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,34 @@

namespace caspar { namespace decklink {

core::monitor::state get_state_for_port(const port_configuration& port_config,
const core::video_format_desc& channel_format)
{
core::monitor::state state;

state["index"] = port_config.device_index;
state["key-only"] = port_config.key_only;

if (port_config.format.format == core::video_format::invalid) {
state["video-mode"] = channel_format.name;
} else {
state["video-mode"] = port_config.format.name;
}

if (port_config.has_subregion_geometry()) {
state["subregion/src-x"] = port_config.src_x;
state["subregion/src-y"] = port_config.src_y;
state["subregion/src-x"] = port_config.dest_x;
state["subregion/dest-y"] = port_config.dest_y;
state["subregion/width"] = port_config.region_w;
state["subregion/height"] = port_config.region_h;
}

return state;
}

core::monitor::state get_state_for_config(const configuration& config, const core::video_format_desc& channel_format){
core::monitor::state get_state_for_config(const configuration& config, const core::video_format_desc& channel_format)
{
core::monitor::state state;

state["decklink"] = get_state_for_port(config.primary, channel_format);
Expand All @@ -51,30 +77,5 @@ core::monitor::state get_state_for_config(const configuration& config, const cor

return state;
}
core::monitor::state get_state_for_port(const port_configuration& port_config, const core::video_format_desc& channel_format)
{
core::monitor::state state;

state["index"] = port_config.device_index;
state["key-only"] = port_config.key_only;

if (port_config.format.format == core::video_format::invalid) {
state["video-mode"] = channel_format.name;
} else {
state["video-mode"] = port_config.format.name;
}

if (port_config.has_subregion_geometry()) {
state["subregion/src-x"] = port_config.src_x;
state["subregion/src-y"] = port_config.src_y;
state["subregion/src-x"] = port_config.dest_x;
state["subregion/dest-y"] = port_config.dest_y;
state["subregion/width"] = port_config.region_w;
state["subregion/height"] = port_config.region_h;
}

return state;
}


}} // namespace caspar::decklink

0 comments on commit 6ad47e1

Please sign in to comment.