]> git.sesse.net Git - casparcg/blobdiff - core/producer/stage.cpp
2.0.2: Improved INFO.
[casparcg] / core / producer / stage.cpp
index 3799b87a1f274c797f040e4408bf237544aed901..f2f38dd767eea58d39d604934f3a8b88c8ae4ff5 100644 (file)
@@ -34,6 +34,8 @@
 \r
 #include <tbb/parallel_for_each.h>\r
 \r
+#include <boost/property_tree/ptree.hpp>\r
+\r
 #include <map>\r
 \r
 namespace caspar { namespace core {\r
@@ -231,7 +233,24 @@ public:
                executor_.begin_invoke([=]\r
                {\r
                        format_desc_ = format_desc;\r
-               }, high_priority );\r
+               }, high_priority);\r
+       }\r
+\r
+       boost::unique_future<boost::property_tree::wptree> info()\r
+       {\r
+               return std::move(executor_.begin_invoke([&]() -> boost::property_tree::wptree\r
+               {\r
+                       boost::property_tree::wptree info;\r
+                       auto& layers_node = info.add(L"layers", L"");\r
+                       BOOST_FOREACH(auto& layer, layers_)\r
+                       {\r
+                               auto layer_info = layer.second.info();\r
+                               layer_info.add(L"layer.index", layer.first);\r
+                               BOOST_FOREACH(auto& update, layer_info)   \r
+                                       layers_node.add_child(update.first, update.second);\r
+                       }\r
+                       return info;\r
+               }, high_priority));\r
        }\r
 };\r
 \r
@@ -251,4 +270,5 @@ boost::unique_future<safe_ptr<frame_producer>> stage::foreground(size_t index) {
 boost::unique_future<safe_ptr<frame_producer>> stage::background(size_t index) {return impl_->background(index);}\r
 boost::unique_future<std::wstring> stage::call(int index, bool foreground, const std::wstring& param){return impl_->call(index, foreground, param);}\r
 void stage::set_video_format_desc(const video_format_desc& format_desc){impl_->set_video_format_desc(format_desc);}\r
+boost::unique_future<boost::property_tree::wptree> stage::info() const{return impl_->info();}\r
 }}
\ No newline at end of file