]> git.sesse.net Git - casparcg/blobdiff - modules/flash/producer/cg_proxy.cpp
Merged sfw playing through template host instead of via ffmpeg
[casparcg] / modules / flash / producer / cg_proxy.cpp
index 1e6086866894983beb8cde886a53526fcfd8f018..6867145aa77e7a9e3f260332c78f20bc9aae23b1 100644 (file)
@@ -160,23 +160,38 @@ cg_proxy create_cg_proxy(const spl::shared_ptr<core::video_channel>& video_chann
        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 core::video_format_desc& format_desc, const std::vector<std::wstring>& params) \r
+spl::shared_ptr<core::frame_producer> create_cg_producer_and_autoplay_file(\r
+               const spl::shared_ptr<core::frame_factory> frame_factory, \r
+               const core::video_format_desc& format_desc, \r
+               const std::vector<std::wstring>& params,\r
+               const std::wstring& filename) \r
 {\r
-       std::wstring filename = env::media_folder() + L"\\" + params[0] + L".ct";\r
        if(!boost::filesystem::exists(filename))\r
                return core::frame_producer::empty();\r
                \r
        boost::filesystem::path path(filename);\r
        path = boost::filesystem3::complete(path);\r
-       filename = path.wstring();\r
+       auto filename2 = path.wstring();\r
 \r
        auto flash_producer = flash::create_producer(frame_factory, format_desc, boost::assign::list_of<std::wstring>());       \r
        auto producer = flash_producer;\r
-       cg_proxy(producer).add(0, filename, 1);\r
+       cg_proxy(producer).add(0, filename2, 1);\r
 \r
        return producer;\r
 }\r
 \r
+spl::shared_ptr<core::frame_producer> create_ct_producer(const spl::shared_ptr<core::frame_factory> frame_factory, const core::video_format_desc& format_desc, const std::vector<std::wstring>& params) \r
+{\r
+       return create_cg_producer_and_autoplay_file(\r
+               frame_factory, format_desc, params, env::media_folder() + L"\\" + params[0] + L".ct");\r
+}\r
+\r
+spl::shared_ptr<core::frame_producer> create_swf_producer(const spl::shared_ptr<core::frame_factory> frame_factory, const core::video_format_desc& format_desc, const std::vector<std::wstring>& params) \r
+{\r
+       return create_cg_producer_and_autoplay_file(\r
+               frame_factory, format_desc, params, env::media_folder() + L"\\" + params[0] + L".swf");\r
+}\r
+\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