]> git.sesse.net Git - casparcg/blobdiff - core/video_channel.cpp
2.0.2: Improved INFO.
[casparcg] / core / video_channel.cpp
index 67eebfde816cfdef6da6b4031ec5cda55d7f0d9f..5cca96834c72d28d1f0a5cff01ec61728d9c73e6 100644 (file)
@@ -32,6 +32,8 @@
 #include <common/diagnostics/graph.h>\r
 #include <common/env.h>\r
 \r
+#include <boost/property_tree/ptree.hpp>\r
+\r
 #include <string>\r
 \r
 namespace caspar { namespace core {\r
@@ -86,6 +88,26 @@ public:
        {\r
                return L"video_channel[" + boost::lexical_cast<std::wstring>(index_) + L"|" +  format_desc_.name + L"]";\r
        }\r
+\r
+       boost::property_tree::wptree info() const\r
+       {\r
+               boost::property_tree::wptree info;\r
+               info.put(L"channel.video-mode", format_desc_.name);\r
+\r
+               auto& channel_node = info.get_child(L"channel");\r
+               auto stage_info  = stage_->info();\r
+               auto mixer_info  = mixer_->info();\r
+               auto output_info = output_->info();\r
+\r
+               BOOST_FOREACH(auto& update, stage_info.get())   \r
+                       channel_node.put_child(update.first, update.second);\r
+               BOOST_FOREACH(auto& update, mixer_info.get())   \r
+                       channel_node.put_child(update.first, update.second);\r
+               BOOST_FOREACH(auto& update, output_info.get())   \r
+                       channel_node.put_child(update.first, update.second);\r
+   \r
+               return info;                       \r
+       }\r
 };\r
 \r
 video_channel::video_channel(int index, const video_format_desc& format_desc, const safe_ptr<ogl_device>& ogl) : impl_(new implementation(index, format_desc, ogl)){}\r
@@ -94,5 +116,6 @@ safe_ptr<mixer> video_channel::mixer() { return impl_->mixer_;}
 safe_ptr<output> video_channel::output() { return impl_->output_;} \r
 video_format_desc video_channel::get_video_format_desc() const{return impl_->format_desc_;}\r
 void video_channel::set_video_format_desc(const video_format_desc& format_desc){impl_->set_video_format_desc(format_desc);}\r
+boost::property_tree::wptree video_channel::info() const{return impl_->info();}\r
 \r
 }}
\ No newline at end of file