if(color2.length() != 9 || color2[0] != '#')\r
return core::frame_producer::empty();\r
\r
- return spl::make_shared<color_producer>(frame_factory, color2);\r
+ return core::wrap_producer(spl::make_shared<color_producer>(frame_factory, color2));\r
}\r
spl::shared_ptr<write_frame> create_color_frame(void* tag, const spl::shared_ptr<frame_factory>& frame_factory, const std::wstring& color)\r
{\r
\r
std::vector<const producer_factory_t> g_factories;\r
\r
+void register_producer_factory(const producer_factory_t& factory)\r
+{\r
+ g_factories.push_back(factory);\r
+}\r
+\r
boost::unique_future<std::wstring> frame_producer::call(const std::wstring&) \r
{\r
BOOST_THROW_EXCEPTION(not_supported());\r
return producer;\r
} \r
\r
-spl::shared_ptr<draw_frame> receive_and_follow(spl::shared_ptr<frame_producer>& producer, int hints)\r
-{ \r
- auto frame = producer->receive(hints);\r
- if(frame == draw_frame::eof())\r
- {\r
- CASPAR_LOG(info) << producer->print() << " End Of File.";\r
- auto following = producer->get_following_producer();\r
- if(following != frame_producer::empty())\r
- {\r
- following->set_leading_producer(producer);\r
- producer = std::move(following);\r
- }\r
-\r
- return receive_and_follow(producer, hints);\r
- }\r
- return frame;\r
-}\r
-\r
-void register_producer_factory(const producer_factory_t& factory)\r
-{\r
- g_factories.push_back(factory);\r
-}\r
-\r
class destroy_producer_proxy : public frame_producer\r
{ \r
std::unique_ptr<std::shared_ptr<frame_producer>> producer_;\r
virtual uint32_t nb_frames() const override {return producer_->nb_frames();}\r
};\r
\r
+class follow_producer_proxy : public frame_producer\r
+{ \r
+ spl::shared_ptr<frame_producer> producer_;\r
+public:\r
+ follow_producer_proxy(spl::shared_ptr<frame_producer>&& producer) \r
+ : producer_(std::move(producer))\r
+ {\r
+ }\r
+\r
+ virtual spl::shared_ptr<draw_frame> receive(int hints) override \r
+ {\r
+ auto frame = producer_->receive(hints);\r
+ if(frame == draw_frame::eof())\r
+ {\r
+ CASPAR_LOG(info) << producer_->print() << " End Of File.";\r
+ auto following = producer_->get_following_producer();\r
+ if(following != frame_producer::empty())\r
+ {\r
+ following->set_leading_producer(producer_);\r
+ producer_ = std::move(following);\r
+ }\r
+\r
+ return receive(hints);\r
+ }\r
+ return frame;\r
+ }\r
+\r
+ virtual spl::shared_ptr<draw_frame> last_frame() const override {return producer_->last_frame();}\r
+ virtual std::wstring print() const override {return producer_->print();}\r
+ virtual boost::property_tree::wptree info() const override {return producer_->info();}\r
+ virtual boost::unique_future<std::wstring> call(const std::wstring& str) override {return producer_->call(str);}\r
+ virtual spl::shared_ptr<frame_producer> get_following_producer() const override {return producer_->get_following_producer();}\r
+ virtual void set_leading_producer(const spl::shared_ptr<frame_producer>& producer) override {return producer_->set_leading_producer(producer);}\r
+ virtual uint32_t nb_frames() const override {return producer_->nb_frames();}\r
+};\r
+\r
+spl::shared_ptr<core::frame_producer> wrap_producer(spl::shared_ptr<core::frame_producer> producer)\r
+{\r
+ return spl::make_shared<follow_producer_proxy>(\r
+ spl::make_shared<destroy_producer_proxy>(\r
+ spl::make_shared<print_producer_proxy>(\r
+ std::move(producer))));\r
+}\r
+\r
spl::shared_ptr<core::frame_producer> do_create_producer(const spl::shared_ptr<frame_factory>& my_frame_factory, const std::vector<std::wstring>& params)\r
{\r
if(params.empty())\r
if(producer == frame_producer::empty())\r
return producer;\r
\r
- return spl::make_shared<destroy_producer_proxy>(\r
- spl::make_shared<print_producer_proxy>(\r
- std::move(producer)));\r
+ return producer;\r
}\r
\r
spl::shared_ptr<core::frame_producer> create_producer(const spl::shared_ptr<frame_factory>& my_frame_factory, const std::vector<std::wstring>& params)\r
static const spl::shared_ptr<frame_producer>& empty(); // nothrow\r
};\r
\r
-spl::shared_ptr<class draw_frame> receive_and_follow(spl::shared_ptr<frame_producer>& producer, int flags);\r
-\r
typedef std::function<spl::shared_ptr<core::frame_producer>(const spl::shared_ptr<struct frame_factory>&, const std::vector<std::wstring>&)> producer_factory_t;\r
void register_producer_factory(const producer_factory_t& factory); // Not thread-safe.\r
\r
spl::shared_ptr<core::frame_producer> create_producer(const spl::shared_ptr<frame_factory>&, const std::vector<std::wstring>& params);\r
spl::shared_ptr<core::frame_producer> create_producer(const spl::shared_ptr<frame_factory>&, const std::wstring& params);\r
+\r
+spl::shared_ptr<core::frame_producer> wrap_producer(spl::shared_ptr<core::frame_producer> producer);\r
\r
}}\r
if(is_paused_)\r
return draw_frame::mute(foreground_->last_frame());\r
\r
- auto frame = receive_and_follow(foreground_, flags.value());\r
+ auto frame = foreground_->receive(flags.value());\r
if(frame == core::draw_frame::late())\r
return draw_frame::mute(foreground_->last_frame());\r
\r
[&]\r
{\r
if(fill_ == core::draw_frame::late())\r
- fill_ = receive_and_follow(fill_producer_, flags);\r
+ fill_ = fill_producer_->receive(flags);\r
},\r
[&]\r
{\r
if(key_ == core::draw_frame::late())\r
- key_ = receive_and_follow(key_producer_, flags | frame_producer::flags::alpha_only);\r
+ key_ = key_producer_->receive(flags | frame_producer::flags::alpha_only);\r
});\r
\r
if(fill_ == draw_frame::eof() || key_ == draw_frame::eof())\r
\r
spl::shared_ptr<frame_producer> create_separated_producer(const spl::shared_ptr<frame_producer>& fill, const spl::shared_ptr<frame_producer>& key)\r
{\r
- return spl::make_shared<separated_producer>(fill, key);\r
+ return core::wrap_producer(spl::make_shared<separated_producer>(fill, key));\r
}\r
\r
}}\r
tbb::parallel_invoke(\r
[&]\r
{\r
- dest = receive_and_follow(dest_producer_, flags);\r
+ dest = dest_producer_->receive(flags);\r
if(dest == core::draw_frame::late())\r
dest = dest_producer_->last_frame();\r
},\r
[&]\r
{\r
- source = receive_and_follow(source_producer_, flags);\r
+ source = source_producer_->receive(flags);\r
if(source == core::draw_frame::late())\r
source = source_producer_->last_frame();\r
});\r
\r
spl::shared_ptr<frame_producer> create_transition_producer(const field_mode& mode, const spl::shared_ptr<frame_producer>& destination, const transition_info& info)\r
{\r
- return spl::make_shared<transition_producer>(mode, destination, info);\r
+ return core::wrap_producer(spl::make_shared<transition_producer>(mode, destination, info));\r
}\r
\r
}}\r
if(format_desc.format == core::video_format::invalid)\r
format_desc = frame_factory->get_video_format_desc();\r
\r
- return spl::make_shared<decklink_producer_proxy>(frame_factory, format_desc, device_index, filter_str, length);\r
+ return core::wrap_producer(spl::make_shared<decklink_producer_proxy>(frame_factory, format_desc, device_index, filter_str, length));\r
}\r
\r
}}
\ No newline at end of file
boost::replace_all(filter_str, L"DEINTERLACE", L"YADIF=0:-1");\r
boost::replace_all(filter_str, L"DEINTERLACE_BOB", L"YADIF=1:-1");\r
\r
- return spl::make_shared<ffmpeg_producer>(frame_factory, filename, filter_str, loop, start, length);\r
+ return core::wrap_producer(spl::make_shared<ffmpeg_producer>(frame_factory, filename, filter_str, loop, start, length));\r
}\r
\r
}}
\ No newline at end of file
\r
#include "flash.h"\r
\r
-#include "producer/cg_producer.h"\r
+#include "producer/cg_proxy.h"\r
#include "producer/flash_producer.h"\r
\r
#include <common/env.h>\r
void init()\r
{\r
core::register_producer_factory(create_ct_producer);\r
- core::register_producer_factory(create_cg_producer);\r
}\r
\r
std::wstring get_cg_version()\r
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NotUsing</PrecompiledHeader>\r
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NotUsing</PrecompiledHeader>\r
</ClCompile>\r
- <ClCompile Include="producer\cg_producer.cpp">\r
+ <ClCompile Include="producer\cg_proxy.cpp">\r
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">../StdAfx.h</PrecompiledHeaderFile>\r
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|x64'">../StdAfx.h</PrecompiledHeaderFile>\r
</ClCompile>\r
<ClInclude Include="flash.h" />\r
<ClInclude Include="interop\axflash.h" />\r
<ClInclude Include="interop\TimerHelper.h" />\r
- <ClInclude Include="producer\cg_producer.h" />\r
+ <ClInclude Include="producer\cg_proxy.h" />\r
<ClInclude Include="producer\FlashAxContainer.h" />\r
<ClInclude Include="producer\flash_producer.h" />\r
<ClInclude Include="StdAfx.h" />\r
<ClCompile Include="producer\FlashAxContainer.cpp">\r
<Filter>source\producer</Filter>\r
</ClCompile>\r
- <ClCompile Include="producer\cg_producer.cpp">\r
- <Filter>source\producer</Filter>\r
- </ClCompile>\r
<ClCompile Include="StdAfx.cpp" />\r
<ClCompile Include="flash.cpp">\r
<Filter>source</Filter>\r
<ClCompile Include="util\swf.cpp">\r
<Filter>source\util</Filter>\r
</ClCompile>\r
+ <ClCompile Include="producer\cg_proxy.cpp">\r
+ <Filter>source\producer</Filter>\r
+ </ClCompile>\r
</ItemGroup>\r
<ItemGroup>\r
<ClInclude Include="interop\TimerHelper.h">\r
<ClInclude Include="interop\axflash.h">\r
<Filter>source\interop</Filter>\r
</ClInclude>\r
- <ClInclude Include="producer\cg_producer.h">\r
- <Filter>source\producer</Filter>\r
- </ClInclude>\r
<ClInclude Include="producer\flash_producer.h">\r
<Filter>source\producer</Filter>\r
</ClInclude>\r
<ClInclude Include="util\swf.h">\r
<Filter>source\util</Filter>\r
</ClInclude>\r
+ <ClInclude Include="producer\cg_proxy.h">\r
+ <Filter>source\producer</Filter>\r
+ </ClInclude>\r
</ItemGroup>\r
</Project>
\ No newline at end of file
\r
#include "../StdAfx.h"\r
\r
-#include "cg_producer.h"\r
+#include "cg_proxy.h"\r
\r
#include "flash_producer.h"\r
\r
\r
namespace caspar { namespace flash {\r
\r
-struct cg_producer::impl : boost::noncopyable\r
+struct cg_proxy::impl : boost::noncopyable\r
{\r
spl::shared_ptr<core::frame_producer> flash_producer_;\r
public:\r
CASPAR_LOG(info) << flash_producer_->print() << " Invoking info-command: " << str;\r
return flash_producer_->call(str);\r
}\r
-\r
- boost::unique_future<std::wstring> call(const std::wstring& str)\r
- { \r
- static const boost::wregex add_exp (L"ADD (?<LAYER>\\d+) (?<FILENAME>[^\\s]+) (?<PLAY_ON_LOAD>\\d)( (?<DATA>.*))?");\r
- static const boost::wregex remove_exp (L"REMOVE (?<LAYER>\\d+)");\r
- static const boost::wregex play_exp (L"PLAY (?<LAYER>\\d+)");\r
- static const boost::wregex stop_exp (L"STOP (?<LAYER>\\d+)");\r
- static const boost::wregex next_exp (L"NEXT (?<LAYER>\\d+)");\r
- static const boost::wregex update_exp (L"UPDATE (?<LAYER>\\d+) (?<DATA>.+)");\r
- static const boost::wregex invoke_exp (L"INVOKE (?<LAYER>\\d+) (?<LABEL>.+)");\r
- static const boost::wregex description_exp (L"INFO (?<LAYER>\\d+)");\r
- static const boost::wregex info_exp (L"INFO");\r
\r
- boost::wsmatch what;\r
- if(boost::regex_match(str, what, add_exp))\r
- return add(boost::lexical_cast<int>(what["LAYER"].str()), flash::find_template(env::template_folder() + what["FILENAME"].str()), boost::lexical_cast<bool>(what["PLAY_ON_LOAD"].str()), L"", what["DATA"].str()); \r
- else if(boost::regex_match(str, what, remove_exp))\r
- return remove(boost::lexical_cast<int>(what["LAYER"].str())); \r
- else if(boost::regex_match(str, what, stop_exp))\r
- return stop(boost::lexical_cast<int>(what["LAYER"].str()), 0); \r
- else if(boost::regex_match(str, what, next_exp))\r
- return next(boost::lexical_cast<int>(what["LAYER"].str())); \r
- else if(boost::regex_match(str, what, update_exp))\r
- return update(boost::lexical_cast<int>(what["LAYER"].str()), what["DATA"].str()); \r
- else if(boost::regex_match(str, what, next_exp))\r
- return invoke(boost::lexical_cast<int>(what["LAYER"].str()), what["LABEL"].str()); \r
- else if(boost::regex_match(str, what, description_exp))\r
- return description(boost::lexical_cast<int>(what["LAYER"].str())); \r
- else if(boost::regex_match(str, what, invoke_exp))\r
- return template_host_info(); \r
-\r
- return flash_producer_->call(str);\r
- }\r
-\r
- spl::shared_ptr<core::draw_frame> receive(int flags)\r
- {\r
- return flash_producer_->receive(flags);\r
- }\r
-\r
- spl::shared_ptr<core::draw_frame> last_frame() const\r
- {\r
- return flash_producer_->last_frame();\r
- } \r
- \r
- std::wstring print() const\r
- {\r
- return flash_producer_->print();\r
- }\r
-\r
- boost::property_tree::wptree info() const\r
- {\r
- boost::property_tree::wptree info;\r
- info.add(L"type", L"cg-producer");\r
- return info;\r
- }\r
-\r
std::wstring timed_invoke(int layer, const std::wstring& label)\r
{\r
auto result = invoke(layer, label);\r
}\r
};\r
\r
-spl::shared_ptr<cg_producer> get_default_cg_producer(const spl::shared_ptr<core::video_channel>& video_channel, int render_layer)\r
+cg_proxy create_cg_proxy(const spl::shared_ptr<core::video_channel>& video_channel, int render_layer)\r
{ \r
auto flash_producer = video_channel->stage()->foreground(render_layer).get();\r
\r
throw;\r
}\r
\r
- return spl::make_shared<cg_producer>(flash_producer);\r
+ return cg_proxy(std::move(flash_producer));\r
}\r
\r
spl::shared_ptr<core::frame_producer> create_ct_producer(const spl::shared_ptr<core::frame_factory> frame_factory, const std::vector<std::wstring>& params) \r
filename = path.wstring();\r
\r
auto flash_producer = flash::create_producer(frame_factory, boost::assign::list_of<std::wstring>()); \r
- auto producer = spl::make_shared<cg_producer>(flash_producer);\r
- producer->add(0, filename, 1);\r
-\r
- return producer;\r
-}\r
-\r
-spl::shared_ptr<core::frame_producer> create_cg_producer(const spl::shared_ptr<core::frame_factory> frame_factory, const std::vector<std::wstring>& params) \r
-{\r
- if(params.empty() || params.at(0) != L"[CG]")\r
- return core::frame_producer::empty();\r
+ auto producer = flash_producer;\r
+ cg_proxy(producer).add(0, filename, 1);\r
\r
- return spl::make_shared<cg_producer>(flash::create_producer(frame_factory, boost::assign::list_of<std::wstring>())); \r
+ return core::wrap_producer(producer);\r
}\r
\r
-cg_producer::cg_producer(const spl::shared_ptr<core::frame_producer>& frame_producer) : impl_(new impl(frame_producer)){}\r
-cg_producer::cg_producer(cg_producer&& other) : impl_(std::move(other.impl_)){}\r
-spl::shared_ptr<core::draw_frame> cg_producer::receive(int flags){return impl_->receive(flags);}\r
-spl::shared_ptr<core::draw_frame> cg_producer::last_frame() const{return impl_->last_frame();}\r
-void cg_producer::add(int layer, const std::wstring& template_name, bool play_on_load, const std::wstring& startFromLabel, const std::wstring& data){impl_->add(layer, template_name, play_on_load, startFromLabel, data);}\r
-void cg_producer::remove(int layer){impl_->remove(layer);}\r
-void cg_producer::play(int layer){impl_->play(layer);}\r
-void cg_producer::stop(int layer, unsigned int mix_out_duration){impl_->stop(layer, mix_out_duration);}\r
-void cg_producer::next(int layer){impl_->next(layer);}\r
-void cg_producer::update(int layer, const std::wstring& data){impl_->update(layer, data);}\r
-std::wstring cg_producer::print() const{return impl_->print();}\r
-boost::unique_future<std::wstring> cg_producer::call(const std::wstring& str){return impl_->call(str);}\r
-std::wstring cg_producer::invoke(int layer, const std::wstring& label){return impl_->timed_invoke(layer, label);}\r
-std::wstring cg_producer::description(int layer){return impl_->timed_description(layer);}\r
-std::wstring cg_producer::template_host_info(){return impl_->timed_template_host_info();}\r
-boost::property_tree::wptree cg_producer::info() const{return impl_->info();}\r
+cg_proxy::cg_proxy(const spl::shared_ptr<core::frame_producer>& frame_producer) : impl_(new impl(frame_producer)){}\r
+cg_proxy::cg_proxy(cg_proxy&& other) : impl_(std::move(other.impl_)){}\r
+void cg_proxy::add(int layer, const std::wstring& template_name, bool play_on_load, const std::wstring& startFromLabel, const std::wstring& data){impl_->add(layer, template_name, play_on_load, startFromLabel, data);}\r
+void cg_proxy::remove(int layer){impl_->remove(layer);}\r
+void cg_proxy::play(int layer){impl_->play(layer);}\r
+void cg_proxy::stop(int layer, unsigned int mix_out_duration){impl_->stop(layer, mix_out_duration);}\r
+void cg_proxy::next(int layer){impl_->next(layer);}\r
+void cg_proxy::update(int layer, const std::wstring& data){impl_->update(layer, data);}\r
+std::wstring cg_proxy::invoke(int layer, const std::wstring& label){return impl_->timed_invoke(layer, label);}\r
+std::wstring cg_proxy::description(int layer){return impl_->timed_description(layer);}\r
+std::wstring cg_proxy::template_host_info(){return impl_->timed_template_host_info();}\r
\r
}}
\ No newline at end of file
\r
namespace caspar { namespace flash {\r
\r
-class cg_producer : public core::frame_producer\r
+class cg_proxy\r
{\r
public:\r
static const unsigned int DEFAULT_LAYER = 9999;\r
\r
- explicit cg_producer(const spl::shared_ptr<core::frame_producer>& producer);\r
- cg_producer(cg_producer&& other);\r
+ explicit cg_proxy(const spl::shared_ptr<core::frame_producer>& producer);\r
+ cg_proxy(cg_proxy&& other);\r
\r
- // frame_producer\r
-\r
- virtual spl::shared_ptr<core::draw_frame> receive(int) override;\r
- virtual spl::shared_ptr<core::draw_frame> last_frame() const override;\r
- virtual std::wstring print() const override;\r
- virtual boost::unique_future<std::wstring> call(const std::wstring&) override;\r
- virtual boost::property_tree::wptree info() const override;\r
-\r
- //cg_producer\r
+ //cg_proxy\r
\r
void add(int layer, const std::wstring& template_name, bool play_on_load, const std::wstring& start_from_label = L"", const std::wstring& data = L"");\r
void remove(int layer);\r
struct impl;\r
std::shared_ptr<impl> impl_;\r
};\r
-spl::shared_ptr<cg_producer> get_default_cg_producer(const spl::shared_ptr<core::video_channel>& video_channel, int layer_index = cg_producer::DEFAULT_LAYER);\r
+cg_proxy create_cg_proxy(const spl::shared_ptr<core::video_channel>& video_channel, int layer_index = cg_proxy::DEFAULT_LAYER);\r
\r
spl::shared_ptr<core::frame_producer> create_ct_producer(const spl::shared_ptr<core::frame_factory> frame_factory, const std::vector<std::wstring>& params);\r
-spl::shared_ptr<core::frame_producer> create_cg_producer(const spl::shared_ptr<core::frame_factory> frame_factory, const std::vector<std::wstring>& params);\r
\r
}}
\ No newline at end of file
if(!boost::filesystem::exists(filename))\r
BOOST_THROW_EXCEPTION(file_not_found() << boost::errinfo_file_name(u8(filename))); \r
\r
- return spl::make_shared<flash_producer>(frame_factory, filename, template_host.width, template_host.height);\r
+ return core::wrap_producer(spl::make_shared<flash_producer>(frame_factory, filename, template_host.width, template_host.height));\r
}\r
\r
std::wstring find_template(const std::wstring& template_name)\r
if(ext == extensions.end())\r
return core::frame_producer::empty();\r
\r
- return spl::make_shared<image_producer>(frame_factory, filename + *ext);\r
+ return core::wrap_producer(spl::make_shared<image_producer>(frame_factory, filename + *ext));\r
}\r
\r
\r
if(speed == 0)\r
return core::frame_producer::empty();\r
\r
- return spl::make_shared<image_scroll_producer>(frame_factory, filename + L"." + *ext, speed);\r
+ return core::wrap_producer(spl::make_shared<image_scroll_producer>(frame_factory, filename + L"." + *ext, speed));\r
}\r
\r
}}
\ No newline at end of file
{\r
auto producer = spl::make_shared<reroute_producer>(frame_factory);\r
o.subscribe(producer);\r
- return producer;\r
+ return core::wrap_producer(producer);\r
}\r
\r
}}
\ No newline at end of file
#include <modules/flash/flash.h>\r
#include <modules/flash/util/swf.h>\r
#include <modules/flash/producer/flash_producer.h>\r
-#include <modules/flash/producer/cg_producer.h>\r
+#include <modules/flash/producer/cg_proxy.h>\r
#include <modules/ffmpeg/producer/util/util.h>\r
#include <modules/image/image.h>\r
#include <modules/screen/screen.h>\r
// std::wstring filename = templatename;\r
// filename.append(extension);\r
//\r
-// flash::flash::get_default_cg_producer(info.video_channel, std::max<int>(DEFAULT_CHANNEL_LAYER+1, info.layer_index))\r
+// flash::flash::create_cg_proxy(info.video_channel, std::max<int>(DEFAULT_CHANNEL_LAYER+1, info.layer_index))\r
// ->add(flash_layer_index, filename, play_on_load, start_label, data);\r
//\r
// CASPAR_LOG(info) << L"Executed [amcp_channel_cg_add]";\r
std::wstring filename = _parameters[2];\r
filename.append(extension);\r
\r
- flash::get_default_cg_producer(spl::shared_ptr<core::video_channel>(GetChannel()), GetLayerIndex(flash::cg_producer::DEFAULT_LAYER))->add(layer, filename, bDoStart, label, (pDataString!=0) ? pDataString : TEXT(""));\r
+ flash::create_cg_proxy(spl::shared_ptr<core::video_channel>(GetChannel()), GetLayerIndex(flash::cg_proxy::DEFAULT_LAYER)).add(layer, filename, bDoStart, label, (pDataString!=0) ? pDataString : TEXT(""));\r
SetReplyString(TEXT("202 CG OK\r\n"));\r
}\r
else\r
return false;\r
}\r
int layer = _ttoi(_parameters[1].c_str());\r
- flash::get_default_cg_producer(spl::shared_ptr<core::video_channel>(GetChannel()), GetLayerIndex(flash::cg_producer::DEFAULT_LAYER))->play(layer);\r
+ flash::create_cg_proxy(spl::shared_ptr<core::video_channel>(GetChannel()), GetLayerIndex(flash::cg_proxy::DEFAULT_LAYER)).play(layer);\r
}\r
else\r
{\r
return false;\r
}\r
int layer = _ttoi(_parameters[1].c_str());\r
- flash::get_default_cg_producer(spl::shared_ptr<core::video_channel>(GetChannel()), GetLayerIndex(flash::cg_producer::DEFAULT_LAYER))->stop(layer, 0);\r
+ flash::create_cg_proxy(spl::shared_ptr<core::video_channel>(GetChannel()), GetLayerIndex(flash::cg_proxy::DEFAULT_LAYER)).stop(layer, 0);\r
}\r
else \r
{\r
}\r
\r
int layer = _ttoi(_parameters[1].c_str());\r
- flash::get_default_cg_producer(spl::shared_ptr<core::video_channel>(GetChannel()), GetLayerIndex(flash::cg_producer::DEFAULT_LAYER))->next(layer);\r
+ flash::create_cg_proxy(spl::shared_ptr<core::video_channel>(GetChannel()), GetLayerIndex(flash::cg_proxy::DEFAULT_LAYER)).next(layer);\r
}\r
else \r
{\r
}\r
\r
int layer = _ttoi(_parameters[1].c_str());\r
- flash::get_default_cg_producer(spl::shared_ptr<core::video_channel>(GetChannel()), GetLayerIndex(flash::cg_producer::DEFAULT_LAYER))->remove(layer);\r
+ flash::create_cg_proxy(spl::shared_ptr<core::video_channel>(GetChannel()), GetLayerIndex(flash::cg_proxy::DEFAULT_LAYER)).remove(layer);\r
}\r
else \r
{\r
\r
bool CGCommand::DoExecuteClear() \r
{\r
- GetChannel()->stage()->clear(GetLayerIndex(flash::cg_producer::DEFAULT_LAYER));\r
+ GetChannel()->stage()->clear(GetLayerIndex(flash::cg_proxy::DEFAULT_LAYER));\r
SetReplyString(TEXT("202 CG OK\r\n"));\r
return true;\r
}\r
} \r
\r
int layer = _ttoi(_parameters.at(1).c_str());\r
- flash::get_default_cg_producer(spl::shared_ptr<core::video_channel>(GetChannel()), GetLayerIndex(flash::cg_producer::DEFAULT_LAYER))->update(layer, dataString);\r
+ flash::create_cg_proxy(spl::shared_ptr<core::video_channel>(GetChannel()), GetLayerIndex(flash::cg_proxy::DEFAULT_LAYER)).update(layer, dataString);\r
}\r
catch(...)\r
{\r
return false;\r
}\r
int layer = _ttoi(_parameters[1].c_str());\r
- auto result = flash::get_default_cg_producer(spl::shared_ptr<core::video_channel>(GetChannel()), GetLayerIndex(flash::cg_producer::DEFAULT_LAYER))->invoke(layer, _parameters2[2]);\r
+ auto result = flash::create_cg_proxy(spl::shared_ptr<core::video_channel>(GetChannel()), GetLayerIndex(flash::cg_proxy::DEFAULT_LAYER)).invoke(layer, _parameters2[2]);\r
replyString << result << TEXT("\r\n"); \r
}\r
else \r
}\r
\r
int layer = _ttoi(_parameters[1].c_str());\r
- auto desc = flash::get_default_cg_producer(spl::shared_ptr<core::video_channel>(GetChannel()), GetLayerIndex(flash::cg_producer::DEFAULT_LAYER))->description(layer);\r
+ auto desc = flash::create_cg_proxy(spl::shared_ptr<core::video_channel>(GetChannel()), GetLayerIndex(flash::cg_proxy::DEFAULT_LAYER)).description(layer);\r
\r
replyString << desc << TEXT("\r\n"); \r
}\r
else \r
{\r
- auto info = flash::get_default_cg_producer(spl::shared_ptr<core::video_channel>(GetChannel()), GetLayerIndex(flash::cg_producer::DEFAULT_LAYER))->template_host_info();\r
+ auto info = flash::create_cg_proxy(spl::shared_ptr<core::video_channel>(GetChannel()), GetLayerIndex(flash::cg_proxy::DEFAULT_LAYER)).template_host_info();\r
replyString << info << TEXT("\r\n"); \r
} \r
\r
#include "CIICommandsImpl.h"\r
#include <sstream>\r
#include <algorithm>\r
-#include <modules/flash/producer/cg_producer.h>\r
+#include <modules/flash/producer/cg_proxy.h>\r
#include <boost/locale.hpp>\r
\r
namespace caspar { namespace protocol { namespace cii {\r
{\r
// HACK fix. The data sent is UTF8, however the protocol is implemented for ISO-8859-1. Instead of doing risky changes we simply convert into proper encoding when leaving protocol code.\r
auto xmlData2 = boost::locale::conv::utf_to_utf<wchar_t, char>(std::string(xmlData_.begin(), xmlData_.end()));\r
- flash::get_default_cg_producer(pCIIStrategy_->GetChannel())->add(layer_, filename_, false, TEXT(""), xmlData2);\r
+ flash::create_cg_proxy(pCIIStrategy_->GetChannel()).add(layer_, filename_, false, TEXT(""), xmlData2);\r
}\r
}\r
\r
\r
//TODO: Need to be checked for validity\r
else if(state_ == 1)\r
- flash::get_default_cg_producer(pCIIStrategy_->GetChannel())->stop(layer_, 0);\r
+ flash::create_cg_proxy(pCIIStrategy_->GetChannel()).stop(layer_, 0);\r
else if(state_ == 2)\r
- pCIIStrategy_->GetChannel()->stage()->clear(flash::cg_producer::DEFAULT_LAYER);\r
+ pCIIStrategy_->GetChannel()->stage()->clear(flash::cg_proxy::DEFAULT_LAYER);\r
else if(state_ == 3)\r
- flash::get_default_cg_producer(pCIIStrategy_->GetChannel())->play(layer_);\r
+ flash::create_cg_proxy(pCIIStrategy_->GetChannel()).play(layer_);\r
}\r
\r
void KeydataCommand::Setup(const std::vector<std::wstring>& parameters) {\r
\r
#include "CLKProtocolStrategy.h"\r
\r
-#include <modules/flash/producer/cg_producer.h>\r
+#include <modules/flash/producer/cg_proxy.h>\r
\r
#include <string>\r
#include <sstream>\r
\r
if(currentCommand_.command_ == CLKCommand::CLKReset) \r
{\r
- pChannel_->stage()->clear(flash::cg_producer::DEFAULT_LAYER);\r
+ pChannel_->stage()->clear(flash::cg_proxy::DEFAULT_LAYER);\r
bClockLoaded_ = false;\r
\r
CASPAR_LOG(info) << L"CLK: Recieved and executed reset-command";\r
{\r
if(!bClockLoaded_) \r
{\r
- flash::get_default_cg_producer(pChannel_)->add(0, TEXT("hawrysklocka/clock.ft"), true, TEXT(""), currentCommand_.GetData());\r
+ flash::create_cg_proxy(pChannel_).add(0, TEXT("hawrysklocka/clock.ft"), true, TEXT(""), currentCommand_.GetData());\r
bClockLoaded_ = true;\r
}\r
else \r
- flash::get_default_cg_producer(pChannel_)->update(0, currentCommand_.GetData());\r
+ flash::create_cg_proxy(pChannel_).update(0, currentCommand_.GetData());\r
\r
CASPAR_LOG(debug) << L"CLK: Clockdata sent: " << currentCommand_.GetData();\r
CASPAR_LOG(debug) << L"CLK: Executed valid command: " << currentCommandString_.str();\r
<log-level>trace</log-level>\r
<channels>\r
<channel>\r
- <video-mode>720p5000</video-mode>\r
+ <video-mode>PAL</video-mode>\r
<consumers>\r
<screen>\r
- <device>2</device>\r
</screen>\r
+ <system-audio></system-audio>\r
</consumers>\r
</channel>\r
</channels>\r