]> git.sesse.net Git - casparcg/blobdiff - core/channel.cpp
git-svn-id: https://casparcg.svn.sourceforge.net/svnroot/casparcg/server/branches...
[casparcg] / core / channel.cpp
index 000052dea070815ecd712dd2984c208e1281ddad..37199e3d7b42f2b0ab85943701e6fb2afaa395fc 100644 (file)
@@ -2,27 +2,40 @@
 \r
 #include "channel.h"\r
 \r
-#include "producer/layer.h"\r
-\r
 #include "consumer/frame_consumer_device.h"\r
 \r
 #include "processor/draw_frame.h"\r
 #include "processor/frame_processor_device.h"\r
 \r
+#include "producer/layer.h"\r
+\r
 #include <common/concurrency/executor.h>\r
 \r
 #include <boost/range/algorithm_ext/erase.hpp>\r
 \r
 #include <tbb/parallel_for.h>\r
 \r
+#include <map>\r
 #include <memory>\r
 \r
 namespace caspar { namespace core {\r
 \r
 struct channel::implementation : boost::noncopyable\r
 {      \r
+       mutable executor executor_;\r
+                               \r
+       safe_ptr<frame_processor_device> processor_device_;\r
+       frame_consumer_device consumer_device_;\r
+                                               \r
+       std::map<int, layer> layers_;           \r
+\r
+       const video_format_desc format_desc_;\r
+\r
+public:\r
        implementation(const video_format_desc& format_desc, const std::vector<safe_ptr<frame_consumer>>& consumers)  \r
-               : format_desc_(format_desc), processor_device_(frame_processor_device(format_desc)), consumer_device_(format_desc, consumers)\r
+               : format_desc_(format_desc)\r
+               , processor_device_(frame_processor_device(format_desc))\r
+               , consumer_device_(format_desc, consumers)\r
        {\r
                executor_.start();\r
                executor_.begin_invoke([=]{tick();});\r
@@ -89,7 +102,7 @@ struct channel::implementation : boost::noncopyable
                {\r
                        auto it = layers_.find(index);\r
                        if(it != layers_.end())\r
-                               it->second.play();              \r
+                               it->second.play();\r
                });\r
        }\r
 \r
@@ -98,7 +111,7 @@ struct channel::implementation : boost::noncopyable
                executor_.begin_invoke([=]\r
                {\r
                        auto it = layers_.find(index);\r
-                       if(it != layers_.end())                 \r
+                       if(it != layers_.end())\r
                        {\r
                                it->second.stop();      \r
                                if(it->second.empty())\r
@@ -144,16 +157,7 @@ struct channel::implementation : boost::noncopyable
                        auto it = layers_.find(index);\r
                        return it != layers_.end() ? it->second.background() : frame_producer::empty();\r
                });\r
-       }\r
-\r
-       mutable executor executor_;\r
-                               \r
-       safe_ptr<frame_processor_device> processor_device_;\r
-       frame_consumer_device consumer_device_;\r
-                                               \r
-       std::map<int, layer> layers_;           \r
-\r
-       const video_format_desc format_desc_;\r
+       };\r
 };\r
 \r
 channel::channel(channel&& other) : impl_(std::move(other.impl_)){}\r