]> git.sesse.net Git - casparcg/blobdiff - modules/reroute/producer/reroute_producer.cpp
[channel_producer] #590 Added NO_AUTO_DEINTERLACE parameter to channel route AMCP...
[casparcg] / modules / reroute / producer / reroute_producer.cpp
index 54614d428acdd437fe90080dd590be6a37c385a5..d334a4365e0494e1132503b7c7f9fd53fa25b7ab 100644 (file)
@@ -25,6 +25,8 @@
 #include "layer_producer.h"
 #include "channel_producer.h"
 
+#include <common/param.h>
+
 #include <core/producer/frame_producer.h>
 #include <core/video_channel.h>
 #include <core/help/help_sink.h>
@@ -38,19 +40,29 @@ namespace caspar { namespace reroute {
 void describe_producer(core::help_sink& sink, const core::help_repository& repository)
 {
        sink.short_description(L"Reroutes a complete channel or a layer to another layer.");
-       sink.syntax(L"route://[source_channel:int]{-[source_layer:int]}");
-       sink.para()->text(L"Reroutes the composited video of a channel or the untransformed video of a layer .");
+       sink.syntax(L"route://[source_channel:int]{-[source_layer:int]} {FRAMES_DELAY [frames_delay:int]} {[no_auto_deinterlace:NO_AUTO_DEINTERLACE]}");
+       sink.para()->text(L"Reroutes the composited video of a channel or the untransformed video of a layer.");
        sink.para()
                ->text(L"If ")->code(L"source_layer")->text(L" is specified, only the video of the source layer is rerouted. ")
                ->text(L"If on the other hand only ")->code(L"source_channel")->text(L" is specified, the video of the complete channel is rerouted.");
+       sink.para()
+               ->text(L"An optional additional delay can be specified with the ")->code(L"frames_delay")
+               ->text(L" parameter.");
+       sink.para()
+               ->text(L"For channel routing an optional ")->code(L"no_auto_deinterlace")
+               ->text(L" parameter can be specified, when performance is more important than good quality output.");
        sink.para()->text(L"Examples:");
        sink.example(L">> PLAY 1-10 route://1-11", L"Play the contents of layer 1-11 on layer 1-10 as well.");
        sink.example(L">> PLAY 1-10 route://2", L"Play the composited contents of channel 2 on layer 1-10 as well.");
+       sink.example(L">> PLAY 1-10 route://2 NO_AUTO_DEINTERLACE");
        sink.example(
                L">> MIXER 1-10 FILL 0.02 0.01 0.9 0.9\n"
                L">> PLAY 1-10 route://1\n"
                L">> PLAY 1-9 AMB LOOP", L"Play the composited contents of channel 1 on layer 1-10. Since the source and destination channel is the same, an \"infinity\" effect is created.");
-       sink.para()->text(L"Always expect a few frames delay on the routed-to layer.");
+       sink.example(L">> PLAY 1-10 route://1-11 FRAMES_DELAY 10", L"Play the contents of layer 1-11 on layer 1-10 as well with an added 10 frames delay.");
+       sink.para()
+               ->text(L"Always expect a few frames delay on the routed-to layer in addition to the optionally specified ")
+               ->code(L"frames_delay")->text(L" parameter.");
 }
 
 spl::shared_ptr<core::frame_producer> create_producer(
@@ -83,16 +95,22 @@ spl::shared_ptr<core::frame_producer> create_producer(
        if (found_channel == dependencies.channels.end())
                CASPAR_THROW_EXCEPTION(user_error() << msg_info(L"No channel with id " + boost::lexical_cast<std::wstring>(channel_id)));
 
+       auto params2 = params;
+       params2.erase(params2.begin());
+
+       auto frames_delay                       = get_param(L"FRAMES_DELAY", params2, 0);
+       bool no_auto_deinterlace        = contains_param(L"NO_AUTO_DEINTERLACE", params2);
+
        if (has_layer_spec)
        {
                auto layer = boost::lexical_cast<int>(channel_layer_spec.substr(dash + 1));
 
-               return create_layer_producer(*found_channel, layer);
+               return create_layer_producer(*found_channel, layer, frames_delay, dependencies.format_desc);
        }
        else
        {
-               return create_channel_producer(dependencies, *found_channel);
+               return create_channel_producer(dependencies, *found_channel, frames_delay, no_auto_deinterlace);
        }
 }
 
-}}
\ No newline at end of file
+}}