\r
Microsoft Visual Studio Solution File, Format Version 11.00\r
# Visual Studio 2010\r
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "common", "common\common.vcxproj", "{02308602-7FE0-4253-B96E-22134919F56A}"\r
-EndProject\r
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "core", "core\core.vcxproj", "{79388C20-6499-4BF6-B8B9-D8C33D7D4DDD}"\r
EndProject\r
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shell", "shell\shell.vcxproj", "{8C26C94F-8092-4769-8D84-DEA479721C5B}"\r
EndProject\r
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "image", "modules\image\image.vcxproj", "{3E11FF65-A9DA-4F80-87F2-A7C6379ED5E2}"\r
EndProject\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "common", "common\common.vcxproj", "{02308602-7FE0-4253-B96E-22134919F56A}"\r
+EndProject\r
Global\r
GlobalSection(SubversionScc) = preSolution\r
Svn-Managed = True\r
Release|Win32 = Release|Win32\r
EndGlobalSection\r
GlobalSection(ProjectConfigurationPlatforms) = postSolution\r
- {02308602-7FE0-4253-B96E-22134919F56A}.Debug|Win32.ActiveCfg = Debug|Win32\r
- {02308602-7FE0-4253-B96E-22134919F56A}.Debug|Win32.Build.0 = Debug|Win32\r
- {02308602-7FE0-4253-B96E-22134919F56A}.Develop|Win32.ActiveCfg = Develop|Win32\r
- {02308602-7FE0-4253-B96E-22134919F56A}.Develop|Win32.Build.0 = Develop|Win32\r
- {02308602-7FE0-4253-B96E-22134919F56A}.Profile|Win32.ActiveCfg = Profile|Win32\r
- {02308602-7FE0-4253-B96E-22134919F56A}.Profile|Win32.Build.0 = Profile|Win32\r
- {02308602-7FE0-4253-B96E-22134919F56A}.Release|Win32.ActiveCfg = Release|Win32\r
- {02308602-7FE0-4253-B96E-22134919F56A}.Release|Win32.Build.0 = Release|Win32\r
{79388C20-6499-4BF6-B8B9-D8C33D7D4DDD}.Debug|Win32.ActiveCfg = Debug|Win32\r
{79388C20-6499-4BF6-B8B9-D8C33D7D4DDD}.Debug|Win32.Build.0 = Debug|Win32\r
{79388C20-6499-4BF6-B8B9-D8C33D7D4DDD}.Develop|Win32.ActiveCfg = Develop|Win32\r
{3E11FF65-A9DA-4F80-87F2-A7C6379ED5E2}.Profile|Win32.Build.0 = Profile|Win32\r
{3E11FF65-A9DA-4F80-87F2-A7C6379ED5E2}.Release|Win32.ActiveCfg = Release|Win32\r
{3E11FF65-A9DA-4F80-87F2-A7C6379ED5E2}.Release|Win32.Build.0 = Release|Win32\r
+ {02308602-7FE0-4253-B96E-22134919F56A}.Debug|Win32.ActiveCfg = Debug|Win32\r
+ {02308602-7FE0-4253-B96E-22134919F56A}.Debug|Win32.Build.0 = Debug|Win32\r
+ {02308602-7FE0-4253-B96E-22134919F56A}.Develop|Win32.ActiveCfg = Develop|Win32\r
+ {02308602-7FE0-4253-B96E-22134919F56A}.Develop|Win32.Build.0 = Develop|Win32\r
+ {02308602-7FE0-4253-B96E-22134919F56A}.Profile|Win32.ActiveCfg = Profile|Win32\r
+ {02308602-7FE0-4253-B96E-22134919F56A}.Profile|Win32.Build.0 = Profile|Win32\r
+ {02308602-7FE0-4253-B96E-22134919F56A}.Release|Win32.ActiveCfg = Release|Win32\r
+ {02308602-7FE0-4253-B96E-22134919F56A}.Release|Win32.Build.0 = Release|Win32\r
EndGlobalSection\r
GlobalSection(SolutionProperties) = preSolution\r
HideSolutionNode = FALSE\r
boost::circular_buffer<size_t> sync_buffer_;\r
bool synced_;\r
public:\r
- cadence_guard(safe_ptr<frame_consumer>&& consumer)\r
- : consumer_(std::move(consumer))\r
+ cadence_guard(const safe_ptr<frame_consumer>& consumer)\r
+ : consumer_(consumer)\r
{\r
}\r
\r
}\r
};\r
\r
-safe_ptr<frame_consumer> create_consumer_cadence_guard(safe_ptr<frame_consumer>&& consumer)\r
+safe_ptr<frame_consumer> create_consumer_cadence_guard(const safe_ptr<frame_consumer>& consumer)\r
{\r
return make_safe<cadence_guard>(std::move(consumer));\r
}\r
}\r
};\r
\r
-safe_ptr<frame_consumer> create_consumer_cadence_guard(safe_ptr<frame_consumer>&& consumer);\r
+safe_ptr<frame_consumer> create_consumer_cadence_guard(const safe_ptr<frame_consumer>& consumer);\r
\r
typedef std::function<safe_ptr<core::frame_consumer>(const std::vector<std::wstring>&)> consumer_factory_t;\r
\r
#include <boost/timer.hpp>\r
#include <boost/range/algorithm.hpp>\r
#include <boost/range/adaptors.hpp>\r
+#include <boost/property_tree/ptree.hpp>\r
\r
namespace caspar { namespace core {\r
\r
graph_->set_color("consume-time", diagnostics::color(1.0f, 0.4f, 0.0f));\r
} \r
\r
- void add(safe_ptr<frame_consumer>&& consumer)\r
+ void add(int index, safe_ptr<frame_consumer> consumer)\r
{ \r
- remove(consumer->index());\r
+ remove(index);\r
\r
- consumer = create_consumer_cadence_guard(std::move(consumer));\r
+ consumer = create_consumer_cadence_guard(consumer);\r
consumer->initialize(format_desc_, channel_index_);\r
\r
executor_.invoke([&]\r
{\r
- consumers_.insert(std::make_pair(consumer->index(), consumer));\r
+ consumers_.insert(std::make_pair(index, consumer));\r
CASPAR_LOG(info) << print() << L" " << consumer->print() << L" Added.";\r
}, high_priority);\r
}\r
\r
+ void add(const safe_ptr<frame_consumer>& consumer)\r
+ {\r
+ add(consumer->index(), consumer);\r
+ }\r
+\r
void remove(int index)\r
{ \r
// Destroy consumer on calling thread:\r
CASPAR_LOG(info) << print() << L" " << str << L" Removed.";\r
}\r
}\r
+\r
+ void remove(const safe_ptr<frame_consumer>& consumer)\r
+ {\r
+ remove(consumer->index());\r
+ }\r
\r
void set_video_format_desc(const video_format_desc& format_desc)\r
{\r
{\r
return L"output[" + boost::lexical_cast<std::wstring>(channel_index_) + L"]";\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
+ BOOST_FOREACH(auto& consumer, consumers_)\r
+ {\r
+ auto& node = info.add(L"output.devices.device", L"");\r
+ node.add(L"index", consumer.first);\r
+ node.add(L"consumer", consumer.second->print());\r
+ }\r
+ return info;\r
+ }, high_priority));\r
+ }\r
};\r
\r
output::output(const safe_ptr<diagnostics::graph>& graph, const video_format_desc& format_desc, int channel_index) : impl_(new implementation(graph, format_desc, channel_index)){}\r
-void output::add(safe_ptr<frame_consumer>&& consumer){impl_->add(std::move(consumer));}\r
+void output::add(int index, const safe_ptr<frame_consumer>& consumer){impl_->add(index, consumer);}\r
+void output::add(const safe_ptr<frame_consumer>& consumer){impl_->add(consumer);}\r
void output::remove(int index){impl_->remove(index);}\r
+void output::remove(const safe_ptr<frame_consumer>& consumer){impl_->remove(consumer);}\r
void output::send(const std::pair<safe_ptr<read_frame>, std::shared_ptr<void>>& frame) {impl_->send(frame); }\r
void output::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> output::info() const{return impl_->info();}\r
}}
\ No newline at end of file
#include <common/diagnostics/graph.h>\r
\r
#include <boost/noncopyable.hpp>\r
+#include <boost/property_tree/ptree_fwd.hpp>\r
+#include <boost/thread/future.hpp>\r
\r
namespace caspar { namespace core {\r
\r
-class output : public target<std::pair<safe_ptr<read_frame>, std::shared_ptr<void>>>, boost::noncopyable\r
+class output : public target<std::pair<safe_ptr<read_frame>, std::shared_ptr<void>>>\r
+ , boost::noncopyable\r
{\r
public:\r
explicit output(const safe_ptr<diagnostics::graph>& graph, const video_format_desc& format_desc, int channel_index);\r
\r
// target\r
\r
- virtual void send(const std::pair<safe_ptr<read_frame>, std::shared_ptr<void>>& frame) override;\r
+ virtual void send( const std::pair<safe_ptr<read_frame>, std::shared_ptr<void>>& frame) override;\r
\r
// output\r
-\r
- void add(safe_ptr<frame_consumer>&& consumer);\r
+ \r
+ void add(const safe_ptr<frame_consumer>& consumer);\r
+ void add(int index, const safe_ptr<frame_consumer>& consumer);\r
+ void remove(const safe_ptr<frame_consumer>& consumer);\r
void remove(int index);\r
\r
void set_video_format_desc(const video_format_desc& format_desc);\r
\r
+ boost::unique_future<boost::property_tree::wptree> info() const;\r
private:\r
struct implementation;\r
safe_ptr<implementation> impl_;\r
\r
#include <boost/foreach.hpp>\r
#include <boost/timer.hpp>\r
+#include <boost/property_tree/ptree.hpp>\r
\r
#include <tbb/concurrent_queue.h>\r
#include <tbb/spin_mutex.h>\r
tbb::spin_mutex::scoped_lock lock(format_desc_mutex_);\r
return format_desc_;\r
}\r
+\r
+ boost::unique_future<boost::property_tree::wptree> info() const\r
+ {\r
+ boost::promise<boost::property_tree::wptree> info;\r
+ info.set_value(boost::property_tree::wptree());\r
+ return info.get_future();\r
+ }\r
};\r
\r
mixer::mixer(const safe_ptr<diagnostics::graph>& graph, const safe_ptr<target_t>& target, const video_format_desc& format_desc, const safe_ptr<ogl_device>& ogl) \r
void mixer::clear_transforms(){impl_->clear_transforms();}\r
void mixer::set_blend_mode(int index, blend_mode::type value){impl_->set_blend_mode(index, value);}\r
void mixer::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> mixer::info() const{return impl_->info();}\r
}}
\ No newline at end of file
#include <common/concurrency/target.h>\r
#include <common/diagnostics/graph.h>\r
\r
+#include <boost/property_tree/ptree_fwd.hpp>\r
+#include <boost/thread/future.hpp>\r
+\r
#include <map>\r
\r
namespace caspar { \r
struct frame_transform;\r
struct pixel_format;\r
\r
-class mixer : public target<std::pair<std::map<int, safe_ptr<core::basic_frame>>, std::shared_ptr<void>>>, public core::frame_factory\r
+class mixer : public target<std::pair<std::map<int, safe_ptr<core::basic_frame>>, std::shared_ptr<void>>>\r
+ , public core::frame_factory\r
{\r
public: \r
typedef target<std::pair<safe_ptr<read_frame>, std::shared_ptr<void>>> target_t;\r
void clear_transforms();\r
\r
void set_blend_mode(int index, blend_mode::type value);\r
+\r
+ boost::unique_future<boost::property_tree::wptree> info() const;\r
\r
private:\r
struct implementation;\r
#include <numeric>\r
\r
#include <boost/thread/future.hpp>\r
+#include <boost/property_tree/ptree.hpp>\r
\r
namespace caspar { \r
\r
return promise.get_future();\r
}\r
\r
+ virtual boost::property_tree::wptree info() const\r
+ {\r
+ boost::property_tree::wptree info;\r
+ info.push_front(std::make_pair(L"producer", print()));\r
+ return info;\r
+ }\r
+\r
virtual safe_ptr<frame_producer> get_following_producer() const {return frame_producer::empty();} // nothrow\r
virtual void set_leading_producer(const safe_ptr<frame_producer>&) {} // nothrow\r
\r
#include "frame_producer.h"\r
#include "frame/basic_frame.h"\r
\r
+#include <boost/property_tree/ptree.hpp>\r
+\r
namespace caspar { namespace core {\r
\r
struct layer::implementation\r
{\r
return background_ == core::frame_producer::empty() && foreground_ == core::frame_producer::empty();\r
}\r
+\r
+ boost::property_tree::wptree info() const\r
+ {\r
+ boost::property_tree::wptree info;\r
+ info.add_child(L"layer.foreground", foreground_->info());\r
+ info.add_child(L"layer.background", foreground_->info());\r
+ info.add(L"layer.status", is_paused_ ? L"paused" : (foreground_ == frame_producer::empty() ? L"stopped" : L"playing"));\r
+ info.add(L"layer.auto_delta", auto_play_delta_);\r
+ return info;\r
+ }\r
};\r
\r
layer::layer() : impl_(new implementation()){}\r
safe_ptr<frame_producer> layer::background() const { return impl_->background_;}\r
bool layer::empty() const {return impl_->empty();}\r
boost::unique_future<std::wstring> layer::call(bool foreground, const std::wstring& param){return impl_->call(foreground, param);}\r
+boost::property_tree::wptree layer::info() const{return impl_->info();}\r
}}
\ No newline at end of file
\r
#include <boost/noncopyable.hpp>\r
#include <boost/thread/future.hpp>\r
+#include <boost/property_tree/ptree_fwd.hpp>\r
\r
#include <string>\r
\r
safe_ptr<frame_producer> background() const; // nothrow\r
\r
safe_ptr<basic_frame> receive(); // nothrow\r
+\r
+ boost::property_tree::wptree info() const;\r
private:\r
struct implementation;\r
safe_ptr<implementation> impl_;\r
\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
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
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
#include <common/diagnostics/graph.h>\r
\r
#include <boost/noncopyable.hpp>\r
+#include <boost/property_tree/ptree_fwd.hpp>\r
+#include <boost/thread/future.hpp>\r
\r
namespace caspar { namespace core {\r
\r
\r
void set_video_format_desc(const video_format_desc& format_desc);\r
\r
+ boost::unique_future<boost::property_tree::wptree> info() const;\r
+\r
private:\r
struct implementation;\r
safe_ptr<implementation> impl_;\r
#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
{\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
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
\r
#include <boost/noncopyable.hpp>\r
\r
+#include <boost/property_tree/ptree_fwd.hpp>\r
+\r
namespace caspar { namespace core {\r
\r
class stage;\r
\r
video_format_desc get_video_format_desc() const;\r
void set_video_format_desc(const video_format_desc& format_desc);\r
+ \r
+ boost::property_tree::wptree info() const;\r
\r
private:\r
struct implementation;\r
\r
\r
/* File created by MIDL compiler version 7.00.0555 */\r
-/* at Thu Dec 01 20:20:22 2011\r
+/* at Fri Dec 02 15:12:59 2011\r
*/\r
/* Compiler settings for interop\DeckLinkAPI.idl:\r
Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 7.00.0555 \r
\r
\r
/* File created by MIDL compiler version 7.00.0555 */\r
-/* at Thu Dec 01 20:20:22 2011\r
+/* at Fri Dec 02 15:12:59 2011\r
*/\r
/* Compiler settings for interop\DeckLinkAPI.idl:\r
Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 7.00.0555 \r
\r
#include <common/exception/exceptions.h>\r
\r
-#include <fstream>\r
-#include <streambuf>\r
+#include <boost/property_tree/ptree.hpp>\r
+#include <boost/property_tree/xml_parser.hpp>\r
+#include <boost/algorithm/string/replace.hpp>\r
\r
#include <zlib.h>\r
\r
+#include <fstream>\r
+#include <streambuf>\r
+\r
namespace caspar { namespace flash {\r
\r
std::vector<char> decompress_one_file(const std::vector<char>& in_data, uLong buf_size = 5000000)\r
return out_data;\r
}\r
\r
-std::wstring read_template_meta_info(const std::wstring& filename)\r
+std::string read_template_meta_info(const std::wstring& filename)\r
{\r
auto file = std::fstream(filename, std::ios::in | std::ios::binary);\r
\r
\r
if(beg_it == data.end() || end_it == data.end())\r
BOOST_THROW_EXCEPTION(file_read_error());\r
- \r
- return widen(std::string(beg_it, end_it+end_str.size()));\r
+ \r
+ return std::string(beg_it, end_it+end_str.size());\r
}\r
\r
}}
\ No newline at end of file
\r
#include <string>\r
\r
+#include <boost/property_tree/ptree_fwd.hpp>\r
+\r
namespace caspar { namespace flash {\r
\r
-std::wstring read_template_meta_info(const std::wstring& filename);\r
+std::string read_template_meta_info(const std::wstring& filename);\r
\r
}}
\ No newline at end of file
#include <boost/algorithm/string.hpp>\r
#include <boost/filesystem.hpp>\r
#include <boost/regex.hpp>\r
+#include <boost/property_tree/xml_parser.hpp>\r
\r
/* Return codes\r
\r
//Perform loading of the clip\r
try\r
{\r
- GetChannel()->output()->add(create_consumer(_parameters));\r
+ auto consumer = create_consumer(_parameters);\r
+ GetChannel()->output()->add(GetLayerIndex(consumer->index()), consumer);\r
\r
CASPAR_LOG(info) << "Added " << _parameters[0] << TEXT(" successfully");\r
\r
SetReplyString(TEXT("404 CINF ERROR\r\n"));\r
return false;\r
}\r
- replyString << TEXT("200 INFO OK\r\n");\r
+ replyString << TEXT("200 CINF OK\r\n");\r
replyString << info << "\r\n";\r
}\r
catch(...)\r
\r
std::wstringstream ss;\r
ss << L"201 INFO OK\r\n";\r
- ss << flash::read_template_meta_info(filename) << L"\r\n";\r
+ \r
+ auto xml = flash::read_template_meta_info(filename);\r
+ ss << widen(xml);\r
+ ss << L"\r\n";\r
\r
SetReplyString(ss.str());\r
return true;\r
try\r
{\r
std::wstringstream replyString;\r
+ replyString << TEXT("201 INFO OK\r\n");\r
+\r
if(_parameters.size() >= 1)\r
{\r
- int channelIndex = boost::lexical_cast<int>(_parameters.at(0).c_str())-1;\r
- replyString << TEXT("201 INFO OK\r\n");\r
- GenerateChannelInfo(channelIndex, channels_.at(channelIndex), replyString);\r
+ int channelIndex = boost::lexical_cast<int>(_parameters.at(0).c_str())-1; \r
+ boost::property_tree::xml_parser::write_xml(replyString, channels_.at(channelIndex)->info(), boost::property_tree::xml_writer_settings<wchar_t>(' ', 3));\r
}\r
else\r
{\r
- replyString << TEXT("200 INFO OK\r\n");\r
- for(size_t n = 0; n < channels_.size(); ++n)\r
- GenerateChannelInfo(n, channels_[n], replyString);\r
- replyString << TEXT("\r\n");\r
+ boost::property_tree::wptree info;\r
+ auto& node = info.add(L"channels", L"");\r
+ int index = 0;\r
+ BOOST_FOREACH(auto channel, channels_)\r
+ {\r
+ BOOST_FOREACH(auto update, channel->info())\r
+ {\r
+ auto& channel = node.add_child(update.first, update.second);\r
+ channel.push_front(std::make_pair(L"index", boost::lexical_cast<std::wstring>(++index)));\r
+ }\r
+ }\r
+ boost::property_tree::xml_parser::write_xml(replyString, info, boost::property_tree::xml_writer_settings<wchar_t>(' ', 3));\r
}\r
+ replyString << TEXT("\r\n");\r
SetReplyString(replyString.str());\r
return true;\r
}\r
<template-path>D:\casparcg\_templates\</template-path>\r
</paths>\r
<channels>\r
+ <channel>\r
+ <video-mode>720p5000</video-mode>\r
+ <consumers>\r
+ <decklink>\r
+ <device>1</device>\r
+ </decklink>\r
+ </consumers>\r
+ </channel>\r
<channel>\r
<video-mode>720p5000</video-mode>\r
<consumers>\r