]> git.sesse.net Git - casparcg/commitdiff
[osc] Added possibility to completely disable sending OSC to connected AMCP clients...
authorHelge Norberg <helge.norberg@svt.se>
Thu, 6 Oct 2016 15:27:43 +0000 (17:27 +0200)
committerHelge Norberg <helge.norberg@svt.se>
Thu, 6 Oct 2016 15:27:43 +0000 (17:27 +0200)
shell/casparcg.config
shell/server.cpp

index 5c4b33db330df0db81adf45af5aad42c26e89e9d..d1358aab27819d36cfc4a2aab62b3982c9bc6847 100644 (file)
 </channels>\r
 <osc>\r
   <default-port>6250</default-port>\r
+  <disable-send-to-amcp-clients>false [true|false]</disable-send-to-amcp-clients>\r
   <predefined-clients>\r
     <predefined-client>\r
       <address>127.0.0.1</address>\r
index 2c2c5f3d36be07e467ff86a8f2b877acddcd7177..cee6709c766bb0b28f56df2cd818016ef2487137 100644 (file)
@@ -146,7 +146,7 @@ struct server::impl : boost::noncopyable
        std::shared_ptr<thumbnail_generator>                            thumbnail_generator_;
        std::promise<bool>&                                                                     shutdown_server_now_;
 
-       explicit impl(std::promise<bool>& shutdown_server_now)          
+       explicit impl(std::promise<bool>& shutdown_server_now)
                : accelerator_(env::properties().get(L"configuration.accelerator", L"auto"))
                , media_info_repo_(create_in_memory_media_info_repository())
                , producer_registry_(spl::make_shared<core::frame_producer_registry>(help_repo_))
@@ -212,7 +212,7 @@ struct server::impl : boost::noncopyable
                destroy_producers_synchronously();
                destroy_consumers_synchronously();
                channels_.clear();
-               
+
                while (weak_io_service.lock())
                        boost::this_thread::sleep_for(boost::chrono::milliseconds(100));
 
@@ -248,7 +248,7 @@ struct server::impl : boost::noncopyable
        }
 
        void setup_channels(const boost::property_tree::wptree& pt)
-       {   
+       {
                using boost::property_tree::wptree;
                for (auto& xml_channel : pt | witerate_children(L"configuration.channels") | welement_context_iteration)
                {
@@ -288,7 +288,7 @@ struct server::impl : boost::noncopyable
                                {
                                        CASPAR_LOG_CURRENT_EXCEPTION();
                                }
-                       }               
+                       }
 
                    channel->monitor_output().attach_parent(monitor_subject_);
                        channel->mixer().set_straight_alpha_output(xml_channel.second.get(L"straight-alpha-output", false));
@@ -309,14 +309,16 @@ struct server::impl : boost::noncopyable
        }
 
        void setup_osc(const boost::property_tree::wptree& pt)
-       {               
+       {
                using boost::property_tree::wptree;
                using namespace boost::asio::ip;
 
                monitor_subject_->attach_parent(osc_client_->sink());
-               
+
                auto default_port =
                                pt.get<unsigned short>(L"configuration.osc.default-port", 6250);
+               auto disable_send_to_amcp_clients =
+                               pt.get(L"configuration.osc.disable-send-to-amcp-clients", false);
                auto predefined_clients =
                                pt.get_child_optional(L"configuration.osc.predefined-clients");
 
@@ -337,7 +339,7 @@ struct server::impl : boost::noncopyable
                        }
                }
 
-               if (primary_amcp_server_)
+               if (!disable_send_to_amcp_clients && primary_amcp_server_)
                        primary_amcp_server_->add_client_lifecycle_object_factory(
                                        [=] (const std::string& ipv4_address)
                                                        -> std::pair<std::wstring, std::shared_ptr<void>>
@@ -363,7 +365,7 @@ struct server::impl : boost::noncopyable
 
                polling_filesystem_monitor_factory monitor_factory(io_service_, scan_interval_millis);
                thumbnail_generator_.reset(new thumbnail_generator(
-                       monitor_factory, 
+                       monitor_factory,
                        env::media_folder(),
                        env::thumbnails_folder(),
                        pt.get(L"configuration.thumbnails.width", 256),
@@ -376,7 +378,7 @@ struct server::impl : boost::noncopyable
                        producer_registry_,
                        pt.get(L"configuration.thumbnails.mipmap", true)));
        }
-               
+
        void setup_controllers(const boost::property_tree::wptree& pt)
        {
                amcp_command_repo_ = spl::make_shared<amcp::amcp_command_repository>(
@@ -399,7 +401,7 @@ struct server::impl : boost::noncopyable
                        auto protocol = ptree_get<std::wstring>(xml_controller.second, L"protocol");
 
                        if(name == L"tcp")
-                       {                                       
+                       {
                                auto port = ptree_get<unsigned int>(xml_controller.second, L"port");
                                auto asyncbootstrapper = spl::make_shared<IO::AsyncEventServer>(
                                                io_service_,
@@ -411,7 +413,7 @@ struct server::impl : boost::noncopyable
                                        primary_amcp_server_ = asyncbootstrapper;
                        }
                        else
-                               CASPAR_LOG(warning) << "Invalid controller: " << name;  
+                               CASPAR_LOG(warning) << "Invalid controller: " << name;
                }
        }