]> git.sesse.net Git - casparcg/commitdiff
[channel_producer] #590 Added NO_AUTO_DEINTERLACE parameter to channel route AMCP...
authorHelge Norberg <helge.norberg@svt.se>
Fri, 7 Apr 2017 14:45:30 +0000 (16:45 +0200)
committerHelge Norberg <helge.norberg@svt.se>
Fri, 7 Apr 2017 14:45:30 +0000 (16:45 +0200)
modules/reroute/producer/channel_producer.cpp
modules/reroute/producer/channel_producer.h
modules/reroute/producer/reroute_producer.cpp
protocol/amcp/AMCPCommandsImpl.cpp

index 2d02397e7475ff25d5bd283899417fce20706825..fd86d12bb7e8b6c6c3efa5b6e78cf47750c738a6 100644 (file)
@@ -244,7 +244,11 @@ class channel_producer : public core::frame_producer_base
        std::queue<core::draw_frame>                            frame_buffer_;
 
 public:
-       explicit channel_producer(const core::frame_producer_dependencies& dependecies, const spl::shared_ptr<core::video_channel>& channel, int frames_delay)
+       explicit channel_producer(
+                       const core::frame_producer_dependencies& dependecies,
+                       const spl::shared_ptr<core::video_channel>& channel,
+                       int frames_delay,
+                       bool no_auto_deinterlace)
                : frame_factory_(dependecies.frame_factory)
                , output_format_desc_(dependecies.format_desc)
                , consumer_(spl::make_shared<channel_consumer>(frames_delay))
@@ -252,11 +256,11 @@ public:
                                channel->video_format_desc().framerate,
                                { ffmpeg::create_input_pad(channel->video_format_desc(), channel->audio_channel_layout().num_channels) },
                                dependecies.frame_factory,
-                               get_progressive_format(channel->video_format_desc()),
+                               no_auto_deinterlace ? channel->video_format_desc() : get_progressive_format(channel->video_format_desc()),
                                channel->audio_channel_layout(),
                                L"",
                                false,
-                               true)
+                               !no_auto_deinterlace)
        {
                pixel_constraints_.width.set(output_format_desc_.width);
                pixel_constraints_.height.set(output_format_desc_.height);
@@ -346,9 +350,10 @@ public:
 spl::shared_ptr<core::frame_producer> create_channel_producer(
                const core::frame_producer_dependencies& dependencies,
                const spl::shared_ptr<core::video_channel>& channel,
-               int frames_delay)
+               int frames_delay,
+               bool no_auto_deinterlace)
 {
-       auto producer = spl::make_shared<channel_producer>(dependencies, channel, frames_delay);
+       auto producer = spl::make_shared<channel_producer>(dependencies, channel, frames_delay, no_auto_deinterlace);
 
        return core::create_framerate_producer(
                        producer,
index c4ddfc4d0739bc1c79117c869c132934bddb30a1..d43250fb9026a46afbf69e99a559a65ec7ce687e 100644 (file)
@@ -30,6 +30,7 @@ namespace caspar { namespace reroute {
 spl::shared_ptr<core::frame_producer> create_channel_producer(
                const core::frame_producer_dependencies& dependencies,
                const spl::shared_ptr<core::video_channel>& channel,
-               int frames_delay);
+               int frames_delay,
+               bool no_auto_deinterlace);
 
 }}
index cd281afe33b11a5fe4d6d2114cfac8c07881f68d..d334a4365e0494e1132503b7c7f9fd53fa25b7ab 100644 (file)
@@ -40,7 +40,7 @@ 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]} {FRAMES_DELAY [frames_delay:int]}");
+       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. ")
@@ -48,9 +48,13 @@ void describe_producer(core::help_sink& sink, const core::help_repository& repos
        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"
@@ -94,7 +98,8 @@ spl::shared_ptr<core::frame_producer> create_producer(
        auto params2 = params;
        params2.erase(params2.begin());
 
-       auto frames_delay = get_param(L"FRAMES_DELAY", params2, 0);
+       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)
        {
@@ -104,7 +109,7 @@ spl::shared_ptr<core::frame_producer> create_producer(
        }
        else
        {
-               return create_channel_producer(dependencies, *found_channel, frames_delay);
+               return create_channel_producer(dependencies, *found_channel, frames_delay, no_auto_deinterlace);
        }
 }
 
index 6b7a80abb8425f7d92acbbcbccddde4539f2a27f..69826476d6e7c443c2ede347314a0bd5c3c0589f 100644 (file)
@@ -2145,7 +2145,7 @@ std::wstring channel_grid_command(command_context& ctx)
                if (channel.channel != self.channel)
                {
                        core::diagnostics::call_context::for_thread().layer = index;
-                       auto producer = ctx.producer_registry->create_producer(get_producer_dependencies(self.channel, ctx), L"route://" + boost::lexical_cast<std::wstring>(channel.channel->index()));
+                       auto producer = ctx.producer_registry->create_producer(get_producer_dependencies(self.channel, ctx), L"route://" + boost::lexical_cast<std::wstring>(channel.channel->index()) + L" NO_AUTO_DEINTERLACE");
                        self.channel->stage().load(index, producer, false);
                        self.channel->stage().play(index);
                        index++;