]> git.sesse.net Git - casparcg/commitdiff
Merged sfw playing through template host instead of via ffmpeg
authorhellgore <hellgore@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Tue, 4 Sep 2012 14:53:57 +0000 (14:53 +0000)
committerhellgore <hellgore@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Tue, 4 Sep 2012 14:53:57 +0000 (14:53 +0000)
git-svn-id: https://casparcg.svn.sourceforge.net/svnroot/casparcg/server/branches/2.1.0@3231 362d55ac-95cf-4e76-9f9a-cbaa9c17b72d

modules/ffmpeg/producer/util/util.cpp
modules/flash/flash.cpp
modules/flash/producer/cg_proxy.cpp
modules/flash/producer/cg_proxy.h

index 301699fa308b4dc5caf7d0812d74ad1d47eff9cd..0d526cbd13ea1397be45330721811c8673538915 100644 (file)
@@ -493,7 +493,7 @@ std::wstring print_mode(int width, int height, double fps, bool interlaced)
 \r
 bool is_valid_file(const std::wstring filename)\r
 {                              \r
-       static const std::vector<std::wstring> invalid_exts = boost::assign::list_of(L".png")(L".tga")(L".bmp")(L".jpg")(L".jpeg")(L".gif")(L".tiff")(L".tif")(L".jp2")(L".jpx")(L".j2k")(L".j2c");\r
+       static const std::vector<std::wstring> invalid_exts = boost::assign::list_of(L".png")(L".tga")(L".bmp")(L".jpg")(L".jpeg")(L".gif")(L".tiff")(L".tif")(L".jp2")(L".jpx")(L".j2k")(L".j2c")(L".swf")(L".ct");\r
        static std::vector<std::wstring>           valid_exts   = boost::assign::list_of(L".m2t")(L".mov")(L".mp4")(L".dv")(L".flv")(L".mpg")(L".wav")(L".mp3")(L".dnxhd")(L".h264")(L".prores");\r
 \r
        auto ext = boost::to_lower_copy(boost::filesystem::path(filename).extension().wstring());\r
index ba0730812c4b19802bcfd8f46e4d95f8b97137e2..5517d86090d8e17fd8a9e17a74336082793df81e 100644 (file)
@@ -33,6 +33,7 @@ namespace caspar { namespace flash {
 void init()\r
 {\r
        core::register_producer_factory(create_ct_producer);\r
+       core::register_producer_factory(create_swf_producer);\r
 }\r
 \r
 std::wstring cg_version()\r
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
index 4803d816ca95ffa1e738a56e0fc97a2f250f5f66..98228cdbfb4bde2a7a2791e96c77769a9964a9f5 100644 (file)
@@ -59,5 +59,6 @@ private:
 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 core::video_format_desc& format_desc, const std::vector<std::wstring>& params);\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
-}}
\ No newline at end of file
+}}\r