]> git.sesse.net Git - casparcg/blobdiff - protocol/clk/clk_commands.cpp
[logging] Made the Linux ThreadId be the actual thread id in the log.
[casparcg] / protocol / clk / clk_commands.cpp
index 039a051ef13b7afb620000d8edb305feac4f81f7..5832f9feab49e1a70e567d2f6cc8b667daab95a9 100644 (file)
@@ -40,15 +40,21 @@ namespace caspar { namespace protocol { namespace CLK {
 \r
 class command_context\r
 {\r
-       bool                                                                            clock_loaded_ = false;\r
-       spl::shared_ptr<core::video_channel>            channel_;\r
-       spl::shared_ptr<core::cg_producer_registry>     cg_registry_;\r
+       bool                                                                                                    clock_loaded_ = false;\r
+       std::vector<spl::shared_ptr<core::video_channel>>               channels_;\r
+       spl::shared_ptr<core::video_channel>                                    channel_;\r
+       spl::shared_ptr<core::cg_producer_registry>                             cg_registry_;\r
+       spl::shared_ptr<const core::frame_producer_registry>    producer_registry_;\r
 public:\r
        command_context(\r
+                       const std::vector<spl::shared_ptr<core::video_channel>>& channels,\r
                        const spl::shared_ptr<core::video_channel>& channel,\r
-                       const spl::shared_ptr<core::cg_producer_registry>& cg_registry)\r
-               : channel_(channel)\r
+                       const spl::shared_ptr<core::cg_producer_registry>& cg_registry,\r
+                       const spl::shared_ptr<const core::frame_producer_registry>& producer_registry)\r
+               : channels_(channels)\r
+               , channel_(channel)\r
                , cg_registry_(cg_registry)\r
+               , producer_registry_(producer_registry)\r
        {\r
        }\r
 \r
@@ -56,8 +62,9 @@ public:
        {\r
                if (!clock_loaded_) \r
                {\r
-                       cg_registry_->get_or_create_proxy(channel_, core::cg_proxy::DEFAULT_LAYER, L"hawrysklocka/clock")->add(\r
-                               0, L"hawrysklocka/clock", true, L"", data);\r
+                       core::frame_producer_dependencies dependencies(channel_->frame_factory(), channels_, channel_->video_format_desc(), producer_registry_);\r
+                       cg_registry_->get_or_create_proxy(channel_, dependencies, core::cg_proxy::DEFAULT_LAYER, L"hawrysklocka/clock")->add(\r
+                                       0, L"hawrysklocka/clock", true, L"", data);\r
                        clock_loaded_ = true;\r
                }\r
                else\r
@@ -65,7 +72,7 @@ public:
                        cg_registry_->get_proxy(channel_, core::cg_proxy::DEFAULT_LAYER)->update(0, data);\r
                }\r
                                \r
-               CASPAR_LOG(debug) << L"CLK: Clockdata sent: " << data;\r
+               CASPAR_LOG(info) << L"CLK: Clockdata sent: " << data;\r
        }\r
 \r
        void reset()\r
@@ -153,11 +160,13 @@ clk_command_handler create_send_xml_handler(
 }\r
 \r
 void add_command_handlers(\r
-       clk_command_processor& processor, \r
+       clk_command_processor& processor,\r
+       const std::vector<spl::shared_ptr<core::video_channel>>& channels,\r
        const spl::shared_ptr<core::video_channel>& channel,\r
-       const spl::shared_ptr<core::cg_producer_registry>& cg_registry)\r
+       const spl::shared_ptr<core::cg_producer_registry>& cg_registry,\r
+       const spl::shared_ptr<const core::frame_producer_registry>& producer_registry)\r
 {\r
-       auto context = spl::make_shared<command_context>(channel, cg_registry);\r
+       auto context = spl::make_shared<command_context>(channels, channel, cg_registry, producer_registry);\r
 \r
        processor\r
                .add_handler(L"DUR", \r