]> git.sesse.net Git - casparcg/commitdiff
Send swf files to TemplateHost instead of letting ffmpeg handle them. The TemplateHos...
authorhellgore <hellgore@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Thu, 23 Aug 2012 13:07:09 +0000 (13:07 +0000)
committerhellgore <hellgore@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Thu, 23 Aug 2012 13:07:09 +0000 (13:07 +0000)
git-svn-id: https://casparcg.svn.sourceforge.net/svnroot/casparcg/server/trunk@3213 362d55ac-95cf-4e76-9f9a-cbaa9c17b72d

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

index 0542265c1333e61c5374add8527ddc024580d7b6..a5616b89ab80e17c2b192344381fbb9abb78d61b 100644 (file)
@@ -465,7 +465,7 @@ std::wstring print_mode(size_t width, size_t 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::wpath(filename).extension());\r
index 3ce28f9935e7d3499974adc169124887bd4316d9..40a1cc2b29684f1af8fb3cfb20973e16f39988bf 100644 (file)
@@ -42,6 +42,7 @@ void init()
 {\r
        core::register_producer_factory(create_ct_producer);\r
        core::register_producer_factory(create_cg_producer);\r
+       core::register_producer_factory(create_swf_producer);\r
 }\r
 \r
 std::wstring get_cg_version()\r
index 41ab82d22a58631a7fbff2719f5d27b677a5d820..0322b56d438e2fe1fa2c1f3878a4d69e691dded1 100644 (file)
@@ -215,24 +215,36 @@ safe_ptr<cg_producer> get_default_cg_producer(const safe_ptr<core::video_channel
        return make_safe<cg_producer>(flash_producer);\r
 }\r
 \r
-safe_ptr<core::frame_producer> create_ct_producer(const safe_ptr<core::frame_factory> frame_factory, const std::vector<std::wstring>& params) \r
+safe_ptr<core::frame_producer> create_cg_producer_and_autoplay_file(\r
+               const safe_ptr<core::frame_factory>& frame_factory, \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::filesystem2::wpath path(filename);\r
        path = boost::filesystem2::complete(path);\r
-       filename = path.file_string();\r
+       auto filename2 = path.file_string();\r
 \r
        auto flash_producer = flash::create_producer(frame_factory, boost::assign::list_of<std::wstring>());    \r
        auto producer = make_safe<cg_producer>(flash_producer);\r
-       producer->add(0, filename, 1);\r
+       producer->add(0, filename2, 1);\r
 \r
        return producer;\r
 }\r
 \r
-safe_ptr<core::frame_producer> create_cg_producer(const safe_ptr<core::frame_factory> frame_factory, const std::vector<std::wstring>& params) \r
+safe_ptr<core::frame_producer> create_ct_producer(const safe_ptr<core::frame_factory>& frame_factory, const std::vector<std::wstring>& params) \r
+{\r
+       return create_cg_producer_and_autoplay_file(frame_factory, params, env::media_folder() + L"\\" + params[0] + L".ct");\r
+}\r
+\r
+safe_ptr<core::frame_producer> create_swf_producer(const safe_ptr<core::frame_factory>& frame_factory, const std::vector<std::wstring>& params) \r
+{\r
+       return create_cg_producer_and_autoplay_file(frame_factory, params, env::media_folder() + L"\\" + params[0] + L".swf");\r
+}\r
+\r
+safe_ptr<core::frame_producer> create_cg_producer(const safe_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
index 020d2493c1e5a206e63079d8a42df67ae87baa61..5abae049ff3976aee9b869cfc5b49d3b3e63e5f0 100644 (file)
@@ -66,7 +66,8 @@ private:
 };\r
 safe_ptr<cg_producer> get_default_cg_producer(const safe_ptr<core::video_channel>& video_channel, int layer_index = cg_producer::DEFAULT_LAYER);\r
 \r
-safe_ptr<core::frame_producer> create_ct_producer(const safe_ptr<core::frame_factory> frame_factory, const std::vector<std::wstring>& params);\r
-safe_ptr<core::frame_producer> create_cg_producer(const safe_ptr<core::frame_factory> frame_factory, const std::vector<std::wstring>& params);\r
+safe_ptr<core::frame_producer> create_ct_producer(const safe_ptr<core::frame_factory>& frame_factory, const std::vector<std::wstring>& params);\r
+safe_ptr<core::frame_producer> create_cg_producer(const safe_ptr<core::frame_factory>& frame_factory, const std::vector<std::wstring>& params);\r
+safe_ptr<core::frame_producer> create_swf_producer(const safe_ptr<core::frame_factory>& frame_factory, const std::vector<std::wstring>& params);\r
 \r
 }}
\ No newline at end of file