]> git.sesse.net Git - casparcg/commitdiff
2.1.0: Fully ported (apart from legacy protocol proect) to UTF8, instead of a big...
authorronag <ronag@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Tue, 6 Dec 2011 00:34:44 +0000 (00:34 +0000)
committerronag <ronag@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Tue, 6 Dec 2011 00:34:44 +0000 (00:34 +0000)
git-svn-id: https://casparcg.svn.sourceforge.net/svnroot/casparcg/server/branches/2.1.0@1800 362d55ac-95cf-4e76-9f9a-cbaa9c17b72d

112 files changed:
common/concurrency/com_context.h
common/concurrency/executor.h
common/diagnostics/graph.cpp
common/diagnostics/graph.h
common/env.cpp
common/env.h
common/gl/gl_check.cpp
common/log/log.cpp
common/log/log.h
common/os/windows/current_version.h
common/os/windows/system_info.h
common/utility/param.h
common/utility/string.cpp
common/utility/string.h
common/utility/tweener.cpp
common/utility/tweener.h
core/consumer/frame_consumer.cpp
core/consumer/frame_consumer.h
core/consumer/output.cpp
core/consumer/output.h
core/mixer/gpu/device_buffer.cpp
core/mixer/gpu/fence.cpp
core/mixer/gpu/host_buffer.cpp
core/mixer/gpu/ogl_device.cpp
core/mixer/gpu/ogl_device.h
core/mixer/image/blend_modes.cpp
core/mixer/image/blend_modes.h
core/mixer/image/image_kernel.cpp
core/mixer/image/image_mixer.cpp
core/mixer/image/shader/image_shader.cpp
core/mixer/mixer.cpp
core/mixer/mixer.h
core/producer/color/color_producer.cpp
core/producer/color/color_producer.h
core/producer/frame_producer.cpp
core/producer/frame_producer.h
core/producer/layer.cpp
core/producer/layer.h
core/producer/playlist/playlist_producer.cpp
core/producer/playlist/playlist_producer.h
core/producer/separated/separated_producer.cpp
core/producer/stage.cpp
core/producer/stage.h
core/producer/transition/transition_producer.cpp
core/producer/transition/transition_producer.h
core/video_channel.cpp
core/video_channel.h
core/video_format.cpp
core/video_format.h
modules/bluefish/bluefish.cpp
modules/bluefish/bluefish.h
modules/bluefish/consumer/bluefish_consumer.cpp
modules/bluefish/consumer/bluefish_consumer.h
modules/bluefish/util/blue_velvet.cpp
modules/bluefish/util/blue_velvet.h
modules/decklink/consumer/decklink_consumer.cpp
modules/decklink/consumer/decklink_consumer.h
modules/decklink/decklink.cpp
modules/decklink/decklink.h
modules/decklink/producer/decklink_producer.cpp
modules/decklink/producer/decklink_producer.h
modules/decklink/util/util.h
modules/ffmpeg/consumer/ffmpeg_consumer.cpp
modules/ffmpeg/consumer/ffmpeg_consumer.h
modules/ffmpeg/ffmpeg.cpp
modules/ffmpeg/ffmpeg.h
modules/ffmpeg/ffmpeg_error.h
modules/ffmpeg/producer/audio/audio_resampler.cpp
modules/ffmpeg/producer/ffmpeg_producer.cpp
modules/ffmpeg/producer/ffmpeg_producer.h
modules/ffmpeg/producer/filter/filter.cpp
modules/ffmpeg/producer/filter/filter.h
modules/ffmpeg/producer/input/input.cpp
modules/ffmpeg/producer/input/input.h
modules/ffmpeg/producer/muxer/display_mode.h
modules/ffmpeg/producer/muxer/frame_muxer.cpp
modules/ffmpeg/producer/muxer/frame_muxer.h
modules/ffmpeg/producer/util/util.cpp
modules/ffmpeg/producer/util/util.h
modules/flash/flash.cpp
modules/flash/flash.h
modules/flash/producer/FlashAxContainer.cpp
modules/flash/producer/cg_producer.cpp
modules/flash/producer/cg_producer.h
modules/flash/producer/flash_producer.cpp
modules/flash/producer/flash_producer.h
modules/image/consumer/image_consumer.cpp
modules/image/consumer/image_consumer.h
modules/image/image.cpp
modules/image/image.h
modules/image/producer/image_producer.cpp
modules/image/producer/image_producer.h
modules/image/producer/image_scroll_producer.cpp
modules/image/producer/image_scroll_producer.h
modules/image/util/image_loader.cpp
modules/image/util/image_loader.h
modules/oal/consumer/oal_consumer.cpp
modules/oal/consumer/oal_consumer.h
modules/oal/oal.cpp
modules/ogl/consumer/ogl_consumer.cpp
modules/ogl/consumer/ogl_consumer.h
modules/ogl/ogl.cpp
protocol/amcp/AMCPCommand.h
protocol/amcp/AMCPCommandQueue.cpp
protocol/amcp/AMCPCommandsImpl.cpp
protocol/amcp/AMCPProtocolStrategy.cpp
protocol/cii/CIICommandsImpl.cpp
protocol/cii/CIIProtocolStrategy.cpp
protocol/clk/CLKProtocolStrategy.cpp
protocol/util/AsyncEventServer.cpp
shell/main.cpp
shell/server.cpp

index 509c0afdbc7e2f0976807e78b537e31490844ee9..dfcb8775e1f2ea38f0b2af7c73f03ca98291281e 100644 (file)
@@ -43,7 +43,7 @@ class com_context : public executor
 {\r
        std::unique_ptr<T> instance_;\r
 public:\r
-       com_context(const std::wstring& name) : executor(name)\r
+       com_context(const std::string& name) : executor(name)\r
        {\r
                executor::begin_invoke([]\r
                {\r
@@ -59,7 +59,7 @@ public:
                        ::CoUninitialize();\r
                }).timed_wait(boost::posix_time::milliseconds(500)))\r
                {\r
-                       CASPAR_LOG(error) << L"[com_contex] Timer expired, deadlock detected and released, leaking resources.";\r
+                       CASPAR_LOG(error) << "[com_contex] Timer expired, deadlock detected and released, leaking resources.";\r
                }\r
        }\r
        \r
index c65bf760f8821cd771d91e69281a1d50c02d5722..f396b90b9ac66a2fc43d50ddb35cc140c38d8d35 100644 (file)
@@ -111,7 +111,7 @@ class executor : boost::noncopyable
 \r
 public:\r
                \r
-       explicit executor(const std::wstring& name) : name_(narrow(name)) // noexcept\r
+       explicit executor(const std::string& name) : name_((name)) // noexcept\r
        {\r
                is_running_ = true;\r
                thread_ = boost::thread([this]{run();});\r
index 3e40b4dcb26236685dec1be54f925029eb125661..c3e248a642203b35d47da043b0e65bdc24319535 100644 (file)
@@ -84,7 +84,7 @@ public:
        }\r
                                \r
 private:\r
-       context() : executor_(L"diagnostics")\r
+       context() : executor_("diagnostics")\r
        {\r
                executor_.set_priority_class(below_normal_priority_class);\r
        }\r
@@ -394,11 +394,6 @@ void graph::set_text(const std::string& value)
        });\r
 }\r
 \r
-void graph::set_text(const std::wstring& value)\r
-{\r
-       set_text(narrow(value));\r
-}\r
-\r
 void graph::update_value(const std::string& name, double value)\r
 {\r
        auto p = impl_;\r
@@ -455,10 +450,10 @@ void show_graphs(bool value)
 //     \r
 //struct line::implementation\r
 //{\r
-//     std::wstring name_;\r
+//     std::string name_;\r
 //     boost::circular_buffer<data> ticks_;\r
 //\r
-//     implementation(const std::wstring& name) \r
+//     implementation(const std::string& name) \r
 //             : name_(name)\r
 //             , ticks_(1024){}\r
 //     \r
@@ -476,25 +471,25 @@ void show_graphs(bool value)
 //};\r
 //\r
 //line::line(){}\r
-//line::line(const std::wstring& name) : impl_(new implementation(name)){}\r
-//std::wstring line::print() const {return impl_->name_;}\r
+//line::line(const std::string& name) : impl_(new implementation(name)){}\r
+//std::string line::print() const {return impl_->name_;}\r
 //void line::update_value(float value){impl_->update_value(value);}\r
 //void line::set_value(float value){impl_->set_value(value);}\r
 //boost::circular_buffer<data>& line::ticks() { return impl_->ticks_;}\r
 //\r
 //struct graph::implementation\r
 //{\r
-//     std::map<std::wstring, line> lines_;\r
+//     std::map<std::string, line> lines_;\r
 //     color                                            color_;\r
 //     printer                                          printer_;\r
 //\r
-//     implementation(const std::wstring& name) \r
+//     implementation(const std::string& name) \r
 //             : printer_([=]{return name;}){}\r
 //\r
 //     implementation(const printer& parent_printer) \r
 //             : printer_(parent_printer){}\r
 //     \r
-//     void update_value(const std::wstring& name, float value)\r
+//     void update_value(const std::string& name, float value)\r
 //     {\r
 //             auto it = lines_.find(name);\r
 //             if(it == lines_.end())\r
@@ -503,7 +498,7 @@ void show_graphs(bool value)
 //             it->second.update_value(value);\r
 //     }\r
 //\r
-//     void set_value(const std::wstring& name, float value)\r
+//     void set_value(const std::string& name, float value)\r
 //     {\r
 //             auto it = lines_.find(name);\r
 //             if(it == lines_.end())\r
@@ -512,12 +507,12 @@ void show_graphs(bool value)
 //             it->second.set_value(value);\r
 //     }\r
 //     \r
-//     void set_color(const std::wstring& name, color color)\r
+//     void set_color(const std::string& name, color color)\r
 //     {\r
 //             color_ = color;\r
 //     }\r
 //\r
-//     std::map<std::wstring, line>& get_lines()\r
+//     std::map<std::string, line>& get_lines()\r
 //     {\r
 //             return lines_;\r
 //     }\r
@@ -527,29 +522,29 @@ void show_graphs(bool value)
 //             return color_;\r
 //     }\r
 //\r
-//     std::wstring print() const\r
+//     std::string print() const\r
 //     {\r
-//             return printer_ ? printer_() : L"graph";\r
+//             return printer_ ? printer_() : "graph";\r
 //     }\r
 //};\r
 //     \r
-//graph::graph(const std::wstring& name) : impl_(new implementation(name)){}\r
+//graph::graph(const std::string& name) : impl_(new implementation(name)){}\r
 //graph::graph(const printer& parent_printer) : impl_(new implementation(parent_printer)){}\r
-//void graph::update_value(const std::wstring& name, float value){impl_->update_value(name, value);}\r
-//void graph::set_value(const std::wstring& name, float value){impl_->set_value(name, value);}\r
-//void graph::set_color(const std::wstring& name, color c){impl_->set_color(name, c);}\r
+//void graph::update_value(const std::string& name, float value){impl_->update_value(name, value);}\r
+//void graph::set_value(const std::string& name, float value){impl_->set_value(name, value);}\r
+//void graph::set_color(const std::string& name, color c){impl_->set_color(name, c);}\r
 //color graph::get_color() const {return impl_->get_color();}\r
-//std::wstring graph::print() const {return impl_->print();}\r
+//std::string graph::print() const {return impl_->print();}\r
 //\r
 //safe_ptr<graph> graph::clone() const \r
 //{\r
-//     safe_ptr<graph> clone(new graph(std::wstring(L"")));\r
+//     safe_ptr<graph> clone(new graph(std::string("")));\r
 //     clone->impl_->printer_ = impl_->printer_;\r
 //     clone->impl_->lines_ = impl_->lines_;\r
 //     clone->impl_->color_ = impl_->color_;   \r
 //}\r
 //\r
-//std::map<std::wstring, line>& graph::get_lines() {impl_->get_lines();}\r
+//std::map<std::string, line>& graph::get_lines() {impl_->get_lines();}\r
 //\r
 //std::vector<safe_ptr<graph>> g_graphs;\r
 //\r
index 5bdcda25a829d144350320f1a27cbe70c74b92fa..f3be78ce33962aa0128d17ec4e85d3812c72e6e8 100644 (file)
@@ -33,7 +33,7 @@
 \r
 namespace caspar {\r
                \r
-typedef std::function<std::wstring()> printer;\r
+typedef std::function<std::string()> printer;\r
        \r
 namespace diagnostics {\r
        \r
@@ -57,7 +57,6 @@ class graph
 public:\r
        graph();\r
        void set_text(const std::string& value);\r
-       void set_text(const std::wstring& value);\r
        void update_value(const std::string& name, double value);\r
        void set_value(const std::string& name, double value);\r
        void set_color(const std::string& name, color c);\r
@@ -83,11 +82,11 @@ void show_graphs(bool value);
 //     {\r
 //     public:\r
 //             line();\r
-//             line(const std::wstring& name);\r
-//             std::wstring print() const;\r
+//             line(const std::string& name);\r
+//             std::string print() const;\r
 //             void update_value(float value);\r
 //             void set_value(float value);\r
-//             void set_tag(const std::wstring& tag);\r
+//             void set_tag(const std::string& tag);\r
 //\r
 //             boost::circular_buffer<data>& ticks();\r
 //     private:\r
@@ -101,19 +100,19 @@ void show_graphs(bool value);
 //     class graph\r
 //     {\r
 //     public:\r
-//             graph(const std::wstring& name);\r
+//             graph(const std::string& name);\r
 //             graph(const printer& parent_printer);\r
 //\r
-//             void update_value(const std::wstring& name, float value);\r
-//             void set_value(const std::wstring& name, float value);\r
+//             void update_value(const std::string& name, float value);\r
+//             void set_value(const std::string& name, float value);\r
 //\r
-//             void set_guide(const std::wstring& name, float value);\r
-//             void set_color(const std::wstring& name, color c);\r
+//             void set_guide(const std::string& name, float value);\r
+//             void set_color(const std::string& name, color c);\r
 //\r
 //             color get_color() const;\r
-//             std::map<std::wstring, line>& get_lines();\r
+//             std::map<std::string, line>& get_lines();\r
 //\r
-//             std::wstring print() const;\r
+//             std::string print() const;\r
 //\r
 //             safe_ptr<graph> clone() const;\r
 //     private:\r
@@ -121,7 +120,7 @@ void show_graphs(bool value);
 //             std::shared_ptr<implementation> impl_;\r
 //     };\r
 //     \r
-//     static safe_ptr<graph> create_graph(const std::wstring& name);\r
+//     static safe_ptr<graph> create_graph(const std::string& name);\r
 //     static safe_ptr<graph> create_graph(const printer& parent_printer);\r
 //     static std::vector<safe_ptr<graph>> get_all_graphs();\r
 //}\r
index 3616397e46e0c04d97973dbf702479dbe059a862..5e619c0b8be4991c909f012298cb12ed279492f1 100644 (file)
 #include <iostream>\r
 \r
 namespace caspar { namespace env {\r
-\r
-using namespace boost::filesystem2;\r
-\r
-std::wstring media;\r
-std::wstring log;\r
-std::wstring ftemplate;\r
-std::wstring data;\r
-boost::property_tree::wptree pt;\r
+       \r
+std::string media;\r
+std::string log;\r
+std::string ftemplate;\r
+std::string data;\r
+boost::property_tree::ptree pt;\r
 \r
 void check_is_configured()\r
 {\r
@@ -52,59 +50,59 @@ void check_is_configured()
                BOOST_THROW_EXCEPTION(invalid_operation() << msg_info("Enviroment properties has not been configured"));\r
 }\r
 \r
-void configure(const std::wstring& filename)\r
+void configure(const std::string& filename)\r
 {\r
        try\r
        {\r
-               auto initialPath = boost::filesystem::initial_path<boost::filesystem2::wpath>().file_string();\r
+               auto initialPath = boost::filesystem::initial_path().file_string();\r
        \r
-               std::wifstream file(initialPath + L"\\" + filename);\r
+               std::ifstream file(initialPath + "\\" + filename);\r
                boost::property_tree::read_xml(file, pt, boost::property_tree::xml_parser::trim_whitespace | boost::property_tree::xml_parser::no_comments);\r
 \r
-               auto paths = pt.get_child(L"configuration.paths");\r
-               media = widen(paths.get(L"media-path", initialPath + L"\\media\\"));\r
-               log = widen(paths.get(L"log-path", initialPath + L"\\log\\"));\r
-               ftemplate = complete(wpath(widen(paths.get(L"template-path", initialPath + L"\\template\\")))).string();                \r
-               data = widen(paths.get(L"data-path", initialPath + L"\\data\\"));\r
+               auto paths = pt.get_child("configuration.paths");\r
+               media = paths.get("media-path", initialPath + "\\media\\");\r
+               log = paths.get("log-path", initialPath + "\\log\\");\r
+               ftemplate = boost::filesystem2::complete(paths.get("template-path", initialPath + "\\template\\")).string();            \r
+               data = paths.get("data-path", initialPath + "\\data\\");\r
        }\r
        catch(...)\r
        {\r
-               std::wcout << L" ### Invalid configuration file. ###";\r
+               std::wcout << " ### Invalid configuration file. ###";\r
                throw;\r
        }\r
 }\r
        \r
-const std::wstring& media_folder()\r
+const std::string& media_folder()\r
 {\r
        check_is_configured();\r
        return media;\r
 }\r
 \r
-const std::wstring& log_folder()\r
+const std::string& log_folder()\r
 {\r
        check_is_configured();\r
        return log;\r
 }\r
 \r
-const std::wstring& template_folder()\r
+const std::string& template_folder()\r
 {\r
        check_is_configured();\r
        return ftemplate;\r
 }\r
 \r
-const std::wstring& data_folder()\r
+const std::string& data_folder()\r
 {\r
        check_is_configured();\r
        return data;\r
 }\r
 \r
-const std::wstring& version()\r
+const std::string& version()\r
 {\r
-       static std::wstring ver = std::wstring(L"") + CASPAR_GEN + L"." + CASPAR_MAYOR + L"." + CASPAR_MINOR + L"." + CASPAR_REV + L" " + CASPAR_TAG;\r
+       static std::string ver = std::string("") + CASPAR_GEN + "." + CASPAR_MAYOR + "." + CASPAR_MINOR + "." + CASPAR_REV + " " + CASPAR_TAG;\r
        return ver;\r
 }\r
 \r
-const boost::property_tree::wptree& properties()\r
+const boost::property_tree::ptree& properties()\r
 {\r
        check_is_configured();\r
        return pt;\r
index 9a50b47abf08056911f20b2e4589db46d5ff27e0..48f69e97496fb21f88c9ecfd963cc05f4c404501 100644 (file)
 \r
 namespace caspar { namespace env {\r
 \r
-void configure(const std::wstring& filename);\r
+void configure(const std::string& filename);\r
 \r
-const std::wstring& media_folder();\r
-const std::wstring& log_folder();\r
-const std::wstring& template_folder();\r
-const std::wstring& data_folder();\r
-const std::wstring& version();\r
+const std::string& media_folder();\r
+const std::string& log_folder();\r
+const std::string& template_folder();\r
+const std::string& data_folder();\r
+const std::string& version();\r
 \r
-const boost::property_tree::wptree& properties();\r
+const boost::property_tree::ptree& properties();\r
 \r
 } }
\ No newline at end of file
index 8a5e745b0b3e179090f84e9445d65cd6c4cc590c..2c4767704914e13f035da79c8a1edf9cd5a82eeb 100644 (file)
@@ -44,7 +44,7 @@ void SMFL_GLCheckError(const std::string& expr, const std::string& file, unsigne
 \r
        for(GLenum ErrorCode = glGetError(); ErrorCode != GL_NO_ERROR; ErrorCode = glGetError())\r
        {\r
-               CASPAR_LOG(error) << "OpenGL Error: " << ErrorCode << L" " << glewGetErrorString(ErrorCode);\r
+               CASPAR_LOG(error) << "OpenGL Error: " << ErrorCode << " " << glewGetErrorString(ErrorCode);\r
                LastErrorCode = ErrorCode;\r
        }\r
 \r
index 645b6e5b5ff6d36da0e57e0713aa2faebfadc6fd..ae6352e18770c91113df61347079d9e86a8a7c6c 100644 (file)
 #include <boost/lambda/lambda.hpp>\r
 \r
 namespace caspar { namespace log {\r
-\r
-using namespace boost;\r
-\r
-void my_formatter(std::wostream& strm, boost::log::basic_record<wchar_t> const& rec)\r
+       \r
+void my_formatter(std::ostream& strm, boost::log::basic_record<char> const& rec)\r
 {\r
     namespace lambda = boost::lambda;\r
        \r
@@ -79,15 +77,15 @@ void my_formatter(std::wostream& strm, boost::log::basic_record<wchar_t> const&
        timeinfo = localtime ( &rawtime );\r
        char buffer [80];\r
        strftime (buffer,80, "%c", timeinfo);\r
-       strm << L"[" << buffer << L"] ";\r
+       strm << "[" << buffer << "] ";\r
                \r
     boost::log::attributes::current_thread_id::held_type thread_id;\r
-    if(boost::log::extract<boost::log::attributes::current_thread_id::held_type>(L"ThreadID", rec.attribute_values(), lambda::var(thread_id) = lambda::_1))\r
-        strm << L"[" << thread_id << L"] ";\r
+    if(boost::log::extract<boost::log::attributes::current_thread_id::held_type>("ThreadID", rec.attribute_values(), lambda::var(thread_id) = lambda::_1))\r
+        strm << "[" << thread_id << "] ";\r
 \r
     severity_level severity;\r
-    if(boost::log::extract<severity_level>(boost::log::sources::aux::severity_attribute_name<wchar_t>::get(), rec.attribute_values(), lambda::var(severity) = lambda::_1))\r
-        strm << L"[" << severity << L"] ";\r
+    if(boost::log::extract<severity_level>(boost::log::sources::aux::severity_attribute_name<char>::get(), rec.attribute_values(), lambda::var(severity) = lambda::_1))\r
+        strm << "[" << severity << "] ";\r
 \r
     strm << rec.message();\r
 }\r
@@ -96,15 +94,15 @@ namespace internal{
        \r
 void init()\r
 {      \r
-       boost::log::add_common_attributes<wchar_t>();\r
-       typedef boost::log::aux::add_common_attributes_constants<wchar_t> traits_t;\r
+       boost::log::add_common_attributes<char>();\r
+       typedef boost::log::aux::add_common_attributes_constants<char> traits_t;\r
 \r
-       typedef boost::log::sinks::synchronous_sink<boost::log::sinks::wtext_file_backend> file_sink_type;\r
+       typedef boost::log::sinks::synchronous_sink<boost::log::sinks::text_file_backend> file_sink_type;\r
 \r
-       typedef boost::log::sinks::asynchronous_sink<boost::log::sinks::wtext_ostream_backend> stream_sink_type;\r
+       typedef boost::log::sinks::asynchronous_sink<boost::log::sinks::text_ostream_backend> stream_sink_type;\r
 \r
-       auto stream_backend = boost::make_shared<boost::log::sinks::wtext_ostream_backend>();\r
-       stream_backend->add_stream(boost::shared_ptr<std::wostream>(&std::wcout, boost::log::empty_deleter()));\r
+       auto stream_backend = boost::make_shared<boost::log::sinks::text_ostream_backend>();\r
+       stream_backend->add_stream(boost::shared_ptr<std::ostream>(&std::cout, boost::log::empty_deleter()));\r
        stream_backend->auto_flush(true);\r
 \r
        auto stream_sink = boost::make_shared<stream_sink_type>(stream_backend);\r
@@ -117,17 +115,17 @@ void init()
 \r
        stream_sink->locked_backend()->set_formatter(&my_formatter);\r
 \r
-       boost::log::wcore::get()->add_sink(stream_sink);\r
+       boost::log::core::get()->add_sink(stream_sink);\r
 }\r
 \r
 }\r
 \r
-void add_file_sink(const std::wstring& folder)\r
+void add_file_sink(const std::string& folder)\r
 {      \r
-       boost::log::add_common_attributes<wchar_t>();\r
-       typedef boost::log::aux::add_common_attributes_constants<wchar_t> traits_t;\r
+       boost::log::add_common_attributes<char>();\r
+       typedef boost::log::aux::add_common_attributes_constants<char> traits_t;\r
 \r
-       typedef boost::log::sinks::synchronous_sink<boost::log::sinks::wtext_file_backend> file_sink_type;\r
+       typedef boost::log::sinks::synchronous_sink<boost::log::sinks::text_file_backend> file_sink_type;\r
 \r
        try\r
        {\r
@@ -135,7 +133,7 @@ void add_file_sink(const std::wstring& folder)
                        BOOST_THROW_EXCEPTION(directory_not_found());\r
 \r
                auto file_sink = boost::make_shared<file_sink_type>(\r
-                       boost::log::keywords::file_name = (folder + L"caspar_%Y-%m-%d.log"),\r
+                       boost::log::keywords::file_name = (folder + "caspar_%Y-%m-%d.log"),\r
                        boost::log::keywords::time_based_rotation = boost::log::sinks::file::rotation_at_time_point(0, 0, 0),\r
                        boost::log::keywords::auto_flush = true,\r
                        boost::log::keywords::open_mode = std::ios::app\r
@@ -148,28 +146,28 @@ void add_file_sink(const std::wstring& folder)
 //#else\r
 //             file_sink->set_filter(boost::log::filters::attr<severity_level>(boost::log::sources::aux::severity_attribute_name<wchar_t>::get()) >= debug);\r
 //#endif\r
-               boost::log::wcore::get()->add_sink(file_sink);\r
+               boost::log::core::get()->add_sink(file_sink);\r
        }\r
        catch(...)\r
        {\r
-               std::wcerr << L"Failed to Setup File Logging Sink" << std::endl << std::endl;\r
+               std::cerr << L"Failed to Setup File Logging Sink" << std::endl << std::endl;\r
        }\r
 }\r
 \r
-void set_log_level(const std::wstring& lvl)\r
+void set_log_level(const std::string& lvl)\r
 {      \r
-       if(boost::iequals(lvl, L"trace"))\r
-               boost::log::wcore::get()->set_filter(boost::log::filters::attr<severity_level>(boost::log::sources::aux::severity_attribute_name<wchar_t>::get()) >= trace);\r
-       else if(boost::iequals(lvl, L"debug"))\r
-               boost::log::wcore::get()->set_filter(boost::log::filters::attr<severity_level>(boost::log::sources::aux::severity_attribute_name<wchar_t>::get()) >= debug);\r
-       else if(boost::iequals(lvl, L"info"))\r
-               boost::log::wcore::get()->set_filter(boost::log::filters::attr<severity_level>(boost::log::sources::aux::severity_attribute_name<wchar_t>::get()) >= info);\r
-       else if(boost::iequals(lvl, L"warning"))\r
-               boost::log::wcore::get()->set_filter(boost::log::filters::attr<severity_level>(boost::log::sources::aux::severity_attribute_name<wchar_t>::get()) >= warning);\r
-       else if(boost::iequals(lvl, L"error"))\r
-               boost::log::wcore::get()->set_filter(boost::log::filters::attr<severity_level>(boost::log::sources::aux::severity_attribute_name<wchar_t>::get()) >= error);\r
-       else if(boost::iequals(lvl, L"fatal"))\r
-               boost::log::wcore::get()->set_filter(boost::log::filters::attr<severity_level>(boost::log::sources::aux::severity_attribute_name<wchar_t>::get()) >= fatal);\r
+       if(iequals(lvl, "trace"))\r
+               boost::log::core::get()->set_filter(boost::log::filters::attr<severity_level>(boost::log::sources::aux::severity_attribute_name<char>::get()) >= trace);\r
+       else if(iequals(lvl, "debug"))\r
+               boost::log::core::get()->set_filter(boost::log::filters::attr<severity_level>(boost::log::sources::aux::severity_attribute_name<char>::get()) >= debug);\r
+       else if(iequals(lvl, "info"))\r
+               boost::log::core::get()->set_filter(boost::log::filters::attr<severity_level>(boost::log::sources::aux::severity_attribute_name<char>::get()) >= info);\r
+       else if(iequals(lvl, "warning"))\r
+               boost::log::core::get()->set_filter(boost::log::filters::attr<severity_level>(boost::log::sources::aux::severity_attribute_name<char>::get()) >= warning);\r
+       else if(iequals(lvl, "error"))\r
+               boost::log::core::get()->set_filter(boost::log::filters::attr<severity_level>(boost::log::sources::aux::severity_attribute_name<char>::get()) >= error);\r
+       else if(iequals(lvl, "fatal"))\r
+               boost::log::core::get()->set_filter(boost::log::filters::attr<severity_level>(boost::log::sources::aux::severity_attribute_name<char>::get()) >= fatal);\r
 }\r
 \r
 }}
\ No newline at end of file
index a850f793b8764c93a36560f2e42e4100c153f981..3651931b249c709d3e93000e69b049bb1e8a7e0b 100644 (file)
@@ -42,7 +42,7 @@ namespace internal{
 void init();\r
 }\r
 \r
-void add_file_sink(const std::wstring& folder);\r
+void add_file_sink(const std::string& folder);\r
 \r
 enum severity_level\r
 {\r
@@ -76,7 +76,7 @@ inline std::basic_ostream< CharT, TraitsT >& operator<< (
        return strm;\r
 }\r
 \r
-typedef boost::log::sources::wseverity_logger_mt<severity_level> caspar_logger;\r
+typedef boost::log::sources::severity_logger_mt<severity_level> caspar_logger;\r
 \r
 BOOST_LOG_DECLARE_GLOBAL_LOGGER_INIT(logger, caspar_logger)\r
 {\r
@@ -93,7 +93,7 @@ BOOST_LOG_DECLARE_GLOBAL_LOGGER_INIT(logger, caspar_logger)
        {CASPAR_LOG(error) << boost::current_exception_diagnostic_information().c_str();}\\r
        catch(...){}\r
 \r
-void set_log_level(const std::wstring& lvl);\r
+void set_log_level(const std::string& lvl);\r
 \r
 }}\r
 \r
index 174bffa0aaa9fbb9dc4dd3d814d6991301e9b1c6..0fb9223b49e4da6bf765babdf3faad0aa8fabf02 100644 (file)
 #define NOMINMAX\r
 #define WIN32_LEAN_AND_MEAN\r
 \r
+#include "../../utility/string.h"\r
+\r
 #include <windows.h>\r
 \r
 #include <string>\r
 \r
 namespace caspar {\r
 \r
-static std::wstring get_win_product_name()\r
+static std::string get_win_product_name()\r
 {\r
-       std::wstring result = L"Unknown Windows Product Name.";\r
+       std::string result = "Unknown Windows Product Name.";\r
        HKEY hkey; \r
        DWORD dwType, dwSize;\r
        if(RegOpenKeyEx(HKEY_LOCAL_MACHINE, TEXT("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion"), 0, KEY_QUERY_VALUE, &hkey) == ERROR_SUCCESS)\r
@@ -43,16 +45,16 @@ static std::wstring get_win_product_name()
                dwSize = sizeof(p_name_str);\r
 \r
                if(RegQueryValueEx(hkey, TEXT("ProductName"), NULL, &dwType, (PBYTE)&p_name_str, &dwSize) == ERROR_SUCCESS)             \r
-                       result = p_name_str;            \r
+                       result = u8(p_name_str);                \r
                 \r
                RegCloseKey(hkey);\r
        }\r
        return result;\r
 }\r
 \r
-static std::wstring get_win_sp_version()\r
+static std::string get_win_sp_version()\r
 {\r
-       std::wstring result =  L"";\r
+       std::string result =  "";\r
        HKEY hkey; \r
        DWORD dwType, dwSize;\r
        if(RegOpenKeyEx(HKEY_LOCAL_MACHINE, TEXT("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion"), 0, KEY_QUERY_VALUE, &hkey) == ERROR_SUCCESS)\r
@@ -63,7 +65,7 @@ static std::wstring get_win_sp_version()
                dwSize = sizeof(csd_ver_str);\r
 \r
                if(RegQueryValueEx(hkey, TEXT("CSDVersion"), NULL, &dwType, (PBYTE)&csd_ver_str, &dwSize) == ERROR_SUCCESS)             \r
-                       result = csd_ver_str;\r
+                       result = u8(csd_ver_str);\r
                 \r
                RegCloseKey(hkey);\r
        }\r
index a6d58eb4577b9dabcec5494208d466cbb8a3cf4a..5f72fb7408bb51eff6a18d7f0df51fc1eb6abc97 100644 (file)
@@ -24,6 +24,8 @@
 #define NOMINMAX\r
 #define WIN32_LEAN_AND_MEAN\r
 \r
+#include "../../utility/string.h"\r
+\r
 #include <windows.h>\r
 \r
 #include <string>\r
@@ -31,9 +33,9 @@
 \r
 namespace caspar {\r
        \r
-static std::wstring get_cpu_info()\r
+static std::string get_cpu_info()\r
 {\r
-       std::wstring cpu_name = L"Unknown CPU";\r
+       std::string cpu_name = "Unknown CPU";\r
        HKEY hkey; \r
        DWORD dwType, dwSize;\r
        if(RegOpenKeyEx(HKEY_LOCAL_MACHINE, TEXT("HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0"), 0, KEY_QUERY_VALUE, &hkey) == ERROR_SUCCESS)\r
@@ -44,7 +46,7 @@ static std::wstring get_cpu_info()
                dwSize = sizeof(p_name_str);\r
 \r
                if(RegQueryValueEx(hkey, TEXT("ProcessorNameString"), NULL, &dwType, (PBYTE)&p_name_str, &dwSize) == ERROR_SUCCESS)             \r
-                       cpu_name = p_name_str;          \r
+                       cpu_name = u8(p_name_str);              \r
                 \r
                RegCloseKey(hkey);\r
        }\r
@@ -53,16 +55,16 @@ static std::wstring get_cpu_info()
        SYSTEM_INFO sysinfo;\r
        GetSystemInfo(&sysinfo);\r
 \r
-       std::wstringstream s;\r
+       std::stringstream s;\r
 \r
-       s << cpu_name << L" Physical Threads: " << sysinfo.dwNumberOfProcessors;\r
+       s << cpu_name << " Physical Threads: " << sysinfo.dwNumberOfProcessors;\r
 \r
        return s.str();\r
 }\r
 \r
-static std::wstring get_system_product_name()\r
+static std::string get_system_product_name()\r
 {\r
-       std::wstring system_product_name = L"Unknown System";\r
+       std::string system_product_name = "Unknown System";\r
        HKEY hkey; \r
        DWORD dwType, dwSize;\r
        if(RegOpenKeyEx(HKEY_LOCAL_MACHINE, TEXT("HARDWARE\\DESCRIPTION\\System\\BIOS"), 0, KEY_QUERY_VALUE, &hkey) == ERROR_SUCCESS)\r
@@ -73,7 +75,7 @@ static std::wstring get_system_product_name()
                dwSize = sizeof(p_name_str);\r
 \r
                if(RegQueryValueEx(hkey, TEXT("SystemProductName"), NULL, &dwType, (PBYTE)&p_name_str, &dwSize) == ERROR_SUCCESS)               \r
-                       system_product_name = p_name_str;               \r
+                       system_product_name = u8(p_name_str);           \r
                 \r
                RegCloseKey(hkey);\r
        }\r
index 94ec4923ccaea9f8dfaf68bbcc0758f4b5a327b4..c9953bbbe1bd7291f495bee91fd62fdc5f4482e8 100644 (file)
@@ -8,7 +8,7 @@
 namespace caspar {\r
                \r
 template<typename T, typename C>\r
-typename std::enable_if<!std::is_convertible<T, std::wstring>::value, typename std::decay<T>::type>::type get_param(const std::wstring& name, C&& params, T fail_value = T())\r
+typename std::enable_if<!std::is_convertible<T, std::string>::value, typename std::decay<T>::type>::type get_param(const std::string& name, C&& params, T fail_value = T())\r
 {      \r
        auto it = std::find(std::begin(params), std::end(params), name);\r
        if(it == params.end() || ++it == params.end())  \r
@@ -25,7 +25,7 @@ typename std::enable_if<!std::is_convertible<T, std::wstring>::value, typename s
 }\r
 \r
 template<typename C>\r
-std::wstring get_param(const std::wstring& name, C&& params, const std::wstring& fail_value = L"")\r
+std::string get_param(const std::string& name, C&& params, const std::string& fail_value = "")\r
 {      \r
        auto it = std::find(std::begin(params), std::end(params), name);\r
        if(it == params.end() || ++it == params.end())  \r
index 76954b89b7c5c056c1fc6b23fdc752f5aa9434f3..57c2cfbedc5a6bb260c13a5c000a0c5fe91f21da 100644 (file)
 \r
 namespace caspar {\r
        \r
-std::wstring widen(const std::string& str)\r
+std::wstring u16(const std::string& str)\r
 {\r
        return utf8util::UTF16FromUTF8(str);//std::wstring(str.begin(), str.end());\r
 }\r
+          \r
+std::string u8(const std::wstring& str)\r
+{\r
+       return utf8util::UTF8FromUTF16(str);//std::string(str.begin(), str.end());\r
+}\r
+\r
+std::wstring u8_u16(const std::string& str)\r
+{\r
+       return u16(str);\r
+}\r
 \r
-std::wstring widen(const std::wstring& str)\r
+std::wstring u16(const std::wstring& str)\r
 {\r
        return str;\r
 }\r
-          \r
-std::string narrow(const std::wstring& str)\r
+\r
+std::string u16_u8(const std::wstring& str)\r
 {\r
-       return utf8util::UTF8FromUTF16(str);//std::string(str.begin(), str.end());\r
+       return u8(str);\r
 }\r
-          \r
-std::string narrow(const std::string& str)\r
+\r
+std::string u8(const std::string& str)\r
 {\r
-       return str ;\r
+       return str;\r
 }\r
 \r
+         \r
 }
\ No newline at end of file
index a7aee7a8195d7f90f31a067defe26b91deedb16c..af004aa373386594f8910c5520da8d01584b569a 100644 (file)
 \r
 #include <string>\r
 #include <boost/lexical_cast.hpp>\r
+#include <boost/algorithm/string.hpp>\r
           \r
 namespace caspar {\r
 \r
-std::wstring widen(const std::string& str);\r
-std::wstring widen(const std::wstring& str);\r
-std::string narrow(const std::wstring& str);      \r
-std::string narrow(const std::string& str);\r
+std::wstring u16(const std::string& str);\r
+std::wstring u8_u16(const std::string& str);\r
+std::wstring u16(const std::wstring& str);\r
+\r
+std::string u16_u8(const std::wstring& str);\r
+std::string u8(const std::wstring& str);\r
+std::string u8(const std::string& str);        \r
+\r
+namespace detail\r
+{\r
+       template<typename T>\r
+       struct convert_utf_string\r
+       {\r
+               std::wstring operator()(const std::wstring& str)\r
+               {\r
+                       return u16(str);\r
+               }\r
+       };\r
+\r
+       template<>\r
+       struct convert_utf_string<std::string>\r
+       {\r
+               std::string operator()(const std::wstring& str)\r
+               {\r
+                       return u8(str);\r
+               }\r
+       };\r
+};\r
+\r
+template<typename T1, typename T2>\r
+bool iequals(const T1& lhs, const T2& rhs)\r
+{\r
+       return boost::iequals(u16(lhs), u16(rhs));\r
+}\r
+\r
+template<typename T>\r
+T to_upper_copy(const T& str)\r
+{\r
+       return detail::convert_utf_string<T>()(boost::to_upper_copy(u16(str)));\r
+}\r
+\r
+template<typename T>\r
+T to_lower_copy(const T& str)\r
+{\r
+       return detail::convert_utf_string<T>()(boost::to_lower_copy(u16(str)));\r
+}\r
+\r
+template<typename T>\r
+void to_upper(T& str)\r
+{\r
+       str = detail::convert_utf_string<T>()(boost::to_upper_copy(u16(str)));\r
+}\r
+\r
+template<typename T>\r
+void to_lower(T& str)\r
+{\r
+       str = detail::convert_utf_string<T>()(boost::to_lower_copy(u16(str)));\r
+}\r
+\r
+template <typename T>\r
+inline T lexical_cast_or_default(const std::wstring& str, T fail_value = T())\r
+{\r
+       try\r
+       {\r
+               return boost::lexical_cast<T>(str);\r
+       }\r
+       catch(boost::bad_lexical_cast&)\r
+       {\r
+               return fail_value;\r
+       }\r
+}\r
 \r
 template <typename T>\r
-inline T lexical_cast_or_default(const std::wstring str, T fail_value = T())\r
+inline T lexical_cast_or_default(const std::string& str, T fail_value = T())\r
 {\r
        try\r
        {\r
index 0cff3c10d9ac77aa1e6fd9932aa7fbf1ee21ac9e..1b1339e65833bf5e5ba42fd5ffb64189b0a1ad7b 100644 (file)
@@ -377,17 +377,17 @@ double ease_out_in_bounce (double t, double b, double c, double d, const std::ve
        return ease_in_bounce((t*2)-d, b+c/2, c/2, d, params);\r
 }\r
 \r
-tweener_t get_tweener(std::wstring name)\r
+tweener_t get_tweener(std::string name)\r
 {\r
        std::transform(name.begin(), name.end(), name.begin(), std::tolower);\r
 \r
-       if(name == L"linear")\r
+       if(name == "linear")\r
                return [](double t, double b, double c, double d){return ease_none(t, b, c, d, std::vector<double>());};\r
        \r
        std::vector<double> params;\r
        \r
-       static const boost::wregex expr(L"(?<NAME>\\w*)(:(?<V0>\\d+\\.?\\d?))?(:(?<V1>\\d+\\.?\\d?))?"); // boost::regex has no repeated captures?\r
-       boost::wsmatch what;\r
+       static const boost::regex expr("(?<NAME>\\w*)(:(?<V0>\\d+\\.?\\d?))?(:(?<V1>\\d+\\.?\\d?))?"); // boost::regex has no repeated captures?\r
+       boost::smatch what;\r
        if(boost::regex_match(name, what, expr))\r
        {\r
                name = what["NAME"].str();\r
@@ -398,54 +398,54 @@ tweener_t get_tweener(std::wstring name)
        }\r
                \r
        typedef std::function<double(double, double, double, double, const std::vector<double>&)> tween_t;      \r
-       static const std::unordered_map<std::wstring, tween_t> tweens = boost::assign::map_list_of      \r
-               (L"",                                   ease_none                  )    \r
-               (L"linear",                             ease_none                  )    \r
-               (L"easenone",                   ease_none                  )\r
-               (L"easeinquad",                 ease_in_quad       )\r
-               (L"easeoutquad",                ease_out_quad      )\r
-               (L"easeinoutquad",              ease_in_out_quad   )\r
-               (L"easeoutinquad",              ease_out_in_quad   )\r
-               (L"easeincubic",                ease_in_cubic      )\r
-               (L"easeoutcubic",               ease_out_cubic     )\r
-               (L"easeinoutcubic",             ease_in_out_cubic  )\r
-               (L"easeoutincubic",             ease_out_in_cubic  )\r
-               (L"easeinquart",                ease_in_quart      )\r
-               (L"easeoutquart",               ease_out_quart     )\r
-               (L"easeinoutquart",             ease_in_out_quart  )\r
-               (L"easeoutinquart",             ease_out_in_quart  )\r
-               (L"easeinquint",                ease_in_quint      )\r
-               (L"easeoutquint",               ease_out_quint     )\r
-               (L"easeinoutquint",             ease_in_out_quint  )\r
-               (L"easeoutinquint",             ease_out_in_quint  )\r
-               (L"easeinsine",                 ease_in_sine       )\r
-               (L"easeoutsine",                ease_out_sine      )\r
-               (L"easeinoutsine",              ease_in_out_sine   )\r
-               (L"easeoutinsine",              ease_out_in_sine   )\r
-               (L"easeinexpo",                 ease_in_expo       )\r
-               (L"easeoutexpo",                ease_out_expo      )\r
-               (L"easeinoutexpo",              ease_in_out_expo   )\r
-               (L"easeoutinexpo",              ease_out_in_expo   )\r
-               (L"easeincirc",                 ease_in_circ       )\r
-               (L"easeoutcirc",                ease_out_circ      )\r
-               (L"easeinoutcirc",              ease_in_out_circ   )\r
-               (L"easeoutincirc",              ease_out_in_circ   )\r
-               (L"easeinelastic",              ease_in_elastic    )\r
-               (L"easeoutelastic",             ease_out_elastic   )\r
-               (L"easeinoutelastic",   ease_in_out_elastic)\r
-               (L"easeoutinelastic",   ease_out_in_elastic)\r
-               (L"easeinback",                 ease_in_back       )\r
-               (L"easeoutback",                ease_out_back      )\r
-               (L"easeinoutback",              ease_in_out_back   )\r
-               (L"easeoutintback",             ease_out_int_back  )\r
-               (L"easeoutbounce",              ease_out_bounce    )\r
-               (L"easeinbounce",               ease_in_bounce     )\r
-               (L"easeinoutbounce",    ease_in_out_bounce )\r
-               (L"easeoutinbounce",    ease_out_in_bounce );\r
+       static const std::unordered_map<std::string, tween_t> tweens = boost::assign::map_list_of       \r
+               ("",                                    ease_none                  )    \r
+               ("linear",                              ease_none                  )    \r
+               ("easenone",                    ease_none                  )\r
+               ("easeinquad",                  ease_in_quad       )\r
+               ("easeoutquad",         ease_out_quad      )\r
+               ("easeinoutquad",               ease_in_out_quad   )\r
+               ("easeoutinquad",               ease_out_in_quad   )\r
+               ("easeincubic",         ease_in_cubic      )\r
+               ("easeoutcubic",                ease_out_cubic     )\r
+               ("easeinoutcubic",              ease_in_out_cubic  )\r
+               ("easeoutincubic",              ease_out_in_cubic  )\r
+               ("easeinquart",                 ease_in_quart      )\r
+               ("easeoutquart",                ease_out_quart     )\r
+               ("easeinoutquart",              ease_in_out_quart  )\r
+               ("easeoutinquart",              ease_out_in_quart  )\r
+               ("easeinquint",         ease_in_quint      )\r
+               ("easeoutquint",                ease_out_quint     )\r
+               ("easeinoutquint",              ease_in_out_quint  )\r
+               ("easeoutinquint",              ease_out_in_quint  )\r
+               ("easeinsine",                  ease_in_sine       )\r
+               ("easeoutsine",         ease_out_sine      )\r
+               ("easeinoutsine",               ease_in_out_sine   )\r
+               ("easeoutinsine",               ease_out_in_sine   )\r
+               ("easeinexpo",                  ease_in_expo       )\r
+               ("easeoutexpo",         ease_out_expo      )\r
+               ("easeinoutexpo",               ease_in_out_expo   )\r
+               ("easeoutinexpo",               ease_out_in_expo   )\r
+               ("easeincirc",                  ease_in_circ       )\r
+               ("easeoutcirc",         ease_out_circ      )\r
+               ("easeinoutcirc",               ease_in_out_circ   )\r
+               ("easeoutincirc",               ease_out_in_circ   )\r
+               ("easeinelastic",               ease_in_elastic    )\r
+               ("easeoutelastic",              ease_out_elastic   )\r
+               ("easeinoutelastic",    ease_in_out_elastic)\r
+               ("easeoutinelastic",    ease_out_in_elastic)\r
+               ("easeinback",                  ease_in_back       )\r
+               ("easeoutback",         ease_out_back      )\r
+               ("easeinoutback",               ease_in_out_back   )\r
+               ("easeoutintback",              ease_out_int_back  )\r
+               ("easeoutbounce",               ease_out_bounce    )\r
+               ("easeinbounce",                ease_in_bounce     )\r
+               ("easeinoutbounce",     ease_in_out_bounce )\r
+               ("easeoutinbounce",     ease_out_in_bounce );\r
 \r
        auto it = tweens.find(name);\r
        if(it == tweens.end())\r
-               it = tweens.find(L"linear");\r
+               it = tweens.find("linear");\r
        \r
        return [=](double t, double b, double c, double d)\r
        {\r
index 51ec8368942dc38b225a4147f419edec6834616f..842fd6f79df4a769ed13a349ed91c96f6f0938f5 100644 (file)
@@ -26,6 +26,6 @@
 namespace caspar {\r
 \r
 typedef std::function<double(double, double, double, double)> tweener_t;\r
-tweener_t get_tweener(std::wstring name = L"linear");\r
+tweener_t get_tweener(std::string name = "linear");\r
 \r
 }
\ No newline at end of file
index 7ebb91818a29a4eb04203b7d4d84b4cf7637f483..c9e2ce330f776d995386bd79e1839e053ccab444 100644 (file)
@@ -40,7 +40,7 @@ void register_consumer_factory(const consumer_factory_t& factory)
        g_factories.push_back(factory);\r
 }\r
 \r
-safe_ptr<core::frame_consumer> create_consumer(const std::vector<std::wstring>& params)\r
+safe_ptr<core::frame_consumer> create_consumer(const std::vector<std::string>& params)\r
 {\r
        if(params.empty())\r
                BOOST_THROW_EXCEPTION(invalid_argument() << arg_name_info("params") << arg_value_info(""));\r
@@ -92,7 +92,7 @@ public:
                if(!boost::range::equal(sync_buffer_, audio_cadence_))\r
                {\r
                        synced_ = false;\r
-                       CASPAR_LOG(trace) << L"[cadence_guard] Audio cadence unsynced. Skipping frame.";\r
+                       CASPAR_LOG(trace) << "[cadence_guard] Audio cadence unsynced. Skipping frame.";\r
                        return true;\r
                }\r
                else if(!synced_)\r
@@ -107,12 +107,12 @@ public:
                return consumer_->send(frame);\r
        }\r
 \r
-       virtual std::wstring print() const override\r
+       virtual std::string print() const override\r
        {\r
                return consumer_->print();\r
        }\r
 \r
-       virtual boost::property_tree::wptree info() const override\r
+       virtual boost::property_tree::ptree info() const override\r
        {\r
                return consumer_->info();\r
        }\r
@@ -144,14 +144,14 @@ const safe_ptr<frame_consumer>& frame_consumer::empty()
        {\r
                virtual bool send(const safe_ptr<read_frame>&) override {return false;}\r
                virtual void initialize(const video_format_desc&, int) override{}\r
-               virtual std::wstring print() const override {return L"empty";}\r
+               virtual std::string print() const override {return "empty";}\r
                virtual bool has_synchronization_clock() const override {return false;}\r
                virtual size_t buffer_depth() const override {return 0;};\r
                virtual int index() const{return -1;}\r
-               virtual boost::property_tree::wptree info() const override\r
+               virtual boost::property_tree::ptree info() const override\r
                {\r
-                       boost::property_tree::wptree info;\r
-                       info.add(L"type", L"empty-consumer");\r
+                       boost::property_tree::ptree info;\r
+                       info.add("type", "empty-consumer");\r
                        return info;\r
                }\r
        };\r
index 531dee8edffe44822188e3087e173eb105c913bb..fd4ac355bc55218a009f2785aa03e40558176092 100644 (file)
@@ -41,8 +41,8 @@ struct frame_consumer : boost::noncopyable
        \r
        virtual bool send(const safe_ptr<read_frame>& frame) = 0;\r
        virtual void initialize(const video_format_desc& format_desc, int channel_index) = 0;\r
-       virtual std::wstring print() const = 0;\r
-       virtual boost::property_tree::wptree info() const = 0;\r
+       virtual std::string print() const = 0;\r
+       virtual boost::property_tree::ptree info() const = 0;\r
        virtual bool has_synchronization_clock() const {return true;}\r
        virtual size_t buffer_depth() const = 0;\r
        virtual int index() const = 0;\r
@@ -52,9 +52,9 @@ struct frame_consumer : boost::noncopyable
 \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
+typedef std::function<safe_ptr<core::frame_consumer>(const std::vector<std::string>&)> consumer_factory_t;\r
 \r
 void register_consumer_factory(const consumer_factory_t& factory);\r
-safe_ptr<core::frame_consumer> create_consumer(const std::vector<std::wstring>& params);\r
+safe_ptr<core::frame_consumer> create_consumer(const std::vector<std::string>& params);\r
 \r
 }}
\ No newline at end of file
index 4b5bcdab071bf9c3726d72ea1e77c2caba2292be..59f279bcdb44cbe3ab86e78658953314e5eda1c7 100644 (file)
@@ -66,7 +66,7 @@ public:
                : channel_index_(channel_index)\r
                , graph_(graph)\r
                , format_desc_(format_desc)\r
-               , executor_(L"output")\r
+               , executor_("output")\r
        {\r
                graph_->set_color("consume-time", diagnostics::color(1.0f, 0.4f, 0.0f));\r
        }       \r
@@ -81,7 +81,7 @@ public:
                executor_.invoke([&]\r
                {\r
                        consumers_.insert(std::make_pair(index, consumer));\r
-                       CASPAR_LOG(info) << print() << L" " << consumer->print() << L" Added.";\r
+                       CASPAR_LOG(info) << print() << " " << consumer->print() << " Added.";\r
                }, high_priority);\r
        }\r
 \r
@@ -109,7 +109,7 @@ public:
                {\r
                        auto str = old_consumer->print();\r
                        old_consumer.reset();\r
-                       CASPAR_LOG(info) << print() << L" " << str << L" Removed.";\r
+                       CASPAR_LOG(info) << print() << " " << str << " Removed.";\r
                }\r
        }\r
 \r
@@ -133,7 +133,7 @@ public:
                                catch(...)\r
                                {\r
                                        CASPAR_LOG_CURRENT_EXCEPTION();\r
-                                       CASPAR_LOG(info) << print() << L" " << it->second->print() << L" Removed.";\r
+                                       CASPAR_LOG(info) << print() << " " << it->second->print() << " Removed.";\r
                                        consumers_.erase(it++);\r
                                }\r
                        }\r
@@ -200,7 +200,7 @@ public:
                                                        ++it;\r
                                                else\r
                                                {\r
-                                                       CASPAR_LOG(info) << print() << L" " << it->second->print() << L" Removed.";\r
+                                                       CASPAR_LOG(info) << print() << " " << it->second->print() << " Removed.";\r
                                                        consumers_.erase(it++);\r
                                                }\r
                                        }\r
@@ -218,7 +218,7 @@ public:
                                                catch(...)\r
                                                {\r
                                                        CASPAR_LOG_CURRENT_EXCEPTION();\r
-                                                       CASPAR_LOG(error) << "Failed to recover consumer: " << consumer->print() << L". Removing it.";\r
+                                                       CASPAR_LOG(error) << "Failed to recover consumer: " << consumer->print() << ". Removing it.";\r
                                                        consumers_.erase(it++);\r
                                                }\r
                                        }\r
@@ -233,20 +233,20 @@ public:
                });\r
        }\r
 \r
-       std::wstring print() const\r
+       std::string print() const\r
        {\r
-               return L"output[" + boost::lexical_cast<std::wstring>(channel_index_) + L"]";\r
+               return "output[" + boost::lexical_cast<std::string>(channel_index_) + "]";\r
        }\r
 \r
-       boost::unique_future<boost::property_tree::wptree> info()\r
+       boost::unique_future<boost::property_tree::ptree> info()\r
        {\r
-               return std::move(executor_.begin_invoke([&]() -> boost::property_tree::wptree\r
+               return std::move(executor_.begin_invoke([&]() -> boost::property_tree::ptree\r
                {                       \r
-                       boost::property_tree::wptree info;\r
+                       boost::property_tree::ptree info;\r
                        BOOST_FOREACH(auto& consumer, consumers_)\r
                        {\r
-                               info.add_child(L"consumers.consumer", consumer.second->info())\r
-                                       .add(L"index", consumer.first); \r
+                               info.add_child("consumers.consumer", consumer.second->info())\r
+                                       .add("index", consumer.first); \r
                        }\r
                        return info;\r
                }, high_priority));\r
@@ -260,5 +260,5 @@ void output::remove(int index){impl_->remove(index);}
 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
+boost::unique_future<boost::property_tree::ptree> output::info() const{return impl_->info();}\r
 }}
\ No newline at end of file
index 02477b5022c2cca74afbe9177a7065c5910ed702..05f6e8b45949dc4da78cad5cbd8e316bf8bdd07e 100644 (file)
@@ -52,7 +52,7 @@ public:
        \r
        void set_video_format_desc(const video_format_desc& format_desc);\r
 \r
-       boost::unique_future<boost::property_tree::wptree> info() const;\r
+       boost::unique_future<boost::property_tree::ptree> info() const;\r
 private:\r
        struct implementation;\r
        safe_ptr<implementation> impl_;\r
index 161cac0e725f8d4275383784956dee742529e79a..bfb9791ee194836452079a2a21c5cf078a4af67c 100644 (file)
@@ -68,7 +68,7 @@ public:
                GL(glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE));\r
                GL(glTexImage2D(GL_TEXTURE_2D, 0, INTERNAL_FORMAT[stride_], width_, height_, 0, FORMAT[stride_], GL_UNSIGNED_BYTE, NULL));\r
                GL(glBindTexture(GL_TEXTURE_2D, 0));\r
-               CASPAR_LOG(trace) << "[device_buffer] [" << ++g_total_count << L"] allocated size:" << width*height*stride;     \r
+               CASPAR_LOG(trace) << "[device_buffer] [" << ++g_total_count << "] allocated size:" << width*height*stride;      \r
        }       \r
 \r
        ~implementation()\r
@@ -76,7 +76,7 @@ public:
                try\r
                {\r
                        GL(glDeleteTextures(1, &id_));\r
-                       //CASPAR_LOG(trace) << "[device_buffer] [" << --g_total_count << L"] deallocated size:" << width_*height_*stride_;\r
+                       //CASPAR_LOG(trace) << "[device_buffer] [" << --g_total_count << "] deallocated size:" << width_*height_*stride_;\r
                }\r
                catch(...)\r
                {\r
index 286b90ad3d6ffb56520d75d078c04efc8e79e52e..5185d13fd62144cfcbee8b4d0f5edc6ef1050075 100644 (file)
@@ -76,13 +76,13 @@ struct fence::implementation
                {\r
                        if(!warned.fetch_and_store(true))\r
                        {\r
-                               CASPAR_LOG(warning) << L"[fence] Performance warning. GPU was not ready during requested host read-back. Delayed by atleast: " << delay << L" ms. Further warnings are sent to trace log level."\r
-                                                                       << L" You can ignore this warning if you do not notice any problems with output video. This warning is caused by insufficent support or performance of your graphics card for OpenGL based memory transfers. "\r
-                                                                       << L" Please try to update your graphics drivers or update your graphics card, see recommendations on (www.casparcg.com)."\r
-                                                                       << L" Further help is available at (www.casparcg.com/forum).";\r
+                               CASPAR_LOG(warning) << "[fence] Performance warning. GPU was not ready during requested host read-back. Delayed by atleast: " << delay << " ms. Further warnings are sent to trace log level."\r
+                                                                       << " You can ignore this warning if you do not notice any problems with output video. This warning is caused by insufficent support or performance of your graphics card for OpenGL based memory transfers. "\r
+                                                                       << " Please try to update your graphics drivers or update your graphics card, see recommendations on (www.casparcg.com)."\r
+                                                                       << " Further help is available at (www.casparcg.com/forum).";\r
                        }\r
                        else\r
-                               CASPAR_LOG(trace) << L"[fence] Performance warning. GPU was not ready during requested host read-back. Delayed by atleast: " << delay << L" ms.";\r
+                               CASPAR_LOG(trace) << "[fence] Performance warning. GPU was not ready during requested host read-back. Delayed by atleast: " << delay << " ms.";\r
                }\r
        }\r
 };\r
index ee9362c3a23f1f442888b74b92c57e0359e59d18..1429a95db574b782c514c768255839f76f9f37c9 100644 (file)
@@ -65,7 +65,7 @@ public:
                if(!pbo_)\r
                        BOOST_THROW_EXCEPTION(caspar_exception() << msg_info("Failed to allocate buffer."));\r
 \r
-               CASPAR_LOG(trace) << "[host_buffer] [" << ++(usage_ == write_only ? g_w_total_count : g_r_total_count) << L"] allocated size:" << size_ << " usage: " << (usage == write_only ? "write_only" : "read_only");\r
+               CASPAR_LOG(trace) << "[host_buffer] [" << ++(usage_ == write_only ? g_w_total_count : g_r_total_count) << "] allocated size:" << size_ << " usage: " << (usage == write_only ? "write_only" : "read_only");\r
        }       \r
 \r
        ~implementation()\r
@@ -73,7 +73,7 @@ public:
                try\r
                {\r
                        GL(glDeleteBuffers(1, &pbo_));\r
-                       //CASPAR_LOG(trace) << "[host_buffer] [" << --(usage_ == write_only ? g_w_total_count : g_r_total_count) << L"] deallocated size:" << size_ << " usage: " << (usage_ == write_only ? "write_only" : "read_only");\r
+                       //CASPAR_LOG(trace) << "[host_buffer] [" << --(usage_ == write_only ? g_w_total_count : g_r_total_count) << "] deallocated size:" << size_ << " usage: " << (usage_ == write_only ? "write_only" : "read_only");\r
                }\r
                catch(...)\r
                {\r
index 4c7f32e3c4579a859ffaa1513285354bb0e71caa..f23e1f25acdb3c3897353e196891c392f944fe4c 100644 (file)
 namespace caspar { namespace core {\r
 \r
 ogl_device::ogl_device() \r
-       : executor_(L"ogl_device")\r
+       : executor_("ogl_device")\r
        , pattern_(nullptr)\r
        , attached_texture_(0)\r
        , active_shader_(0)\r
 {\r
-       CASPAR_LOG(info) << L"Initializing OpenGL Device.";\r
+       CASPAR_LOG(info) << "Initializing OpenGL Device.";\r
 \r
        std::fill(binded_textures_.begin(), binded_textures_.end(), 0);\r
        std::fill(viewport_.begin(), viewport_.end(), 0);\r
@@ -58,19 +58,19 @@ ogl_device::ogl_device()
                if (glewInit() != GLEW_OK)\r
                        BOOST_THROW_EXCEPTION(gl::ogl_exception() << msg_info("Failed to initialize GLEW."));\r
                                                \r
-               CASPAR_LOG(info) << L"OpenGL " << version();\r
+               CASPAR_LOG(info) << "OpenGL " << version();\r
 \r
                if(!GLEW_VERSION_3_0)\r
                        CASPAR_LOG(warning) << "Missing OpenGL 3.0 support.";\r
        \r
-               CASPAR_LOG(info) << L"Successfully initialized GLEW.";\r
+               CASPAR_LOG(info) << "Successfully initialized GLEW.";\r
 \r
                GL(glGenFramebuffers(1, &fbo_));                \r
                GL(glBindFramebuffer(GL_FRAMEBUFFER_EXT, fbo_));\r
                GL(glReadBuffer(GL_COLOR_ATTACHMENT0_EXT));\r
         //GL(glDisable(GL_MULTISAMPLE_ARB));\r
 \r
-               CASPAR_LOG(info) << L"Successfully initialized OpenGL Device.";\r
+               CASPAR_LOG(info) << "Successfully initialized OpenGL Device.";\r
        });\r
 }\r
 \r
@@ -105,7 +105,7 @@ safe_ptr<device_buffer> ogl_device::allocate_device_buffer(size_t width, size_t
                }\r
                catch(...)\r
                {\r
-                       CASPAR_LOG(error) << L"ogl: create_device_buffer failed!";\r
+                       CASPAR_LOG(error) << "ogl: create_device_buffer failed!";\r
                        throw;\r
                }\r
        }\r
@@ -157,7 +157,7 @@ safe_ptr<host_buffer> ogl_device::allocate_host_buffer(size_t size, host_buffer:
                }\r
                catch(...)\r
                {\r
-                       CASPAR_LOG(error) << L"ogl: create_host_buffer failed!";\r
+                       CASPAR_LOG(error) << "ogl: create_host_buffer failed!";\r
                        throw;          \r
                }\r
        }\r
@@ -266,13 +266,13 @@ boost::unique_future<void> ogl_device::gc()
        }, high_priority);\r
 }\r
 \r
-std::wstring ogl_device::version()\r
+std::string ogl_device::version()\r
 {      \r
-       static std::wstring ver = L"Not found";\r
+       static std::string ver = "Not found";\r
        try\r
        {\r
-               ver = widen(invoke([]{return std::string(reinterpret_cast<const char*>(glGetString(GL_VERSION)));})\r
-               + " "   + invoke([]{return std::string(reinterpret_cast<const char*>(glGetString(GL_VENDOR)));}));                      \r
+               ver = invoke([]{return std::string(reinterpret_cast<const char*>(glGetString(GL_VERSION)));})\r
+               + " "   + invoke([]{return std::string(reinterpret_cast<const char*>(glGetString(GL_VENDOR)));})                      \r
        }\r
        catch(...){}\r
 \r
index 4461d9086327899ae853c0868621b81361206f25..01e64569f24081ab66ba163583d574e4dba0f89c 100644 (file)
@@ -119,7 +119,7 @@ public:
        void yield();\r
        boost::unique_future<void> gc();\r
 \r
-       std::wstring version();\r
+       std::string version();\r
 \r
 private:\r
        safe_ptr<device_buffer> allocate_device_buffer(size_t width, size_t height, size_t stride);\r
index 340a2b43569787090e9a8bb59c4f76724e9b3867..c7b872974a5fb27c2ad7291d14b6626d07efbb96 100644 (file)
 \r
 namespace caspar { namespace core {\r
                \r
-blend_mode::type get_blend_mode(const std::wstring& str)\r
+blend_mode::type get_blend_mode(const std::string& str)\r
 {\r
-       if(boost::iequals(str, L"normal"))\r
+       if(iequals(str, "normal"))\r
                return blend_mode::normal;\r
-       else if(boost::iequals(str, L"lighten"))\r
+       else if(iequals(str, "lighten"))\r
                return blend_mode::lighten;\r
-       else if(boost::iequals(str, L"darken"))\r
+       else if(iequals(str, "darken"))\r
                return blend_mode::darken;\r
-       else if(boost::iequals(str, L"multiply"))\r
+       else if(iequals(str, "multiply"))\r
                return blend_mode::multiply;\r
-       else if(boost::iequals(str, L"average"))\r
+       else if(iequals(str, "average"))\r
                return blend_mode::average;\r
-       else if(boost::iequals(str, L"add"))\r
+       else if(iequals(str, "add"))\r
                return blend_mode::add;\r
-       else if(boost::iequals(str, L"subtract"))\r
+       else if(iequals(str, "subtract"))\r
                return blend_mode::subtract;\r
-       else if(boost::iequals(str, L"difference"))\r
+       else if(iequals(str, "difference"))\r
                return blend_mode::difference;\r
-       else if(boost::iequals(str, L"negation"))\r
+       else if(iequals(str, "negation"))\r
                return blend_mode::negation;\r
-       else if(boost::iequals(str, L"exclusion"))\r
+       else if(iequals(str, "exclusion"))\r
                return blend_mode::exclusion;\r
-       else if(boost::iequals(str, L"screen"))\r
+       else if(iequals(str, "screen"))\r
                return blend_mode::screen;\r
-       else if(boost::iequals(str, L"overlay"))\r
+       else if(iequals(str, "overlay"))\r
                return blend_mode::overlay;\r
-       else if(boost::iequals(str, L"soft_light"))\r
+       else if(iequals(str, "soft_light"))\r
                return blend_mode::soft_light;\r
-       else if(boost::iequals(str, L"hard_light"))\r
+       else if(iequals(str, "hard_light"))\r
                return blend_mode::hard_light;\r
-       else if(boost::iequals(str, L"color_dodge"))\r
+       else if(iequals(str, "color_dodge"))\r
                return blend_mode::color_dodge;\r
-       else if(boost::iequals(str, L"color_burn"))\r
+       else if(iequals(str, "color_burn"))\r
                return blend_mode::color_burn;\r
-       else if(boost::iequals(str, L"linear_dodge"))\r
+       else if(iequals(str, "linear_dodge"))\r
                return blend_mode::linear_dodge;\r
-       else if(boost::iequals(str, L"linear_burn"))\r
+       else if(iequals(str, "linear_burn"))\r
                return blend_mode::linear_burn;\r
-       else if(boost::iequals(str, L"linear_light"))\r
+       else if(iequals(str, "linear_light"))\r
                return blend_mode::linear_light;\r
-       else if(boost::iequals(str, L"vivid_light"))\r
+       else if(iequals(str, "vivid_light"))\r
                return blend_mode::vivid_light;\r
-       else if(boost::iequals(str, L"pin_light"))\r
+       else if(iequals(str, "pin_light"))\r
                return blend_mode::pin_light;\r
-       else if(boost::iequals(str, L"hard_mix"))\r
+       else if(iequals(str, "hard_mix"))\r
                return blend_mode::hard_mix;\r
-       else if(boost::iequals(str, L"reflect"))\r
+       else if(iequals(str, "reflect"))\r
                return blend_mode::reflect;\r
-       else if(boost::iequals(str, L"glow"))\r
+       else if(iequals(str, "glow"))\r
                return blend_mode::glow;\r
-       else if(boost::iequals(str, L"phoenix"))\r
+       else if(iequals(str, "phoenix"))\r
                return blend_mode::phoenix;\r
-       else if(boost::iequals(str, L"contrast"))\r
+       else if(iequals(str, "contrast"))\r
                return blend_mode::contrast;\r
-       else if(boost::iequals(str, L"saturation"))\r
+       else if(iequals(str, "saturation"))\r
                return blend_mode::saturation;\r
-       else if(boost::iequals(str, L"color"))\r
+       else if(iequals(str, "color"))\r
                return blend_mode::color;\r
-       else if(boost::iequals(str, L"luminosity"))\r
+       else if(iequals(str, "luminosity"))\r
                return blend_mode::luminosity;\r
                \r
        return blend_mode::normal;\r
index 6690ee89cc8a9803e12b1116c2b931d9d10eb21b..cb0bcb1905e8e4f3207a76290dc230b5bf68af30 100644 (file)
@@ -61,6 +61,6 @@ struct blend_mode
        };\r
 };\r
 \r
-blend_mode::type get_blend_mode(const std::wstring& str);\r
+blend_mode::type get_blend_mode(const std::string& str);\r
 \r
 }}
\ No newline at end of file
index f7e837b8b3510c83e79003191d636766b8004ba9..577027afe0d48945edf5bfe9f5a119fbbf0d210b 100644 (file)
@@ -80,7 +80,7 @@ struct image_kernel::implementation : boost::noncopyable
                \r
                if(!std::all_of(params.textures.begin(), params.textures.end(), std::mem_fn(&device_buffer::ready)))\r
                {\r
-                       CASPAR_LOG(trace) << L"[image_mixer] Performance warning. Host to device transfer not complete, GPU will be stalled";\r
+                       CASPAR_LOG(trace) << "[image_mixer] Performance warning. Host to device transfer not complete, GPU will be stalled";\r
                        ogl_->yield(); // Try to give it some more time.\r
                }               \r
                \r
index 7cb74b285c437e9039cbfefb9d441cd9bab7df7e..e88c53ce06afd637c3f613cd0cc1e36924c50c19 100644 (file)
@@ -45,8 +45,6 @@
 #include <algorithm>\r
 #include <deque>\r
 \r
-using namespace boost::assign;\r
-\r
 namespace caspar { namespace core {\r
        \r
 struct item\r
@@ -219,8 +217,8 @@ private:
 \r
                draw_params draw_params;\r
                draw_params.pix_desc.pix_fmt    = pixel_format::bgra;\r
-               draw_params.pix_desc.planes             = list_of(pixel_format_desc::plane(source_buffer->width(), source_buffer->height(), 4));\r
-               draw_params.textures                    = list_of(source_buffer);\r
+               draw_params.pix_desc.planes             = boost::assign::list_of(pixel_format_desc::plane(source_buffer->width(), source_buffer->height(), 4));\r
+               draw_params.textures                    = boost::assign::list_of(source_buffer);\r
                draw_params.transform                   = frame_transform();\r
                draw_params.blend_mode                  = blend_mode;\r
                draw_params.background                  = draw_buffer;\r
index fafb81e607587fc07e1d87745dd093dc6b38a3d4..8b6b761b65d14b59417303d9f1d548ec87f6d85b 100644 (file)
@@ -285,7 +285,7 @@ safe_ptr<shader> get_image_shader(ogl_device& ogl, bool& blend_modes)
                \r
        try\r
        {                               \r
-               g_blend_modes  = glTextureBarrierNV ? env::properties().get(L"configuration.blend-modes", false) : false;\r
+               g_blend_modes  = glTextureBarrierNV ? env::properties().get("configuration.blend-modes", false) : false;\r
                g_shader.reset(new shader(get_vertex(), get_fragment(g_blend_modes)));\r
        }\r
        catch(...)\r
@@ -303,7 +303,7 @@ safe_ptr<shader> get_image_shader(ogl_device& ogl, bool& blend_modes)
        {\r
                ogl.enable(GL_BLEND);\r
                glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE);\r
-               CASPAR_LOG(info) << L"[shader] Blend-modes are disabled.";\r
+               CASPAR_LOG(info) << "[shader] Blend-modes are disabled.";\r
        }\r
 \r
        blend_modes = g_blend_modes;\r
index 750c9bbb06759325303609a6fa8ab9fd900961e6..8104bf473253ddcb6184388f33a36efa9c473fc2 100644 (file)
@@ -80,7 +80,7 @@ public:
                , ogl_(ogl)\r
                , image_mixer_(ogl)\r
                , audio_mixer_(graph_)\r
-               , executor_(L"mixer")\r
+               , executor_("mixer")\r
        {                       \r
                graph_->set_color("mix-time", diagnostics::color(1.0f, 0.0f, 0.9f));\r
        }\r
@@ -149,10 +149,10 @@ public:
                return format_desc_;\r
        }\r
 \r
-       boost::unique_future<boost::property_tree::wptree> info() const\r
+       boost::unique_future<boost::property_tree::ptree> info() const\r
        {\r
-               boost::promise<boost::property_tree::wptree> info;\r
-               info.set_value(boost::property_tree::wptree());\r
+               boost::promise<boost::property_tree::ptree> info;\r
+               info.set_value(boost::property_tree::ptree());\r
                return info.get_future();\r
        }\r
 };\r
@@ -164,5 +164,5 @@ core::video_format_desc mixer::get_video_format_desc() const { return impl_->get
 safe_ptr<core::write_frame> mixer::create_frame(const void* tag, const core::pixel_format_desc& desc){ return impl_->create_frame(tag, desc); }                \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
+boost::unique_future<boost::property_tree::ptree> mixer::info() const{return impl_->info();}\r
 }}
\ No newline at end of file
index c01482527784c02081b934003bab95297ce836a8..8d24ec7914150b8842a8f8b2d50eeec2ccb27f5a 100644 (file)
@@ -68,7 +68,7 @@ public:
        \r
        void set_blend_mode(int index, blend_mode::type value);\r
 \r
-       boost::unique_future<boost::property_tree::wptree> info() const;\r
+       boost::unique_future<boost::property_tree::ptree> info() const;\r
        \r
 private:\r
        struct implementation;\r
index f91c1072783dd4af92c8ad9105a6007324386b7e..c161c8586c195d99348faf2c4993a884f7798e38 100644 (file)
@@ -38,10 +38,10 @@ namespace caspar { namespace core {
 class color_producer : public frame_producer\r
 {\r
        safe_ptr<basic_frame> frame_;\r
-       const std::wstring color_str_;\r
+       const std::string color_str_;\r
 \r
 public:\r
-       explicit color_producer(const safe_ptr<core::frame_factory>& frame_factory, const std::wstring& color) \r
+       explicit color_producer(const safe_ptr<core::frame_factory>& frame_factory, const std::string& color) \r
                : color_str_(color)\r
                , frame_(create_color_frame(this, frame_factory, color))\r
        {}\r
@@ -58,62 +58,62 @@ public:
                return frame_; \r
        }       \r
 \r
-       virtual std::wstring print() const override\r
+       virtual std::string print() const override\r
        {\r
-               return L"color[" + color_str_ + L"]";\r
+               return "color[" + color_str_ + "]";\r
        }\r
 \r
-       boost::property_tree::wptree info() const override\r
+       boost::property_tree::ptree info() const override\r
        {\r
-               boost::property_tree::wptree info;\r
-               info.add(L"type", L"color-producer");\r
-               info.add(L"color", color_str_);\r
+               boost::property_tree::ptree info;\r
+               info.add("type", "color-producer");\r
+               info.add("color", color_str_);\r
                return info;\r
        }\r
 };\r
 \r
-std::wstring get_hex_color(const std::wstring& str)\r
+std::string get_hex_color(const std::string& str)\r
 {\r
        if(str.at(0) == '#')\r
-               return str.length() == 7 ? L"#FF" + str.substr(1) : str;\r
+               return str.length() == 7 ? "#FF" + str.substr(1) : str;\r
        \r
-       if(boost::iequals(str, L"EMPTY"))\r
-               return L"#00000000";\r
+       if(iequals(str, "EMPTY"))\r
+               return "#00000000";\r
 \r
-       if(boost::iequals(str, L"BLACK"))\r
-               return L"#FF000000";\r
+       if(iequals(str, "BLACK"))\r
+               return "#FF000000";\r
        \r
-       if(boost::iequals(str, L"WHITE"))\r
-               return L"#FFFFFFFF";\r
+       if(iequals(str, "WHITE"))\r
+               return "#FFFFFFFF";\r
        \r
-       if(boost::iequals(str, L"RED"))\r
-               return L"#FFFF0000";\r
+       if(iequals(str, "RED"))\r
+               return "#FFFF0000";\r
        \r
-       if(boost::iequals(str, L"GREEN"))\r
-               return L"#FF00FF00";\r
+       if(iequals(str, "GREEN"))\r
+               return "#FF00FF00";\r
        \r
-       if(boost::iequals(str, L"BLUE"))\r
-               return L"#FF0000FF";    \r
+       if(iequals(str, "BLUE"))\r
+               return "#FF0000FF";     \r
        \r
-       if(boost::iequals(str, L"ORANGE"))\r
-               return L"#FFFFA500";    \r
+       if(iequals(str, "ORANGE"))\r
+               return "#FFFFA500";     \r
        \r
-       if(boost::iequals(str, L"YELLOW"))\r
-               return L"#FFFFFF00";\r
+       if(iequals(str, "YELLOW"))\r
+               return "#FFFFFF00";\r
        \r
-       if(boost::iequals(str, L"BROWN"))\r
-               return L"#FFA52A2A";\r
+       if(iequals(str, "BROWN"))\r
+               return "#FFA52A2A";\r
        \r
-       if(boost::iequals(str, L"GRAY"))\r
-               return L"#FF808080";\r
+       if(iequals(str, "GRAY"))\r
+               return "#FF808080";\r
        \r
-       if(boost::iequals(str, L"TEAL"))\r
-               return L"#FF008080";\r
+       if(iequals(str, "TEA"))\r
+               return "#FF008080";\r
        \r
        return str;\r
 }\r
 \r
-safe_ptr<frame_producer> create_color_producer(const safe_ptr<core::frame_factory>& frame_factory, const std::vector<std::wstring>& params)\r
+safe_ptr<frame_producer> create_color_producer(const safe_ptr<core::frame_factory>& frame_factory, const std::vector<std::string>& params)\r
 {\r
        if(params.size() < 0)\r
                return core::frame_producer::empty();\r
@@ -124,11 +124,11 @@ safe_ptr<frame_producer> create_color_producer(const safe_ptr<core::frame_factor
 \r
        return make_safe<color_producer>(frame_factory, color2);\r
 }\r
-safe_ptr<core::write_frame> create_color_frame(void* tag, const safe_ptr<core::frame_factory>& frame_factory, const std::wstring& color)\r
+safe_ptr<core::write_frame> create_color_frame(void* tag, const safe_ptr<core::frame_factory>& frame_factory, const std::string& color)\r
 {\r
        auto color2 = get_hex_color(color);\r
        if(color2.length() != 9 || color2[0] != '#')\r
-               BOOST_THROW_EXCEPTION(invalid_argument() << arg_name_info("color") << arg_value_info(narrow(color2)) << msg_info("Invalid color."));\r
+               BOOST_THROW_EXCEPTION(invalid_argument() << arg_name_info("color") << arg_value_info((color2)) << msg_info("Invalid color."));\r
        \r
        core::pixel_format_desc desc;\r
        desc.pix_fmt = pixel_format::bgra;\r
@@ -138,9 +138,9 @@ safe_ptr<core::write_frame> create_color_frame(void* tag, const safe_ptr<core::f
        // Read color from hex-string and write to frame pixel.\r
 \r
        auto& value = *reinterpret_cast<uint32_t*>(frame->image_data().begin());\r
-       std::wstringstream str(color2.substr(1));\r
+       std::stringstream str(color2.substr(1));\r
        if(!(str >> std::hex >> value) || !str.eof())\r
-               BOOST_THROW_EXCEPTION(invalid_argument() << arg_name_info("color") << arg_value_info(narrow(color2)) << msg_info("Invalid color."));\r
+               BOOST_THROW_EXCEPTION(invalid_argument() << arg_name_info("color") << arg_value_info((color2)) << msg_info("Invalid color."));\r
 \r
        frame->commit();\r
                \r
index 56bde5a82fdd53349b293f4c7264864fe6afdcaa..3c1851b08abe2504d0ac194aacdb9c5ddb0c606d 100644 (file)
@@ -31,7 +31,7 @@ namespace caspar { namespace core {
 class write_frame;\r
 struct frame_factory;\r
 \r
-safe_ptr<frame_producer> create_color_producer(const safe_ptr<core::frame_factory>& frame_factory, const std::vector<std::wstring>& params);\r
-safe_ptr<core::write_frame> create_color_frame(void* tag, const safe_ptr<core::frame_factory>& frame_factory, const std::wstring& color);\r
+safe_ptr<frame_producer> create_color_producer(const safe_ptr<core::frame_factory>& frame_factory, const std::vector<std::string>& params);\r
+safe_ptr<core::write_frame> create_color_frame(void* tag, const safe_ptr<core::frame_factory>& frame_factory, const std::string& color);\r
 \r
 }}\r
index 308c10d17abff9d45c29258c78b0a3078328a166..621f41c56624dbd3ce16203504cdc8f4bfebbdbf 100644 (file)
@@ -57,10 +57,10 @@ public:
                        std::shared_ptr<executor> destroyer;\r
                        if(!destroyers->try_pop(destroyer))\r
                        {\r
-                               destroyer.reset(new executor(L"destroyer"));\r
+                               destroyer.reset(new executor("destroyer"));\r
                                destroyer->set_priority_class(below_normal_priority_class);\r
                                if(++destroyer_count > 16)\r
-                                       CASPAR_LOG(warning) << L"Potential destroyer dead-lock detected.";\r
+                                       CASPAR_LOG(warning) << "Potential destroyer dead-lock detected.";\r
                                CASPAR_LOG(trace) << "Created destroyer: " << destroyer_count;\r
                        }\r
                                \r
@@ -71,9 +71,9 @@ public:
                                try\r
                                {\r
                                        if(!producer->unique())\r
-                                               CASPAR_LOG(trace) << (*producer)->print() << L" Not destroyed on safe asynchronous destruction thread: " << producer->use_count();\r
+                                               CASPAR_LOG(trace) << (*producer)->print() << " Not destroyed on safe asynchronous destruction thread: " << producer->use_count();\r
                                        else\r
-                                               CASPAR_LOG(trace) << (*producer)->print() << L" Destroying on safe asynchronous destruction thread.";\r
+                                               CASPAR_LOG(trace) << (*producer)->print() << " Destroying on safe asynchronous destruction thread.";\r
                                }\r
                                catch(...){}\r
 \r
@@ -94,9 +94,9 @@ public:
 \r
        virtual safe_ptr<basic_frame>                                                           receive(int hints) override                                                                                             {return (*producer_)->receive(hints);}\r
        virtual safe_ptr<basic_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 std::string                                                                             print() const override                                                                                                  {return (*producer_)->print();}\r
+       virtual boost::property_tree::ptree                                             info() const override                                                                                                   {return (*producer_)->info();}\r
+       virtual boost::unique_future<std::string>                                       call(const std::string& str) override                                                                   {return (*producer_)->call(str);}\r
        virtual safe_ptr<frame_producer>                                                        get_following_producer() const override                                                                 {return (*producer_)->get_following_producer();}\r
        virtual void                                                                                            set_leading_producer(const safe_ptr<frame_producer>& producer) override {(*producer_)->set_leading_producer(producer);}\r
        virtual uint32_t                                                                                        nb_frames() const override                                                                                              {return (*producer_)->nb_frames();}\r
@@ -109,7 +109,7 @@ safe_ptr<core::frame_producer> create_producer_destroy_proxy(safe_ptr<core::fram
 \r
 class last_frame_producer : public frame_producer\r
 {\r
-       const std::wstring                      print_;\r
+       const std::string                       print_;\r
        const safe_ptr<basic_frame>     frame_;\r
        const uint32_t                          nb_frames_;\r
 public:\r
@@ -122,12 +122,12 @@ public:
        \r
        virtual safe_ptr<basic_frame> receive(int){return frame_;}\r
        virtual safe_ptr<core::basic_frame> last_frame() const{return frame_;}\r
-       virtual std::wstring print() const{return L"dummy[" + print_ + L"]";}\r
+       virtual std::string print() const{return "dummy[" + print_ + "]";}\r
        virtual uint32_t nb_frames() const {return nb_frames_;} \r
-       virtual boost::property_tree::wptree info() const override\r
+       virtual boost::property_tree::ptree info() const override\r
        {\r
-               boost::property_tree::wptree info;\r
-               info.add(L"type", L"last-frame-producer");\r
+               boost::property_tree::ptree info;\r
+               info.add("type", "last-frame-producer");\r
                return info;\r
        }\r
 };\r
@@ -138,12 +138,12 @@ struct empty_frame_producer : public frame_producer
        virtual safe_ptr<basic_frame> last_frame() const{return basic_frame::empty();}\r
        virtual void set_frame_factory(const safe_ptr<frame_factory>&){}\r
        virtual uint32_t nb_frames() const {return 0;}\r
-       virtual std::wstring print() const { return L"empty";}\r
+       virtual std::string print() const { return "empty";}\r
        \r
-       virtual boost::property_tree::wptree info() const override\r
+       virtual boost::property_tree::ptree info() const override\r
        {\r
-               boost::property_tree::wptree info;\r
-               info.add(L"type", L"empty-producer");\r
+               boost::property_tree::ptree info;\r
+               info.add("type", "empty-producer");\r
                return info;\r
        }\r
 };\r
@@ -179,7 +179,7 @@ void register_producer_factory(const producer_factory_t& factory)
        g_factories.push_back(factory);\r
 }\r
 \r
-safe_ptr<core::frame_producer> do_create_producer(const safe_ptr<frame_factory>& my_frame_factory, const std::vector<std::wstring>& params)\r
+safe_ptr<core::frame_producer> do_create_producer(const safe_ptr<frame_factory>& my_frame_factory, const std::vector<std::string>& params)\r
 {\r
        if(params.empty())\r
                BOOST_THROW_EXCEPTION(invalid_argument() << arg_name_info("params") << arg_value_info(""));\r
@@ -208,7 +208,7 @@ safe_ptr<core::frame_producer> do_create_producer(const safe_ptr<frame_factory>&
 }\r
 \r
 \r
-safe_ptr<core::frame_producer> create_producer(const safe_ptr<frame_factory>& my_frame_factory, const std::vector<std::wstring>& params)\r
+safe_ptr<core::frame_producer> create_producer(const safe_ptr<frame_factory>& my_frame_factory, const std::vector<std::string>& params)\r
 {      \r
        auto producer = do_create_producer(my_frame_factory, params);\r
        auto key_producer = frame_producer::empty();\r
@@ -218,11 +218,11 @@ safe_ptr<core::frame_producer> create_producer(const safe_ptr<frame_factory>& my
                auto params_copy = params;\r
                if(params_copy.size() > 0)\r
                {\r
-                       params_copy[0] += L"_A";\r
+                       params_copy[0] += "_A";\r
                        key_producer = do_create_producer(my_frame_factory, params_copy);                       \r
                        if(key_producer == frame_producer::empty())\r
                        {\r
-                               params_copy[0] += L"LPHA";\r
+                               params_copy[0] += "LPHA";\r
                                key_producer = do_create_producer(my_frame_factory, params_copy);       \r
                        }\r
                }\r
@@ -234,22 +234,22 @@ safe_ptr<core::frame_producer> create_producer(const safe_ptr<frame_factory>& my
        \r
        if(producer == frame_producer::empty())\r
        {\r
-               std::wstring str;\r
+               std::string str;\r
                BOOST_FOREACH(auto& param, params)\r
-                       str += param + L" ";\r
-               BOOST_THROW_EXCEPTION(file_not_found() << msg_info("No match found for supplied commands. Check syntax.") << arg_value_info(narrow(str)));\r
+                       str += param + " ";\r
+               BOOST_THROW_EXCEPTION(file_not_found() << msg_info("No match found for supplied commands. Check syntax.") << arg_value_info((str)));\r
        }\r
 \r
        return producer;\r
 }\r
 \r
 \r
-safe_ptr<core::frame_producer> create_producer(const safe_ptr<frame_factory>& factory, const std::wstring& params)\r
+safe_ptr<core::frame_producer> create_producer(const safe_ptr<frame_factory>& factory, const std::string& params)\r
 {\r
-       std::wstringstream iss(params);\r
-       std::vector<std::wstring> tokens;\r
-       typedef std::istream_iterator<std::wstring, wchar_t, std::char_traits<wchar_t> > iterator;\r
-       std::copy(iterator(iss),  iterator(), std::back_inserter(tokens));\r
+       std::stringstream iss(params);\r
+       std::vector<std::string> tokens;\r
+       typedef std::istream_iterator<std::string, char, std::char_traits<char> > iterator;\r
+       std::copy(iterator(iss), iterator(), std::back_inserter(tokens));\r
        return create_producer(factory, tokens);\r
 }\r
 \r
index 5375707c37625cdc6ba1500b8fb65a4bfc9a353e..057f6d7f0c62d2372753dd42bdc85cac9188b2cd 100644 (file)
@@ -56,13 +56,13 @@ public:
 \r
        virtual ~frame_producer(){}     \r
 \r
-       virtual std::wstring print() const = 0; // nothrow\r
-       virtual boost::property_tree::wptree info() const = 0;\r
+       virtual std::string print() const = 0; // nothrow\r
+       virtual boost::property_tree::ptree info() const = 0;\r
 \r
-       virtual boost::unique_future<std::wstring> call(const std::wstring&) \r
+       virtual boost::unique_future<std::string> call(const std::string&) \r
        {\r
-               boost::promise<std::wstring> promise;\r
-               promise.set_value(L"");\r
+               boost::promise<std::string> promise;\r
+               promise.set_value("");\r
                return promise.get_future();\r
        }\r
 \r
@@ -79,10 +79,10 @@ public:
 \r
 safe_ptr<basic_frame> receive_and_follow(safe_ptr<frame_producer>& producer, int hints);\r
 \r
-typedef std::function<safe_ptr<core::frame_producer>(const safe_ptr<frame_factory>&, const std::vector<std::wstring>&)> producer_factory_t;\r
+typedef std::function<safe_ptr<core::frame_producer>(const safe_ptr<frame_factory>&, const std::vector<std::string>&)> producer_factory_t;\r
 void register_producer_factory(const producer_factory_t& factory); // Not thread-safe.\r
-safe_ptr<core::frame_producer> create_producer(const safe_ptr<frame_factory>&, const std::vector<std::wstring>& params);\r
-safe_ptr<core::frame_producer> create_producer(const safe_ptr<frame_factory>&, const std::wstring& params);\r
+safe_ptr<core::frame_producer> create_producer(const safe_ptr<frame_factory>&, const std::vector<std::string>& params);\r
+safe_ptr<core::frame_producer> create_producer(const safe_ptr<frame_factory>&, const std::string& params);\r
 safe_ptr<core::frame_producer> create_producer_destroy_proxy(safe_ptr<core::frame_producer>&& producer);\r
 \r
 }}\r
index 2a5cfe5368a2fb8fed943562dfdc3550435b1c8b..c2f3e7ea47f5136ecbf24dca9ae771f49179196e 100644 (file)
@@ -127,7 +127,7 @@ public:
                }\r
        }\r
 \r
-       boost::unique_future<std::wstring> call(bool foreground, const std::wstring& param)\r
+       boost::unique_future<std::string> call(bool foreground, const std::string& param)\r
        {\r
                return (foreground ? foreground_ : background_)->call(param);\r
        }\r
@@ -137,19 +137,19 @@ public:
                return background_ == core::frame_producer::empty() && foreground_ == core::frame_producer::empty();\r
        }\r
 \r
-       boost::property_tree::wptree info() const\r
+       boost::property_tree::ptree info() const\r
        {\r
-               boost::property_tree::wptree info;\r
-               info.add(L"status",             is_paused_ ? L"paused" : (foreground_ == frame_producer::empty() ? L"stopped" : L"playing"));\r
-               info.add(L"auto_delta", auto_play_delta_);\r
-               info.add(L"frame-number", frame_number_);\r
+               boost::property_tree::ptree info;\r
+               info.add("status",              is_paused_ ? "paused" : (foreground_ == frame_producer::empty() ? "stopped" : "playing"));\r
+               info.add("auto_delta",  auto_play_delta_);\r
+               info.add("frame-number", frame_number_);\r
 \r
                auto nb_frames = foreground_->nb_frames();\r
 \r
-               info.add(L"nb_frames",   nb_frames == std::numeric_limits<int64_t>::max() ? -1 : nb_frames);\r
-               info.add(L"frames-left", nb_frames == std::numeric_limits<int64_t>::max() ? -1 : (foreground_->nb_frames() - frame_number_ - auto_play_delta_));\r
-               info.add_child(L"foreground", foreground_->info());\r
-               info.add_child(L"background", background_->info());\r
+               info.add("nb_frames",    nb_frames == std::numeric_limits<int64_t>::max() ? -1 : nb_frames);\r
+               info.add("frames-left", nb_frames == std::numeric_limits<int64_t>::max() ? -1 : (foreground_->nb_frames() - frame_number_ - auto_play_delta_));\r
+               info.add_child("foreground", foreground_->info());\r
+               info.add_child("background", background_->info());\r
                return info;\r
        }\r
 };\r
@@ -182,6 +182,6 @@ safe_ptr<basic_frame> layer::receive(int hints) {return impl_->receive(hints);}
 safe_ptr<frame_producer> layer::foreground() const { return impl_->foreground_;}\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
+boost::unique_future<std::string> layer::call(bool foreground, const std::string& param){return impl_->call(foreground, param);}\r
+boost::property_tree::ptree layer::info() const{return impl_->info();}\r
 }}
\ No newline at end of file
index 38ccd43a6651e08c18ce3575f63d502e44da2b55..54f796c7cd03c1a72557024968c15746f49cfdb0 100644 (file)
@@ -49,7 +49,7 @@ public:
        void play(); // nothrow\r
        void pause(); // nothrow\r
        void stop(); // nothrow\r
-       boost::unique_future<std::wstring> call(bool foreground, const std::wstring& param);\r
+       boost::unique_future<std::string> call(bool foreground, const std::string& param);\r
 \r
        bool is_paused() const;\r
        int64_t frame_number() const;\r
@@ -61,7 +61,7 @@ public:
 \r
        safe_ptr<basic_frame> receive(int hints); // nothrow\r
 \r
-       boost::property_tree::wptree info() const;\r
+       boost::property_tree::ptree info() const;\r
 private:\r
        struct implementation;\r
        safe_ptr<implementation> impl_;\r
index 2068e2a57c4969611e4a2e4532ee8ac4dfc66ec3..2c3f485839c8c39153448c8380f1546328826056 100644 (file)
@@ -72,15 +72,15 @@ struct playlist_producer : public frame_producer
                return disable_audio(last_frame_);\r
        }\r
 \r
-       virtual std::wstring print() const override\r
+       virtual std::string print() const override\r
        {\r
-               return L"playlist[" + current_->print() + L"]";\r
+               return "playlist[" + current_->print() + "]";\r
        }       \r
 \r
-       virtual boost::property_tree::wptree info() const override\r
+       virtual boost::property_tree::ptree info() const override\r
        {\r
-               boost::property_tree::wptree info;\r
-               info.add(L"type", L"playlist-producer");\r
+               boost::property_tree::ptree info;\r
+               info.add("type", "playlist-producer");\r
                return info;\r
        }\r
 \r
@@ -89,29 +89,29 @@ struct playlist_producer : public frame_producer
                return std::numeric_limits<uint32_t>::max();\r
        }\r
        \r
-       virtual boost::unique_future<std::wstring> call(const std::wstring& param) override\r
+       virtual boost::unique_future<std::string> call(const std::string& param) override\r
        {\r
-               boost::promise<std::wstring> promise;\r
+               boost::promise<std::string> promise;\r
                promise.set_value(do_call(param));\r
                return promise.get_future();\r
        }       \r
 \r
        // playlist_producer\r
 \r
-       std::wstring do_call(const std::wstring& param)\r
+       std::string do_call(const std::string& param)\r
        {               \r
-               static const boost::wregex push_front_exp       (L"PUSH_FRONT (?<PARAM>.+)");           \r
-               static const boost::wregex push_back_exp        (L"(PUSH_BACK|PUSH) (?<PARAM>.+)");\r
-               static const boost::wregex pop_front_exp        (L"POP_FRONT");         \r
-               static const boost::wregex pop_back_exp         (L"(POP_BACK|POP)");\r
-               static const boost::wregex clear_exp            (L"CLEAR");\r
-               static const boost::wregex next_exp                     (L"NEXT");\r
-               static const boost::wregex insert_exp           (L"INSERT (?<POS>\\d+) (?<PARAM>.+)");  \r
-               static const boost::wregex remove_exp           (L"REMOVE (?<POS>\\d+) (?<PARAM>.+)");  \r
-               static const boost::wregex list_exp                     (L"LIST");                      \r
-               static const boost::wregex loop_exp                     (L"LOOP\\s*(?<VALUE>\\d?)");\r
+               static const boost::regex push_front_exp        ("PUSH_FRONT (?<PARAM>.+)");            \r
+               static const boost::regex push_back_exp ("(PUSH_BACK|PUSH) (?<PARAM>.+)");\r
+               static const boost::regex pop_front_exp ("POP_FRONT");          \r
+               static const boost::regex pop_back_exp          ("(POP_BACK|POP)");\r
+               static const boost::regex clear_exp             ("CLEAR");\r
+               static const boost::regex next_exp                      ("NEXT");\r
+               static const boost::regex insert_exp            ("INSERT (?<POS>\\d+) (?<PARAM>.+)");   \r
+               static const boost::regex remove_exp            ("REMOVE (?<POS>\\d+) (?<PARAM>.+)");   \r
+               static const boost::regex list_exp                      ("LIST");                       \r
+               static const boost::regex loop_exp                      ("LOOP\\s*(?<VALUE>\\d?)");\r
                \r
-               boost::wsmatch what;\r
+               boost::smatch what;\r
 \r
                if(boost::regex_match(param, what, push_front_exp))\r
                        return push_front(what["PARAM"].str()); \r
@@ -135,43 +135,43 @@ struct playlist_producer : public frame_producer
                {\r
                        if(!what["VALUE"].str().empty())\r
                                loop_ = boost::lexical_cast<bool>(what["VALUE"].str());\r
-                       return boost::lexical_cast<std::wstring>(loop_);\r
+                       return boost::lexical_cast<std::string>(loop_);\r
                }\r
 \r
                BOOST_THROW_EXCEPTION(invalid_argument());\r
        }\r
        \r
-       std::wstring push_front(const std::wstring& str)\r
+       std::string push_front(const std::string& str)\r
        {\r
                producers_.push_front(create_producer(factory_, str)); \r
-               return L"";\r
+               return "";\r
        }\r
 \r
-       std::wstring  push_back(const std::wstring& str)\r
+       std::string  push_back(const std::string& str)\r
        {\r
                producers_.push_back(create_producer(factory_, str)); \r
-               return L"";\r
+               return "";\r
        }\r
 \r
-       std::wstring pop_front()\r
+       std::string pop_front()\r
        {\r
                producers_.pop_front();\r
-               return L"";\r
+               return "";\r
        }\r
 \r
-       std::wstring pop_back()\r
+       std::string pop_back()\r
        {\r
                producers_.pop_back();\r
-               return L"";\r
+               return "";\r
        }\r
        \r
-       std::wstring clear()\r
+       std::string clear()\r
        {\r
                producers_.clear();\r
-               return L"";\r
+               return "";\r
        }\r
 \r
-       std::wstring next()\r
+       std::string next()\r
        {\r
                if(!producers_.empty())\r
                {\r
@@ -180,40 +180,40 @@ struct playlist_producer : public frame_producer
                        //if(loop_)\r
                        //      producers_.push_back(current_);\r
                }\r
-               return L"";\r
+               return "";\r
        }\r
        \r
-       std::wstring  insert(size_t pos, const std::wstring& str)\r
+       std::string  insert(size_t pos, const std::string& str)\r
        {\r
                if(pos >= producers_.size())\r
                        BOOST_THROW_EXCEPTION(out_of_range());\r
                producers_.insert(std::begin(producers_) + pos, create_producer(factory_, str));\r
-               return L"";\r
+               return "";\r
        }\r
 \r
-       std::wstring  erase(size_t pos)\r
+       std::string  erase(size_t pos)\r
        {\r
                if(pos >= producers_.size())\r
                        BOOST_THROW_EXCEPTION(out_of_range());\r
                producers_.erase(std::begin(producers_) + pos);\r
-               return L"";\r
+               return "";\r
        }\r
 \r
-       std::wstring list() const\r
+       std::string list() const\r
        {\r
-               std::wstring result = L"<playlist>\n";\r
+               std::string result = "<playlist>\n";\r
                BOOST_FOREACH(auto& producer, producers_)               \r
-                       result += L"\t<producer>" + producer->print() + L"</producer>\n";\r
-               return result + L"</playlist>";\r
+                       result += "\t<producer>" + producer->print() + "</producer>\n";\r
+               return result + "</playlist>";\r
        }\r
 };\r
 \r
-safe_ptr<frame_producer> create_playlist_producer(const safe_ptr<core::frame_factory>& frame_factory, const std::vector<std::wstring>& params)\r
+safe_ptr<frame_producer> create_playlist_producer(const safe_ptr<core::frame_factory>& frame_factory, const std::vector<std::string>& params)\r
 {\r
-       if(boost::range::find(params, L"[PLAYLIST]") == params.end())\r
+       if(boost::range::find(params, "[PLAYLIST]") == params.end())\r
                return core::frame_producer::empty();\r
 \r
-       bool loop = boost::range::find(params, L"LOOP") != params.end();\r
+       bool loop = boost::range::find(params, "LOOP") != params.end();\r
 \r
        return make_safe<playlist_producer>(frame_factory, loop);\r
 }\r
index 23c130c3f000115ad382ad501fd0f2b8124ca760..e342024893586ef31d30733fa7ef803c803bb9e8 100644 (file)
@@ -29,6 +29,6 @@
 \r
 namespace caspar { namespace core {\r
        \r
-safe_ptr<frame_producer> create_playlist_producer(const safe_ptr<core::frame_factory>& frame_factory, const std::vector<std::wstring>& params);\r
+safe_ptr<frame_producer> create_playlist_producer(const safe_ptr<core::frame_factory>& frame_factory, const std::vector<std::string>& params);\r
 \r
 }}
\ No newline at end of file
index e3d22b3e38a6417a6516e47b69ebfb8acb302a8d..ac7788e5376fdbaded8af55f53f34d0e82be91fb 100644 (file)
@@ -86,17 +86,17 @@ struct separated_producer : public frame_producer
                return std::min(fill_producer_->nb_frames(), key_producer_->nb_frames());\r
        }\r
 \r
-       virtual std::wstring print() const override\r
+       virtual std::string print() const override\r
        {\r
-               return L"separated[fill:" + fill_producer_->print() + L"|key:" + key_producer_->print() + L"]";\r
+               return "separated[fill:" + fill_producer_->print() + "|key:" + key_producer_->print() + "]";\r
        }       \r
 \r
-       boost::property_tree::wptree info() const override\r
+       boost::property_tree::ptree info() const override\r
        {\r
-               boost::property_tree::wptree info;\r
-               info.add(L"type", L"separated-producer");\r
-               info.add_child(L"fill.producer",        fill_producer_->info());\r
-               info.add_child(L"key.producer", key_producer_->info());\r
+               boost::property_tree::ptree info;\r
+               info.add("type", "separated-producer");\r
+               info.add_child("fill.producer", fill_producer_->info());\r
+               info.add_child("key.producer",  key_producer_->info());\r
                return info;\r
        }\r
 };\r
index 2396e7be6b2368fa75ae80737531b428cdd3ae48..caccbf84a416cf561d01fc4725325bcff3cddf90 100644 (file)
@@ -55,8 +55,8 @@ public:
        tweened_transform()\r
                : duration_(0)\r
                , time_(0)\r
-               , tweener_(get_tweener(L"linear")){}\r
-       tweened_transform(const T& source, const T& dest, int duration, const std::wstring& tween = L"linear")\r
+               , tweener_(get_tweener("linear")){}\r
+       tweened_transform(const T& source, const T& dest, int duration, const std::string& tween = "linear")\r
                : source_(source)\r
                , dest_(dest)\r
                , duration_(duration)\r
@@ -94,7 +94,7 @@ public:
                : graph_(graph)\r
                , format_desc_(format_desc)\r
                , target_(target)\r
-               , executor_(L"stage")\r
+               , executor_("stage")\r
        {\r
                graph_->add_guide("tick-time", 0.5f);   \r
                graph_->set_color("tick-time", diagnostics::color(0.0f, 0.6f, 0.9f));   \r
@@ -167,7 +167,7 @@ public:
                        CASPAR_LOG_CURRENT_EXCEPTION();\r
                }               \r
        }\r
-               void set_transform(int index, const frame_transform& transform, unsigned int mix_duration, const std::wstring& tween)\r
+               void set_transform(int index, const frame_transform& transform, unsigned int mix_duration, const std::string& tween)\r
        {\r
                executor_.begin_invoke([=]\r
                {\r
@@ -177,7 +177,7 @@ public:
                }, high_priority);\r
        }\r
                                \r
-       void apply_transform(int index, const std::function<frame_transform(frame_transform)>& transform, unsigned int mix_duration, const std::wstring& tween)\r
+       void apply_transform(int index, const std::function<frame_transform(frame_transform)>& transform, unsigned int mix_duration, const std::string& tween)\r
        {\r
                executor_.begin_invoke([=]\r
                {\r
@@ -251,11 +251,11 @@ public:
                }, high_priority);\r
        }       \r
        \r
-       boost::unique_future<std::wstring> call(int index, bool foreground, const std::wstring& param)\r
+       boost::unique_future<std::string> call(int index, bool foreground, const std::string& param)\r
        {\r
                return std::move(*executor_.invoke([=]\r
                {\r
-                       return std::make_shared<boost::unique_future<std::wstring>>(std::move(layers_[index].call(foreground, param)));\r
+                       return std::make_shared<boost::unique_future<std::string>>(std::move(layers_[index].call(foreground, param)));\r
                }, high_priority));\r
        }\r
        \r
@@ -323,21 +323,21 @@ public:
                }, high_priority);\r
        }\r
 \r
-       boost::unique_future<boost::property_tree::wptree> info()\r
+       boost::unique_future<boost::property_tree::ptree> info()\r
        {\r
-               return std::move(executor_.begin_invoke([&]() -> boost::property_tree::wptree\r
+               return std::move(executor_.begin_invoke([&]() -> boost::property_tree::ptree\r
                {\r
-                       boost::property_tree::wptree info;\r
+                       boost::property_tree::ptree info;\r
                        BOOST_FOREACH(auto& layer, layers_)                     \r
-                               info.add_child(L"layers.layer", layer.second.info())\r
-                                       .add(L"index", layer.first);    \r
+                               info.add_child("layers.layer", layer.second.info())\r
+                                       .add("index", layer.first);     \r
                        return info;\r
                }, high_priority));\r
        }\r
 \r
-       boost::unique_future<boost::property_tree::wptree> info(int index)\r
+       boost::unique_future<boost::property_tree::ptree> info(int index)\r
        {\r
-               return std::move(executor_.begin_invoke([&]() -> boost::property_tree::wptree\r
+               return std::move(executor_.begin_invoke([&]() -> boost::property_tree::ptree\r
                {\r
                        return layers_[index].info();\r
                }, high_priority));\r
@@ -345,8 +345,8 @@ public:
 };\r
 \r
 stage::stage(const safe_ptr<diagnostics::graph>& graph, const safe_ptr<target_t>& target, const video_format_desc& format_desc) : impl_(new implementation(graph, target, format_desc)){}\r
-void stage::set_frame_transform(int index, const core::frame_transform& transform, unsigned int mix_duration, const std::wstring& tween){impl_->set_transform(index, transform, mix_duration, tween);}\r
-void stage::apply_frame_transform(int index, const std::function<core::frame_transform(core::frame_transform)>& transform, unsigned int mix_duration, const std::wstring& tween){impl_->apply_transform(index, transform, mix_duration, tween);}\r
+void stage::set_frame_transform(int index, const core::frame_transform& transform, unsigned int mix_duration, const std::string& tween){impl_->set_transform(index, transform, mix_duration, tween);}\r
+void stage::apply_frame_transform(int index, const std::function<core::frame_transform(core::frame_transform)>& transform, unsigned int mix_duration, const std::string& tween){impl_->apply_transform(index, transform, mix_duration, tween);}\r
 void stage::clear_transforms(int index){impl_->clear_transforms(index);}\r
 void stage::clear_transforms(){impl_->clear_transforms();}\r
 void stage::spawn_token(){impl_->spawn_token();}\r
@@ -361,8 +361,8 @@ void stage::swap_layer(int index, size_t other_index){impl_->swap_layer(index, o
 void stage::swap_layer(int index, size_t other_index, const safe_ptr<stage>& other){impl_->swap_layer(index, other_index, other);}\r
 boost::unique_future<safe_ptr<frame_producer>> stage::foreground(int index) {return impl_->foreground(index);}\r
 boost::unique_future<safe_ptr<frame_producer>> stage::background(int 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
+boost::unique_future<std::string> stage::call(int index, bool foreground, const std::string& 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
-boost::unique_future<boost::property_tree::wptree> stage::info(int index) const{return impl_->info(index);}\r
+boost::unique_future<boost::property_tree::ptree> stage::info() const{return impl_->info();}\r
+boost::unique_future<boost::property_tree::ptree> stage::info(int index) const{return impl_->info(index);}\r
 }}
\ No newline at end of file
index e6b989fcc93e9376ab9dbf34b8b156a4df5fce7a..db2f3c379eb0d9c3fbb39416c7afaf42148d866e 100644 (file)
@@ -47,8 +47,8 @@ public:
        \r
        // stage\r
        \r
-       void set_frame_transform(int index, const frame_transform& transform, unsigned int mix_duration = 0, const std::wstring& tween = L"linear");\r
-       void apply_frame_transform(int index, const std::function<frame_transform(frame_transform)>& transform, unsigned int mix_duration = 0, const std::wstring& tween = L"linear");\r
+       void set_frame_transform(int index, const frame_transform& transform, unsigned int mix_duration = 0, const std::string& tween = "linear");\r
+       void apply_frame_transform(int index, const std::function<frame_transform(frame_transform)>& transform, unsigned int mix_duration = 0, const std::string& tween = "linear");\r
        void clear_transforms(int index);\r
        void clear_transforms();\r
 \r
@@ -64,12 +64,12 @@ public:
        void swap_layer(int index, size_t other_index);\r
        void swap_layer(int index, size_t other_index, const safe_ptr<stage>& other);\r
        \r
-       boost::unique_future<std::wstring>                              call(int index, bool foreground, const std::wstring& param);\r
+       boost::unique_future<std::string>                               call(int index, bool foreground, const std::string& param);\r
        boost::unique_future<safe_ptr<frame_producer>>  foreground(int index);\r
        boost::unique_future<safe_ptr<frame_producer>>  background(int index);\r
 \r
-       boost::unique_future<boost::property_tree::wptree> info() const;\r
-       boost::unique_future<boost::property_tree::wptree> info(int layer) const;\r
+       boost::unique_future<boost::property_tree::ptree> info() const;\r
+       boost::unique_future<boost::property_tree::ptree> info(int layer) const;\r
        \r
        void set_video_format_desc(const video_format_desc& format_desc);\r
 \r
index 7c32d094f3d2c7bc6189f244c9abec52e3748678..26251f69b0c44528d878b4e6815c5f43252fff4f 100644 (file)
@@ -32,8 +32,6 @@
 \r
 #include <boost/assign.hpp>\r
 \r
-using namespace boost::assign;\r
-\r
 namespace caspar { namespace core {    \r
 \r
 struct transition_producer : public frame_producer\r
@@ -103,17 +101,17 @@ struct transition_producer : public frame_producer
                return get_following_producer()->nb_frames();\r
        }\r
 \r
-       virtual std::wstring print() const override\r
+       virtual std::string print() const override\r
        {\r
-               return L"transition[" + source_producer_->print() + L"|" + dest_producer_->print() + L"]";\r
+               return "transition[" + source_producer_->print() + "|" + dest_producer_->print() + "]";\r
        }\r
        \r
-       boost::property_tree::wptree info() const override\r
+       boost::property_tree::ptree info() const override\r
        {\r
-               boost::property_tree::wptree info;\r
-               info.add(L"type", L"transition-producer");\r
-               info.add_child(L"source.producer",         source_producer_->info());\r
-               info.add_child(L"destination.producer", dest_producer_->info());\r
+               boost::property_tree::ptree info;\r
+               info.add("type", "transition-producer");\r
+               info.add_child("source.producer",          source_producer_->info());\r
+               info.add_child("destination.producer", dest_producer_->info());\r
                return info;\r
        }\r
 \r
index b185d109efc17efd9d45c8e2f07f9555ea6a56e1..c7602216b3fc5fba452e34733d99993000fa3ff4 100644 (file)
@@ -59,7 +59,7 @@ struct transition_info
                : type(transition::cut)\r
                , duration(0)\r
                , direction(transition_direction::from_left)\r
-               , tweener(get_tweener(L"linear")){}\r
+               , tweener(get_tweener("linear")){}\r
                \r
        size_t                                          duration;\r
        transition_direction::type      direction;\r
index 458a59d141f82e0c7efd85b29cbdaec856af0aa0..d20615e873ce209cc67c3bed7ea3e72aa65d45c8 100644 (file)
@@ -62,7 +62,7 @@ public:
                graph_->set_text(print());\r
                diagnostics::register_graph(graph_);\r
 \r
-               for(int n = 0; n < std::max(1, env::properties().get(L"configuration.pipeline-tokens", 2)); ++n)\r
+               for(int n = 0; n < std::max(1, env::properties().get("configuration.pipeline-tokens", 2)); ++n)\r
                        stage_->spawn_token();\r
 \r
                CASPAR_LOG(info) << print() << " Successfully Initialized.";\r
@@ -85,14 +85,14 @@ public:
                format_desc_ = format_desc;\r
        }\r
                \r
-       std::wstring print() const\r
+       std::string print() const\r
        {\r
-               return L"video_channel[" + boost::lexical_cast<std::wstring>(index_) + L"|" +  format_desc_.name + L"]";\r
+               return "video_channel[" + boost::lexical_cast<std::string>(index_) + "|" +  format_desc_.name + "]";\r
        }\r
 \r
-       boost::property_tree::wptree info() const\r
+       boost::property_tree::ptree info() const\r
        {\r
-               boost::property_tree::wptree info;\r
+               boost::property_tree::ptree info;\r
 \r
                auto stage_info  = stage_->info();\r
                auto mixer_info  = mixer_->info();\r
@@ -102,10 +102,10 @@ public:
                mixer_info.timed_wait(boost::posix_time::seconds(2));\r
                output_info.timed_wait(boost::posix_time::seconds(2));\r
                \r
-               info.add(L"video-mode", format_desc_.name);\r
-               info.add_child(L"stage", stage_info.get());\r
-               info.add_child(L"mixer", mixer_info.get());\r
-               info.add_child(L"output", output_info.get());\r
+               info.add("video-mode", format_desc_.name);\r
+               info.add_child("stage", stage_info.get());\r
+               info.add_child("mixer", mixer_info.get());\r
+               info.add_child("output", output_info.get());\r
    \r
                return info;                       \r
        }\r
@@ -117,6 +117,6 @@ safe_ptr<mixer> video_channel::mixer() { return impl_->mixer_;}
 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
+boost::property_tree::ptree video_channel::info() const{return impl_->info();}\r
 \r
 }}
\ No newline at end of file
index 51c2267ff2ba992e652cd89f7b2925c6ab36f892..b6e9ead0cfbbc9583ef92339bc6bcf294cb10e32 100644 (file)
@@ -47,7 +47,7 @@ public:
        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
+       boost::property_tree::ptree info() const;\r
 \r
 private:\r
        struct implementation;\r
index 1a15474d661fb83464985c145dc6252f766d032d..aeda24efff5144d20846df48dd2b0b101175ccc4 100644 (file)
@@ -50,23 +50,23 @@ namespace caspar { namespace core {
        \r
 const video_format_desc format_descs[video_format::count] =  \r
 {                                                                         \r
-       DEFINE_VIDEOFORMATDESC(video_format::pal                ,720,  576,  1024, 576,  field_mode::upper,                     25,             1,               boost::assign::list_of(3840),                                                  L"PAL"), \r
-       DEFINE_VIDEOFORMATDESC(video_format::ntsc               ,720,  486,  720,  534,  field_mode::lower,                     30000,  1001,    boost::assign::list_of(3204)(3202)(3204)(3202)(3204),  L"NTSC"), \r
-       DEFINE_VIDEOFORMATDESC(video_format::x576p2500  ,720,  576,  720,  576,  field_mode::progressive,       25,             1,               boost::assign::list_of(3840),                                                  L"576p2500"),\r
-       DEFINE_VIDEOFORMATDESC(video_format::x720p2500  ,1280, 720,  1280, 720,  field_mode::progressive,       25,             1,               boost::assign::list_of(3840),                                                  L"720p2500"), \r
-       DEFINE_VIDEOFORMATDESC(video_format::x720p5000  ,1280, 720,  1280, 720,  field_mode::progressive,       50,             1,               boost::assign::list_of(1920),                                                  L"720p5000"), \r
-       DEFINE_VIDEOFORMATDESC(video_format::x720p5994  ,1280, 720,  1280, 720,  field_mode::progressive,       60000,  1001,    boost::assign::list_of(1602)(1601)(1602)(1601)(1602),  L"720p5994"),\r
-       DEFINE_VIDEOFORMATDESC(video_format::x720p6000  ,1280, 720,  1280, 720,  field_mode::progressive,       60,             1,               boost::assign::list_of(1600),                                                  L"720p6000"),\r
-       DEFINE_VIDEOFORMATDESC(video_format::x1080p2397 ,1920, 1080, 1920, 1080, field_mode::progressive,       24000,  1001,    boost::assign::list_of(4004),                                                  L"1080p2398"),\r
-       DEFINE_VIDEOFORMATDESC(video_format::x1080p2400 ,1920, 1080, 1920, 1080, field_mode::progressive,       24,             1,               boost::assign::list_of(4000),                                                  L"1080p2400"),\r
-       DEFINE_VIDEOFORMATDESC(video_format::x1080i5000 ,1920, 1080, 1920, 1080, field_mode::upper,                     25,             1,               boost::assign::list_of(3840),                                                  L"1080i5000"),\r
-       DEFINE_VIDEOFORMATDESC(video_format::x1080i5994 ,1920, 1080, 1920, 1080, field_mode::upper,                     30000,  1001,    boost::assign::list_of(3204)(3202)(3204)(3202)(3204),  L"1080i5994"),\r
-       DEFINE_VIDEOFORMATDESC(video_format::x1080i6000 ,1920, 1080, 1920, 1080, field_mode::upper,                     30,             1,               boost::assign::list_of(3200),                                                  L"1080i6000"),\r
-       DEFINE_VIDEOFORMATDESC(video_format::x1080p2500 ,1920, 1080, 1920, 1080, field_mode::progressive,       25,             1,               boost::assign::list_of(3840),                                                  L"1080p2500"),\r
-       DEFINE_VIDEOFORMATDESC(video_format::x1080p2997 ,1920, 1080, 1920, 1080, field_mode::progressive,       30000,  1001,    boost::assign::list_of(3204)(3202)(3204)(3202)(3204),  L"1080p2997"),\r
-       DEFINE_VIDEOFORMATDESC(video_format::x1080p3000 ,1920, 1080, 1920, 1080, field_mode::progressive,       30,             1,               boost::assign::list_of(3200),                                                  L"1080p3000"),\r
-       DEFINE_VIDEOFORMATDESC(video_format::x1080p5000 ,1920, 1080, 1920, 1080, field_mode::progressive,       50,             1,               boost::assign::list_of(1920),                                                  L"1080p5000"),\r
-       DEFINE_VIDEOFORMATDESC(video_format::invalid    ,0,             0,   0,         0,   field_mode::progressive,   1,              1,               boost::assign::list_of(1),                                                             L"invalid")\r
+       DEFINE_VIDEOFORMATDESC(video_format::pal                ,720,  576,  1024, 576,  field_mode::upper,                     25,             1,               boost::assign::list_of(3840),                                                  "PAL"), \r
+       DEFINE_VIDEOFORMATDESC(video_format::ntsc               ,720,  486,  720,  534,  field_mode::lower,                     30000,  1001,    boost::assign::list_of(3204)(3202)(3204)(3202)(3204),  "NTSC"), \r
+       DEFINE_VIDEOFORMATDESC(video_format::x576p2500  ,720,  576,  720,  576,  field_mode::progressive,       25,             1,               boost::assign::list_of(3840),                                                  "576p2500"),\r
+       DEFINE_VIDEOFORMATDESC(video_format::x720p2500  ,1280, 720,  1280, 720,  field_mode::progressive,       25,             1,               boost::assign::list_of(3840),                                                  "720p2500"), \r
+       DEFINE_VIDEOFORMATDESC(video_format::x720p5000  ,1280, 720,  1280, 720,  field_mode::progressive,       50,             1,               boost::assign::list_of(1920),                                                  "720p5000"), \r
+       DEFINE_VIDEOFORMATDESC(video_format::x720p5994  ,1280, 720,  1280, 720,  field_mode::progressive,       60000,  1001,    boost::assign::list_of(1602)(1601)(1602)(1601)(1602),  "720p5994"),\r
+       DEFINE_VIDEOFORMATDESC(video_format::x720p6000  ,1280, 720,  1280, 720,  field_mode::progressive,       60,             1,               boost::assign::list_of(1600),                                                  "720p6000"),\r
+       DEFINE_VIDEOFORMATDESC(video_format::x1080p2397 ,1920, 1080, 1920, 1080, field_mode::progressive,       24000,  1001,    boost::assign::list_of(4004),                                                  "1080p2398"),\r
+       DEFINE_VIDEOFORMATDESC(video_format::x1080p2400 ,1920, 1080, 1920, 1080, field_mode::progressive,       24,             1,               boost::assign::list_of(4000),                                                  "1080p2400"),\r
+       DEFINE_VIDEOFORMATDESC(video_format::x1080i5000 ,1920, 1080, 1920, 1080, field_mode::upper,                     25,             1,               boost::assign::list_of(3840),                                                  "1080i5000"),\r
+       DEFINE_VIDEOFORMATDESC(video_format::x1080i5994 ,1920, 1080, 1920, 1080, field_mode::upper,                     30000,  1001,    boost::assign::list_of(3204)(3202)(3204)(3202)(3204),  "1080i5994"),\r
+       DEFINE_VIDEOFORMATDESC(video_format::x1080i6000 ,1920, 1080, 1920, 1080, field_mode::upper,                     30,             1,               boost::assign::list_of(3200),                                                  "1080i6000"),\r
+       DEFINE_VIDEOFORMATDESC(video_format::x1080p2500 ,1920, 1080, 1920, 1080, field_mode::progressive,       25,             1,               boost::assign::list_of(3840),                                                  "1080p2500"),\r
+       DEFINE_VIDEOFORMATDESC(video_format::x1080p2997 ,1920, 1080, 1920, 1080, field_mode::progressive,       30000,  1001,    boost::assign::list_of(3204)(3202)(3204)(3202)(3204),  "1080p2997"),\r
+       DEFINE_VIDEOFORMATDESC(video_format::x1080p3000 ,1920, 1080, 1920, 1080, field_mode::progressive,       30,             1,               boost::assign::list_of(3200),                                                  "1080p3000"),\r
+       DEFINE_VIDEOFORMATDESC(video_format::x1080p5000 ,1920, 1080, 1920, 1080, field_mode::progressive,       50,             1,               boost::assign::list_of(1920),                                                  "1080p5000"),\r
+       DEFINE_VIDEOFORMATDESC(video_format::invalid    ,0,             0,   0,         0,   field_mode::progressive,   1,              1,               boost::assign::list_of(1),                                                             "invalid")\r
 };\r
 \r
 const video_format_desc& video_format_desc::get(video_format::type format)     \r
@@ -74,11 +74,11 @@ const video_format_desc& video_format_desc::get(video_format::type format)
        return format_descs[format];\r
 }\r
 \r
-const video_format_desc& video_format_desc::get(const std::wstring& name)      \r
+const video_format_desc& video_format_desc::get(const std::string& name)       \r
 {\r
        for(int n = 0; n < video_format::invalid; ++n)\r
        {\r
-               if(boost::iequals(format_descs[n].name, name))\r
+               if(iequals(format_descs[n].name, name))\r
                        return format_descs[n];\r
        }\r
        return format_descs[video_format::invalid];\r
index 593671540f613f0efab44333f116bd1545ad0027..e5e5d61dc1d8c4562086dda15ff3d0c346212a80 100644 (file)
@@ -61,18 +61,18 @@ struct field_mode
                progressive = 3 // NOTE: progressive == lower | upper;\r
        };\r
 \r
-       static std::wstring print(field_mode::type value)\r
+       static std::string print(field_mode::type value)\r
        {\r
                switch(value)\r
                {\r
                        case progressive:\r
-                               return L"progressive"; \r
+                               return "progressive"; \r
                        case lower:\r
-                               return L"lower";\r
+                               return "lower";\r
                        case upper:\r
-                               return L"upper";\r
+                               return "upper";\r
                        default:\r
-                               return L"invalid";\r
+                               return "invalid";\r
                }\r
        }\r
 };\r
@@ -91,14 +91,14 @@ struct video_format_desc
        size_t                                  duration;\r
        size_t                                  field_count;\r
        size_t                                  size;           // output frame size in bytes \r
-       std::wstring                    name;           // name of output format\r
+       std::string                             name;           // name of output format\r
 \r
        size_t                                  audio_sample_rate;\r
        size_t                                  audio_channels;\r
        std::vector<size_t>             audio_cadence;\r
 \r
        static const video_format_desc& get(video_format::type format);\r
-       static const video_format_desc& get(const std::wstring& name);\r
+       static const video_format_desc& get(const std::string& name);\r
        \r
        bool operator==(const video_format_desc& lhs)\r
        {\r
index 3c06a32bcc4f39c0e8524c0641c15bd50fd23da9..7b27c579e6564d35471136c65992c4712181fb28 100644 (file)
@@ -39,7 +39,7 @@ void init()
        try\r
        {\r
                blue_initialize();\r
-               core::register_consumer_factory([](const std::vector<std::wstring>& params)\r
+               core::register_consumer_factory([](const std::vector<std::string>& params)\r
                {\r
                        return create_consumer(params);\r
                });\r
@@ -47,7 +47,7 @@ void init()
        catch(...){}\r
 }\r
 \r
-std::wstring get_version()\r
+std::string get_version()\r
 {\r
        try\r
        {\r
@@ -55,18 +55,18 @@ std::wstring get_version()
        }\r
        catch(...)\r
        {\r
-               return L"Not found";\r
+               return "Not found";\r
        }\r
 \r
        if(!BlueVelvetVersion)\r
-               return L"Unknown";\r
+               return "Unknown";\r
 \r
-       return widen(std::string(BlueVelvetVersion()));\r
+       return std::string(BlueVelvetVersion());\r
 }\r
 \r
-std::vector<std::wstring> get_device_list()\r
+std::vector<std::string> get_device_list()\r
 {\r
-       std::vector<std::wstring> devices;\r
+       std::vector<std::string> devices;\r
 \r
        try\r
        {               \r
@@ -76,7 +76,7 @@ std::vector<std::wstring> get_device_list()
 \r
                for(int n = 1; BLUE_PASS(blue->device_attach(n, FALSE)); ++n)\r
                {                               \r
-                       devices.push_back(std::wstring(get_card_desc(*blue)) + L" [" + boost::lexical_cast<std::wstring>(n) + L"]");\r
+                       devices.push_back(std::string(get_card_desc(*blue)) + " [" + boost::lexical_cast<std::string>(n) + "]");\r
                        blue->device_detach();          \r
                }\r
        }\r
index 17188767253e4b9c0a4094df579bec15b61f1654..122d848a174224902c58e5c846b5594038a3a91b 100644 (file)
@@ -28,7 +28,7 @@ namespace caspar { namespace bluefish {
 \r
 void init();\r
 \r
-std::wstring get_version();\r
-std::vector<std::wstring> get_device_list();\r
+std::string get_version();\r
+std::vector<std::string> get_device_list();\r
 \r
 }}
\ No newline at end of file
index 6beadf6beda9724ff6d6c05992e5874e6401f3f5..54057fa30d1fcd825ccae733ac71737b7cfcfaa7 100644 (file)
@@ -56,7 +56,7 @@ struct bluefish_consumer : boost::noncopyable
        const core::video_format_desc           format_desc_;\r
        const int                                                       channel_index_;\r
 \r
-       const std::wstring                                      model_name_;\r
+       const std::string                                       model_name_;\r
 \r
        safe_ptr<diagnostics::graph>            graph_;\r
        boost::timer                                            frame_timer_;\r
@@ -96,24 +96,24 @@ public:
                        \r
                //Setting output Video mode\r
                if(BLUE_FAIL(set_card_property(blue_, VIDEO_MODE, vid_fmt_))) \r
-                       BOOST_THROW_EXCEPTION(caspar_exception() << msg_info(narrow(print()) + " Failed to set videomode."));\r
+                       BOOST_THROW_EXCEPTION(caspar_exception() << msg_info(print() + " Failed to set videomode."));\r
 \r
                //Select Update Mode for output\r
                if(BLUE_FAIL(set_card_property(blue_, VIDEO_UPDATE_TYPE, UPD_FMT_FRAME))) \r
-                       BOOST_THROW_EXCEPTION(caspar_exception() << msg_info(narrow(print()) + " Failed to set update type."));\r
+                       BOOST_THROW_EXCEPTION(caspar_exception() << msg_info(print() + " Failed to set update type."));\r
        \r
                disable_video_output();\r
 \r
                //Enable dual link output\r
                if(BLUE_FAIL(set_card_property(blue_, VIDEO_DUAL_LINK_OUTPUT, 1)))\r
-                       BOOST_THROW_EXCEPTION(caspar_exception() << msg_info(narrow(print()) + " Failed to enable dual link."));\r
+                       BOOST_THROW_EXCEPTION(caspar_exception() << msg_info(print() + " Failed to enable dual link."));\r
 \r
                if(BLUE_FAIL(set_card_property(blue_, VIDEO_DUAL_LINK_OUTPUT_SIGNAL_FORMAT_TYPE, Signal_FormatType_4224)))\r
-                       BOOST_THROW_EXCEPTION(caspar_exception() << msg_info(narrow(print()) + " Failed to set dual link format type to 4:2:2:4."));\r
+                       BOOST_THROW_EXCEPTION(caspar_exception() << msg_info(print() + " Failed to set dual link format type to 4:2:2:4."));\r
                        \r
                //Select output memory format\r
                if(BLUE_FAIL(set_card_property(blue_, VIDEO_MEMORY_FORMAT, MEM_FMT_ARGB_PC))) \r
-                       BOOST_THROW_EXCEPTION(caspar_exception() << msg_info(narrow(print()) + " Failed to set memory format."));\r
+                       BOOST_THROW_EXCEPTION(caspar_exception() << msg_info(print() + " Failed to set memory format."));\r
                \r
                //Select image orientation\r
                if(BLUE_FAIL(set_card_property(blue_, VIDEO_IMAGE_ORIENTATION, ImageOrientation_Normal)))\r
@@ -284,10 +284,10 @@ public:
                        encode_hanc_frame_ex(blue_->has_video_cardtype(), &hanc_stream_info, audio_data, audio_nchannels, audio_samples, sample_type, emb_audio_flag);\r
        }\r
        \r
-       std::wstring print() const\r
+       std::string print() const\r
        {\r
-               return model_name_ + L" [" + boost::lexical_cast<std::wstring>(channel_index_) + L"-" + \r
-                       boost::lexical_cast<std::wstring>(device_index_) + L"|" +  format_desc_.name + L"]";\r
+               return model_name_ + " [" + boost::lexical_cast<std::string>(channel_index_) + "-" + \r
+                       boost::lexical_cast<std::string>(device_index_) + "|" +  format_desc_.name + "]";\r
        }\r
 };\r
 \r
@@ -313,7 +313,7 @@ public:
                {\r
                        auto str = print();\r
                        consumer_.reset();\r
-                       CASPAR_LOG(info) << str << L" Successfully Uninitialized.";     \r
+                       CASPAR_LOG(info) << str << " Successfully Uninitialized.";      \r
                }\r
        }\r
 \r
@@ -323,7 +323,7 @@ public:
        {\r
                consumer_.reset(new bluefish_consumer(format_desc, device_index_, embedded_audio_, key_only_, channel_index));\r
                audio_cadence_ = format_desc.audio_cadence;\r
-               CASPAR_LOG(info) << print() << L" Successfully Initialized.";   \r
+               CASPAR_LOG(info) << print() << " Successfully Initialized.";    \r
        }\r
        \r
        virtual bool send(const safe_ptr<core::read_frame>& frame) override\r
@@ -335,18 +335,18 @@ public:
                return true;\r
        }\r
                \r
-       virtual std::wstring print() const override\r
+       virtual std::string print() const override\r
        {\r
-               return consumer_ ? consumer_->print() : L"[bluefish_consumer]";\r
+               return consumer_ ? consumer_->print() : "[bluefish_consumer]";\r
        }\r
 \r
-       virtual boost::property_tree::wptree info() const override\r
+       virtual boost::property_tree::ptree info() const override\r
        {\r
-               boost::property_tree::wptree info;\r
-               info.add(L"type", L"bluefish-consumer");\r
-               info.add(L"key-only", key_only_);\r
-               info.add(L"device", device_index_);\r
-               info.add(L"embedded-audio", embedded_audio_);\r
+               boost::property_tree::ptree info;\r
+               info.add("type", "bluefish-consumer");\r
+               info.add("key-only", key_only_);\r
+               info.add("device", device_index_);\r
+               info.add("embedded-audio", embedded_audio_);\r
                return info;\r
        }\r
 \r
@@ -361,24 +361,24 @@ public:
        }\r
 };     \r
 \r
-safe_ptr<core::frame_consumer> create_consumer(const std::vector<std::wstring>& params)\r
+safe_ptr<core::frame_consumer> create_consumer(const std::vector<std::string>& params)\r
 {\r
-       if(params.size() < 1 || params[0] != L"BLUEFISH")\r
+       if(params.size() < 1 || params[0] != "BLUEFISH")\r
                return core::frame_consumer::empty();\r
                \r
        const auto device_index = params.size() > 1 ? lexical_cast_or_default<int>(params[1], 1) : 1;\r
 \r
-       const auto embedded_audio = std::find(params.begin(), params.end(), L"EMBEDDED_AUDIO") != params.end();\r
-       const auto key_only               = std::find(params.begin(), params.end(), L"KEY_ONLY")           != params.end();\r
+       const auto embedded_audio = std::find(params.begin(), params.end(), "EMBEDDED_AUDIO") != params.end();\r
+       const auto key_only               = std::find(params.begin(), params.end(), "KEY_ONLY")    != params.end();\r
 \r
        return make_safe<bluefish_consumer_proxy>(device_index, embedded_audio, key_only);\r
 }\r
 \r
-safe_ptr<core::frame_consumer> create_consumer(const boost::property_tree::wptree& ptree) \r
+safe_ptr<core::frame_consumer> create_consumer(const boost::property_tree::ptree& ptree) \r
 {      \r
-       const auto device_index         = ptree.get(L"device",                  1);\r
-       const auto embedded_audio       = ptree.get(L"embedded-audio",  false);\r
-       const auto key_only                     = ptree.get(L"key-only",                false);\r
+       const auto device_index         = ptree.get("device",                   1);\r
+       const auto embedded_audio       = ptree.get("embedded-audio",   false);\r
+       const auto key_only                     = ptree.get("key-only",         false);\r
 \r
        return make_safe<bluefish_consumer_proxy>(device_index, embedded_audio, key_only);\r
 }\r
index 2be5389752a45431bc41a8ea2166ce9d53c2974a..22e1490b22081e6c6cc96fd59fcc16dcb662040e 100644 (file)
@@ -35,7 +35,7 @@ namespace core {
         \r
 namespace bluefish {\r
 \r
-safe_ptr<core::frame_consumer> create_consumer(const std::vector<std::wstring>& params);\r
-safe_ptr<core::frame_consumer> create_consumer(const boost::property_tree::wptree& ptree);\r
+safe_ptr<core::frame_consumer> create_consumer(const std::vector<std::string>& params);\r
+safe_ptr<core::frame_consumer> create_consumer(const boost::property_tree::ptree& ptree);\r
 \r
 }}
\ No newline at end of file
index d6771ab37f1dba0b94513d03c6a8cbdeca219001..d0e39343692fd213e7b49c90d6d2c89662270fe0 100644 (file)
@@ -43,11 +43,11 @@ void blue_velvet_initialize()
        std::string module_str = "BlueVelvet3.dll";\r
 #endif\r
 \r
-       auto module = LoadLibrary(widen(module_str).c_str());\r
+       auto module = LoadLibrary(u16(module_str).c_str());\r
        if(!module)\r
-               LoadLibrary(widen(std::string(getenv("SystemDrive")) + "\\Program Files\\Bluefish444\\Driver\\" + module_str).c_str());\r
+               LoadLibrary(u16(std::string(getenv("SystemDrive")) + "\\Program Files\\Bluefish444\\Driver\\" + module_str).c_str());\r
        if(!module)\r
-               LoadLibrary(widen(std::string(getenv("SystemDrive")) + "\\Program Files (x86)\\BlueFish444\\Driver\\" + module_str).c_str());\r
+               LoadLibrary(u16(std::string(getenv("SystemDrive")) + "\\Program Files (x86)\\BlueFish444\\Driver\\" + module_str).c_str());\r
        if(!module)\r
                BOOST_THROW_EXCEPTION(file_not_found() << msg_info("Could not find BlueVelvet3.dll. Required drivers are not installed."));\r
        static std::shared_ptr<void> lib(module, FreeLibrary);\r
@@ -64,11 +64,11 @@ void blue_hanc_initialize()
        std::string module_str = "BlueHancUtils.dll";\r
 #endif\r
        \r
-       auto module = LoadLibrary(widen(module_str).c_str());\r
+       auto module = LoadLibrary(u16(module_str).c_str());\r
        if(!module)\r
-               LoadLibrary(widen(std::string(getenv("SystemDrive")) + "\\Program Files\\Bluefish444\\Driver\\" + module_str).c_str());\r
+               LoadLibrary(u16(std::string(getenv("SystemDrive")) + "\\Program Files\\Bluefish444\\Driver\\" + module_str).c_str());\r
        if(!module)\r
-               LoadLibrary(widen(std::string(getenv("SystemDrive")) + "\\Program Files (x86)\\BlueFish444\\Driver\\" + module_str).c_str());\r
+               LoadLibrary(u16(std::string(getenv("SystemDrive")) + "\\Program Files (x86)\\BlueFish444\\Driver\\" + module_str).c_str());\r
        if(!module)\r
                BOOST_THROW_EXCEPTION(file_not_found() << msg_info("Could not find BlueHancUtils.dll. Required drivers are not installed."));\r
        static std::shared_ptr<void> lib(module, FreeLibrary);\r
@@ -126,44 +126,44 @@ bool is_epoch_card(CBlueVelvet4& blue)
        }\r
 }\r
 \r
-std::wstring get_card_desc(CBlueVelvet4& blue)\r
+std::string get_card_desc(CBlueVelvet4& blue)\r
 {\r
        switch(blue.has_video_cardtype()) \r
        {\r
-       case CRD_BLUEDEEP_LT:                           return L"Deepblue LT";// D64 Lite\r
-       case CRD_BLUEDEEP_SD:                           return L"Iridium SD";// Iridium SD\r
-       case CRD_BLUEDEEP_AV:                           return L"Iridium AV";// Iridium AV\r
-       case CRD_BLUEDEEP_IO:                           return L"Deepblue IO";// D64 Full\r
-       case CRD_BLUEWILD_AV:                           return L"Wildblue AV";// D64 AV\r
-       case CRD_IRIDIUM_HD:                            return L"Iridium HD";// * Iridium HD\r
-       case CRD_BLUEWILD_RT:                           return L"Wildblue RT";// D64 RT\r
-       case CRD_BLUEWILD_HD:                           return L"Wildblue HD";// * BadAss G2\r
-       case CRD_REDDEVIL:                                      return L"Iridium Full";// Iridium Full\r
+       case CRD_BLUEDEEP_LT:                           return "Deepblue LT";// D64 Lite\r
+       case CRD_BLUEDEEP_SD:                           return "Iridium SD";// Iridium SD\r
+       case CRD_BLUEDEEP_AV:                           return "Iridium AV";// Iridium AV\r
+       case CRD_BLUEDEEP_IO:                           return "Deepblue IO";// D64 Full\r
+       case CRD_BLUEWILD_AV:                           return "Wildblue AV";// D64 AV\r
+       case CRD_IRIDIUM_HD:                            return "Iridium HD";// * Iridium HD\r
+       case CRD_BLUEWILD_RT:                           return "Wildblue RT";// D64 RT\r
+       case CRD_BLUEWILD_HD:                           return "Wildblue HD";// * BadAss G2\r
+       case CRD_REDDEVIL:                                      return "Iridium Full";// Iridium Full\r
        case CRD_BLUEDEEP_HD:   \r
-       case CRD_BLUEDEEP_HDS:                          return L"Reserved for \"BasAss G2";// * BadAss G2 variant, proposed, reserved\r
-       case CRD_BLUE_ENVY:                                     return L"Blue Envy"; // Mini Din \r
-       case CRD_BLUE_PRIDE:                            return L"Blue Pride";//Mini Din Output \r
-       case CRD_BLUE_GREED:                            return L"Blue Greed";\r
-       case CRD_BLUE_INGEST:                           return L"Blue Ingest";\r
-       case CRD_BLUE_SD_DUALLINK:                      return L"Blue SD Duallink";\r
-       case CRD_BLUE_CATALYST:                         return L"Blue Catalyst";\r
-       case CRD_BLUE_SD_DUALLINK_PRO:          return L"Blue SD Duallink Pro";\r
-       case CRD_BLUE_SD_INGEST_PRO:            return L"Blue SD Ingest pro";\r
-       case CRD_BLUE_SD_DEEPBLUE_LITE_PRO:     return L"Blue SD Deepblue lite Pro";\r
-       case CRD_BLUE_SD_SINGLELINK_PRO:        return L"Blue SD Singlelink Pro";\r
-       case CRD_BLUE_SD_IRIDIUM_AV_PRO:        return L"Blue SD Iridium AV Pro";\r
-       case CRD_BLUE_SD_FIDELITY:                      return L"Blue SD Fidelity";\r
-       case CRD_BLUE_SD_FOCUS:                         return L"Blue SD Focus";\r
-       case CRD_BLUE_SD_PRIME:                         return L"Blue SD Prime";\r
-       case CRD_BLUE_EPOCH_2K_CORE:            return L"Blue Epoch 2K Core";\r
-       case CRD_BLUE_EPOCH_2K_ULTRA:           return L"Blue Epoch 2K Ultra";\r
-       case CRD_BLUE_EPOCH_HORIZON:            return L"Blue Epoch Horizon";\r
-       case CRD_BLUE_EPOCH_CORE:                       return L"Blue Epoch Core";\r
-       case CRD_BLUE_EPOCH_ULTRA:                      return L"Blue Epoch Ultra";\r
-       case CRD_BLUE_CREATE_HD:                        return L"Blue Create HD";\r
-       case CRD_BLUE_CREATE_2K:                        return L"Blue Create 2K";\r
-       case CRD_BLUE_CREATE_2K_ULTRA:          return L"Blue Create 2K Ultra";\r
-       default:                                                        return L"Unknown";\r
+       case CRD_BLUEDEEP_HDS:                          return "Reserved for \"BasAss G2";// * BadAss G2 variant, proposed, reserved\r
+       case CRD_BLUE_ENVY:                                     return "Blue Envy"; // Mini Din \r
+       case CRD_BLUE_PRIDE:                            return "Blue Pride";//Mini Din Output \r
+       case CRD_BLUE_GREED:                            return "Blue Greed";\r
+       case CRD_BLUE_INGEST:                           return "Blue Ingest";\r
+       case CRD_BLUE_SD_DUALLINK:                      return "Blue SD Duallink";\r
+       case CRD_BLUE_CATALYST:                         return "Blue Catalyst";\r
+       case CRD_BLUE_SD_DUALLINK_PRO:          return "Blue SD Duallink Pro";\r
+       case CRD_BLUE_SD_INGEST_PRO:            return "Blue SD Ingest pro";\r
+       case CRD_BLUE_SD_DEEPBLUE_LITE_PRO:     return "Blue SD Deepblue lite Pro";\r
+       case CRD_BLUE_SD_SINGLELINK_PRO:        return "Blue SD Singlelink Pro";\r
+       case CRD_BLUE_SD_IRIDIUM_AV_PRO:        return "Blue SD Iridium AV Pro";\r
+       case CRD_BLUE_SD_FIDELITY:                      return "Blue SD Fidelity";\r
+       case CRD_BLUE_SD_FOCUS:                         return "Blue SD Focus";\r
+       case CRD_BLUE_SD_PRIME:                         return "Blue SD Prime";\r
+       case CRD_BLUE_EPOCH_2K_CORE:            return "Blue Epoch 2K Core";\r
+       case CRD_BLUE_EPOCH_2K_ULTRA:           return "Blue Epoch 2K Ultra";\r
+       case CRD_BLUE_EPOCH_HORIZON:            return "Blue Epoch Horizon";\r
+       case CRD_BLUE_EPOCH_CORE:                       return "Blue Epoch Core";\r
+       case CRD_BLUE_EPOCH_ULTRA:                      return "Blue Epoch Ultra";\r
+       case CRD_BLUE_CREATE_HD:                        return "Blue Create HD";\r
+       case CRD_BLUE_CREATE_2K:                        return "Blue Create 2K";\r
+       case CRD_BLUE_CREATE_2K_ULTRA:          return "Blue Create 2K Ultra";\r
+       default:                                                        return "Unknown";\r
        }\r
 }\r
 \r
@@ -179,7 +179,7 @@ EVideoMode get_video_mode(CBlueVelvet4& blue, const core::video_format_desc& for
                        vid_fmt = videoMode;                    \r
        }\r
        if(vid_fmt == VID_FMT_INVALID)\r
-               BOOST_THROW_EXCEPTION(caspar_exception() << msg_info("video-mode not supported.") << arg_value_info(narrow(format_desc.name)));\r
+               BOOST_THROW_EXCEPTION(caspar_exception() << msg_info("video-mode not supported.") << arg_value_info((format_desc.name)));\r
 \r
        return vid_fmt;\r
 }\r
index 7895cd4802191506a47baed8eaec229e4c3ba55a..51dcd76ee541310f325cb8cf969b0f26784ab580 100644 (file)
@@ -48,7 +48,7 @@ void blue_initialize();
 safe_ptr<CBlueVelvet4> create_blue();\r
 safe_ptr<CBlueVelvet4> create_blue(size_t device_index);\r
 bool is_epoch_card(CBlueVelvet4& blue);\r
-std::wstring get_card_desc(CBlueVelvet4& blue);\r
+std::string get_card_desc(CBlueVelvet4& blue);\r
 EVideoMode get_video_mode(CBlueVelvet4& blue, const core::video_format_desc& format_desc);\r
 \r
 template<typename T>\r
index ad8573c9ad64dd4e3e42bc69d4e3019c8f47ad17..5fb6681cbd5c85e3491965b8623d3ee133d00dff 100644 (file)
@@ -152,7 +152,7 @@ struct decklink_consumer : public IDeckLinkVideoOutputCallback, public IDeckLink
 \r
        tbb::atomic<bool>                                       is_running_;\r
                \r
-       const std::wstring                                      model_name_;\r
+       const std::string                                       model_name_;\r
        const core::video_format_desc           format_desc_;\r
        const size_t                                            buffer_size_;\r
 \r
@@ -238,12 +238,12 @@ public:
                if(!low_latency)\r
                {\r
                        configuration_->SetFlag(bmdDeckLinkConfigLowLatencyVideoOutput, false);\r
-                       CASPAR_LOG(info) << print() << L" Enabled normal-latency mode";\r
+                       CASPAR_LOG(info) << print() << " Enabled normal-latency mode";\r
                }\r
                else\r
                {                       \r
                        configuration_->SetFlag(bmdDeckLinkConfigLowLatencyVideoOutput, true);\r
-                       CASPAR_LOG(info) << print() << L" Enabled low-latency mode";\r
+                       CASPAR_LOG(info) << print() << " Enabled low-latency mode";\r
                }\r
        }\r
 \r
@@ -252,49 +252,49 @@ public:
                if(internal_key) \r
                {\r
                        if(FAILED(keyer_->Enable(FALSE)))                       \r
-                               CASPAR_LOG(error) << print() << L" Failed to enable internal keyer.";                   \r
+                               CASPAR_LOG(error) << print() << " Failed to enable internal keyer.";                    \r
                        else if(FAILED(keyer_->SetLevel(255)))                  \r
-                               CASPAR_LOG(error) << print() << L" Failed to set key-level to max.";\r
+                               CASPAR_LOG(error) << print() << " Failed to set key-level to max.";\r
                        else\r
-                               CASPAR_LOG(info) << print() << L" Enabled internal keyer.";             \r
+                               CASPAR_LOG(info) << print() << " Enabled internal keyer.";              \r
                }\r
                else\r
                {\r
                        if(FAILED(keyer_->Enable(TRUE)))                        \r
-                               CASPAR_LOG(error) << print() << L" Failed to enable external keyer.";   \r
+                               CASPAR_LOG(error) << print() << " Failed to enable external keyer.";    \r
                        else if(FAILED(keyer_->SetLevel(255)))                  \r
-                               CASPAR_LOG(error) << print() << L" Failed to set key-level to max.";\r
+                               CASPAR_LOG(error) << print() << " Failed to set key-level to max.";\r
                        else\r
-                               CASPAR_LOG(info) << print() << L" Enabled external keyer.";                     \r
+                               CASPAR_LOG(info) << print() << " Enabled external keyer.";                      \r
                }\r
        }\r
        \r
        void enable_audio()\r
        {\r
                if(FAILED(output_->EnableAudioOutput(bmdAudioSampleRate48kHz, bmdAudioSampleType32bitInteger, 2, bmdAudioOutputStreamTimestamped)))\r
-                               BOOST_THROW_EXCEPTION(caspar_exception() << msg_info(narrow(print()) + " Could not enable audio output."));\r
+                               BOOST_THROW_EXCEPTION(caspar_exception() << msg_info(print() + " Could not enable audio output."));\r
                                \r
                if(FAILED(output_->SetAudioCallback(this)))\r
-                       BOOST_THROW_EXCEPTION(caspar_exception() << msg_info(narrow(print()) + " Could not set audio callback."));\r
+                       BOOST_THROW_EXCEPTION(caspar_exception() << msg_info(print() + " Could not set audio callback."));\r
 \r
-               CASPAR_LOG(info) << print() << L" Enabled embedded-audio.";\r
+               CASPAR_LOG(info) << print() << " Enabled embedded-audio.";\r
        }\r
 \r
        void enable_video(BMDDisplayMode display_mode)\r
        {\r
                if(FAILED(output_->EnableVideoOutput(display_mode, bmdVideoOutputFlagDefault))) \r
-                       BOOST_THROW_EXCEPTION(caspar_exception() << msg_info(narrow(print()) + " Could not enable video output."));\r
+                       BOOST_THROW_EXCEPTION(caspar_exception() << msg_info(print() + " Could not enable video output."));\r
                \r
                if(FAILED(output_->SetScheduledFrameCompletionCallback(this)))\r
                        BOOST_THROW_EXCEPTION(caspar_exception() \r
-                                                                       << msg_info(narrow(print()) + " Failed to set playback completion callback.")\r
+                                                                       << msg_info(print() + " Failed to set playback completion callback.")\r
                                                                        << boost::errinfo_api_function("SetScheduledFrameCompletionCallback"));\r
        }\r
 \r
        void start_playback()\r
        {\r
                if(FAILED(output_->StartScheduledPlayback(0, format_desc_.time_scale, 1.0))) \r
-                       BOOST_THROW_EXCEPTION(caspar_exception() << msg_info(narrow(print()) + " Failed to schedule playback."));\r
+                       BOOST_THROW_EXCEPTION(caspar_exception() << msg_info(print() + " Failed to schedule playback."));\r
        }\r
        \r
        STDMETHOD (QueryInterface(REFIID, LPVOID*))     {return E_NOINTERFACE;}\r
@@ -304,7 +304,7 @@ public:
        STDMETHOD(ScheduledPlaybackHasStopped())\r
        {\r
                is_running_ = false;\r
-               CASPAR_LOG(info) << print() << L" Scheduled playback has stopped.";\r
+               CASPAR_LOG(info) << print() << " Scheduled playback has stopped.";\r
                return S_OK;\r
        }\r
 \r
@@ -393,7 +393,7 @@ public:
                audio_container_.push_back(std::vector<int32_t>(audio_data.begin(), audio_data.end()));\r
 \r
                if(FAILED(output_->ScheduleAudioSamples(audio_container_.back().data(), sample_frame_count, audio_scheduled_, format_desc_.audio_sample_rate, nullptr)))\r
-                       CASPAR_LOG(error) << print() << L" Failed to schedule audio.";\r
+                       CASPAR_LOG(error) << print() << " Failed to schedule audio.";\r
 \r
                audio_scheduled_ += sample_frame_count;\r
        }\r
@@ -402,7 +402,7 @@ public:
        {\r
                CComPtr<IDeckLinkVideoFrame> frame2(new decklink_frame(frame, format_desc_, config_.key_only));\r
                if(FAILED(output_->ScheduleVideoFrame(frame2, video_scheduled_, format_desc_.duration, format_desc_.time_scale)))\r
-                       CASPAR_LOG(error) << print() << L" Failed to schedule video.";\r
+                       CASPAR_LOG(error) << print() << " Failed to schedule video.";\r
 \r
                video_scheduled_ += format_desc_.duration;\r
 \r
@@ -419,17 +419,17 @@ public:
                }\r
 \r
                if(!is_running_)\r
-                       BOOST_THROW_EXCEPTION(caspar_exception() << msg_info(narrow(print()) + " Is not running."));\r
+                       BOOST_THROW_EXCEPTION(caspar_exception() << msg_info(print() + " Is not running."));\r
                \r
                if(config_.embedded_audio)\r
                        audio_frame_buffer_.push(frame);        \r
                video_frame_buffer_.push(frame);        \r
        }\r
        \r
-       std::wstring print() const\r
+       std::string print() const\r
        {\r
-               return model_name_ + L" [" + boost::lexical_cast<std::wstring>(channel_index_) + L"-" +\r
-                       boost::lexical_cast<std::wstring>(config_.device_index) + L"|" +  format_desc_.name + L"]";\r
+               return model_name_ + " [" + boost::lexical_cast<std::string>(channel_index_) + "-" +\r
+                       boost::lexical_cast<std::string>(config_.device_index) + "|" +  format_desc_.name + "]";\r
        }\r
 };\r
 \r
@@ -442,7 +442,7 @@ public:
 \r
        decklink_consumer_proxy(const configuration& config)\r
                : config_(config)\r
-               , context_(L"decklink_consumer[" + boost::lexical_cast<std::wstring>(config.device_index) + L"]")\r
+               , context_("decklink_consumer[" + boost::lexical_cast<std::string>(config.device_index) + "]")\r
        {\r
        }\r
 \r
@@ -452,7 +452,7 @@ public:
                {\r
                        auto str = print();\r
                        context_.reset();\r
-                       CASPAR_LOG(info) << str << L" Successfully Uninitialized.";     \r
+                       CASPAR_LOG(info) << str << " Successfully Uninitialized.";      \r
                }\r
        }\r
 \r
@@ -463,7 +463,7 @@ public:
                context_.reset([&]{return new decklink_consumer(config_, format_desc, channel_index);});                \r
                audio_cadence_ = format_desc.audio_cadence;             \r
 \r
-               CASPAR_LOG(info) << print() << L" Successfully Initialized.";   \r
+               CASPAR_LOG(info) << print() << " Successfully Initialized.";    \r
        }\r
        \r
        virtual bool send(const safe_ptr<core::read_frame>& frame) override\r
@@ -475,21 +475,21 @@ public:
                return true;\r
        }\r
        \r
-       virtual std::wstring print() const override\r
+       virtual std::string print() const override\r
        {\r
-               return context_ ? context_->print() : L"[decklink_consumer]";\r
+               return context_ ? context_->print() : "[decklink_consumer]";\r
        }               \r
 \r
-       virtual boost::property_tree::wptree info() const override\r
+       virtual boost::property_tree::ptree info() const override\r
        {\r
-               boost::property_tree::wptree info;\r
-               info.add(L"type", L"decklink-consumer");\r
-               info.add(L"key-only", config_.key_only);\r
-               info.add(L"device", config_.device_index);\r
-               info.add(L"low-latency", config_.low_latency);\r
-               info.add(L"embedded-audio", config_.embedded_audio);\r
-               info.add(L"low-latency", config_.low_latency);\r
-               info.add(L"internal-key", config_.internal_key);\r
+               boost::property_tree::ptree info;\r
+               info.add("type", "decklink-consumer");\r
+               info.add("key-only", config_.key_only);\r
+               info.add("device", config_.device_index);\r
+               info.add("low-latency", config_.low_latency);\r
+               info.add("embedded-audio", config_.embedded_audio);\r
+               info.add("low-latency", config_.low_latency);\r
+               info.add("internal-key", config_.internal_key);\r
                return info;\r
        }\r
 \r
@@ -504,9 +504,9 @@ public:
        }\r
 };     \r
 \r
-safe_ptr<core::frame_consumer> create_consumer(const std::vector<std::wstring>& params) \r
+safe_ptr<core::frame_consumer> create_consumer(const std::vector<std::string>& params) \r
 {\r
-       if(params.size() < 1 || params[0] != L"DECKLINK")\r
+       if(params.size() < 1 || params[0] != "DECKLINK")\r
                return core::frame_consumer::empty();\r
        \r
        configuration config;\r
@@ -514,24 +514,24 @@ safe_ptr<core::frame_consumer> create_consumer(const std::vector<std::wstring>&
        if(params.size() > 1)\r
                config.device_index = lexical_cast_or_default<int>(params[1], config.device_index);\r
        \r
-       config.internal_key             = std::find(params.begin(), params.end(), L"INTERNAL_KEY")       != params.end();\r
-       config.low_latency              = std::find(params.begin(), params.end(), L"LOW_LATENCY")        != params.end();\r
-       config.embedded_audio   = std::find(params.begin(), params.end(), L"EMBEDDED_AUDIO") != params.end();\r
-       config.key_only                 = std::find(params.begin(), params.end(), L"KEY_ONLY")           != params.end();\r
+       config.internal_key             = std::find(params.begin(), params.end(), "INTERNAL_KEY")        != params.end();\r
+       config.low_latency              = std::find(params.begin(), params.end(), "LOW_LATENCY")         != params.end();\r
+       config.embedded_audio   = std::find(params.begin(), params.end(), "EMBEDDED_AUDIO") != params.end();\r
+       config.key_only                 = std::find(params.begin(), params.end(), "KEY_ONLY")            != params.end();\r
 \r
        return make_safe<decklink_consumer_proxy>(config);\r
 }\r
 \r
-safe_ptr<core::frame_consumer> create_consumer(const boost::property_tree::wptree& ptree) \r
+safe_ptr<core::frame_consumer> create_consumer(const boost::property_tree::ptree& ptree) \r
 {\r
        configuration config;\r
 \r
-       config.internal_key                     = ptree.get(L"internal-key",    config.internal_key);\r
-       config.low_latency                      = ptree.get(L"low-latency",             config.low_latency);\r
-       config.key_only                         = ptree.get(L"key-only",                config.key_only);\r
-       config.device_index                     = ptree.get(L"device",                  config.device_index);\r
-       config.embedded_audio           = ptree.get(L"embedded-audio",  config.embedded_audio);\r
-       config.base_buffer_depth        = ptree.get(L"buffer-depth",    config.base_buffer_depth);\r
+       config.internal_key                     = ptree.get("internal-key",     config.internal_key);\r
+       config.low_latency                      = ptree.get("low-latency",              config.low_latency);\r
+       config.key_only                         = ptree.get("key-only",         config.key_only);\r
+       config.device_index                     = ptree.get("device",                   config.device_index);\r
+       config.embedded_audio           = ptree.get("embedded-audio",   config.embedded_audio);\r
+       config.base_buffer_depth        = ptree.get("buffer-depth",     config.base_buffer_depth);\r
 \r
        return make_safe<decklink_consumer_proxy>(config);\r
 }\r
index 02d9b180d7677bf415cbab94cd06164ba3e74b57..efeb3e544d792db1471288ae53bc7cc126aaa053 100644 (file)
@@ -38,7 +38,7 @@ namespace core {
 \r
 namespace decklink {\r
 \r
-safe_ptr<core::frame_consumer> create_consumer(const std::vector<std::wstring>& params);\r
-safe_ptr<core::frame_consumer> create_consumer(const boost::property_tree::wptree& ptree);\r
+safe_ptr<core::frame_consumer> create_consumer(const std::vector<std::string>& params);\r
+safe_ptr<core::frame_consumer> create_consumer(const boost::property_tree::ptree& ptree);\r
 \r
 }}
\ No newline at end of file
index 8e28967da82d75ae30ddca1f0f978595caa47687..4a8ec9ead05966282ab0d4da92a3461da831b399 100644 (file)
@@ -56,13 +56,13 @@ void init()
        if(FAILED(pDecklinkIterator.CoCreateInstance(CLSID_CDeckLinkIterator)))         \r
                return;\r
                \r
-       core::register_consumer_factory([](const std::vector<std::wstring>& params){return create_consumer(params);});\r
+       core::register_consumer_factory([](const std::vector<std::string>& params){return create_consumer(params);});\r
        core::register_producer_factory(create_producer);\r
 }\r
 \r
-std::wstring get_version() \r
+std::string get_version() \r
 {\r
-       std::wstring version = L"Not found";\r
+       std::string version = "Not found";\r
        \r
        struct co_init\r
        {\r
@@ -81,9 +81,9 @@ std::wstring get_version()
        return version;\r
 }\r
 \r
-std::vector<std::wstring> get_device_list()\r
+std::vector<std::string> get_device_list()\r
 {\r
-       std::vector<std::wstring> devices;\r
+       std::vector<std::string> devices;\r
        \r
        struct co_init\r
        {\r
@@ -101,7 +101,7 @@ std::vector<std::wstring> get_device_list()
                        {\r
                                BSTR model_name = L"Unknown";\r
                                decklink->GetModelName(&model_name);\r
-                               devices.push_back(std::wstring(model_name) + L" [" + boost::lexical_cast<std::wstring>(n) + L"]");      \r
+                               devices.push_back(u8(model_name) + " [" + boost::lexical_cast<std::string>(n) + "]");   \r
                        }\r
                }\r
        }\r
index 0dff05db8983ada3ddff46c997472a5392b701d2..ed3fee383adc763ecf5e4456319284544037a016 100644 (file)
@@ -28,7 +28,7 @@ namespace caspar { namespace decklink {
 \r
 void init();\r
 \r
-std::wstring get_version();\r
-std::vector<std::wstring> get_device_list();\r
+std::string get_version();\r
+std::vector<std::string> get_device_list();\r
 \r
 }}
\ No newline at end of file
index d0871fea9f0eb7ea6356b39b19c4f27d129d589a..b1f3460394a4242788a3c2f5bb0774717ead9f6c 100644 (file)
@@ -82,7 +82,7 @@ class decklink_producer : boost::noncopyable, public IDeckLinkInputCallback
        CComPtr<IDeckLink>                                                                                      decklink_;\r
        CComQIPtr<IDeckLinkInput>                                                                       input_;\r
        \r
-       const std::wstring                                                                                      model_name_;\r
+       const std::string                                                                                       model_name_;\r
        const core::video_format_desc                                                           format_desc_;\r
        const size_t                                                                                            device_index_;\r
 \r
@@ -101,7 +101,7 @@ class decklink_producer : boost::noncopyable, public IDeckLinkInputCallback
        ffmpeg::frame_muxer                                                                                     muxer_;\r
 \r
 public:\r
-       decklink_producer(const core::video_format_desc& format_desc, size_t device_index, const safe_ptr<core::frame_factory>& frame_factory, const std::wstring& filter)\r
+       decklink_producer(const core::video_format_desc& format_desc, size_t device_index, const safe_ptr<core::frame_factory>& frame_factory, const std::string& filter)\r
                : decklink_(get_device(device_index))\r
                , input_(decklink_)\r
                , model_name_(get_model_name(decklink_))\r
@@ -128,25 +128,25 @@ public:
                // NOTE: bmdFormat8BitARGB is currently not supported by any decklink card. (2011-05-08)\r
                if(FAILED(input_->EnableVideoInput(display_mode, bmdFormat8BitYUV, 0))) \r
                        BOOST_THROW_EXCEPTION(caspar_exception() \r
-                                                                       << msg_info(narrow(print()) + " Could not enable video input.")\r
+                                                                       << msg_info(print() + " Could not enable video input.")\r
                                                                        << boost::errinfo_api_function("EnableVideoInput"));\r
 \r
                if(FAILED(input_->EnableAudioInput(bmdAudioSampleRate48kHz, bmdAudioSampleType32bitInteger, format_desc_.audio_channels))) \r
                        BOOST_THROW_EXCEPTION(caspar_exception() \r
-                                                                       << msg_info(narrow(print()) + " Could not enable audio input.")\r
+                                                                       << msg_info(print() + " Could not enable audio input.")\r
                                                                        << boost::errinfo_api_function("EnableAudioInput"));\r
                        \r
                if (FAILED(input_->SetCallback(this)) != S_OK)\r
                        BOOST_THROW_EXCEPTION(caspar_exception() \r
-                                                                       << msg_info(narrow(print()) + " Failed to set input callback.")\r
+                                                                       << msg_info(print() + " Failed to set input callback.")\r
                                                                        << boost::errinfo_api_function("SetCallback"));\r
                        \r
                if(FAILED(input_->StartStreams()))\r
                        BOOST_THROW_EXCEPTION(caspar_exception() \r
-                                                                       << msg_info(narrow(print()) + " Failed to start input stream.")\r
+                                                                       << msg_info(print() + " Failed to start input stream.")\r
                                                                        << boost::errinfo_api_function("StartStreams"));\r
                \r
-               CASPAR_LOG(info) << print() << L" Successfully Initialized.";\r
+               CASPAR_LOG(info) << print() << " Successfully Initialized.";\r
        }\r
 \r
        ~decklink_producer()\r
@@ -244,9 +244,9 @@ public:
                return frame;\r
        }\r
        \r
-       std::wstring print() const\r
+       std::string print() const\r
        {\r
-               return model_name_ + L" [" + boost::lexical_cast<std::wstring>(device_index_) + L"]";\r
+               return model_name_ + " [" + boost::lexical_cast<std::string>(device_index_) + "]";\r
        }\r
 };\r
        \r
@@ -257,8 +257,8 @@ class decklink_producer_proxy : public core::frame_producer
        const uint32_t                                  length_;\r
 public:\r
 \r
-       explicit decklink_producer_proxy(const safe_ptr<core::frame_factory>& frame_factory, const core::video_format_desc& format_desc, size_t device_index, const std::wstring& filter_str, uint32_t length)\r
-               : context_(L"decklink_producer[" + boost::lexical_cast<std::wstring>(device_index) + L"]")\r
+       explicit decklink_producer_proxy(const safe_ptr<core::frame_factory>& frame_factory, const core::video_format_desc& format_desc, size_t device_index, const std::string& filter_str, uint32_t length)\r
+               : context_("decklink_producer[" + boost::lexical_cast<std::string>(device_index) + "]")\r
                , last_frame_(core::basic_frame::empty())\r
                , length_(length)\r
        {\r
@@ -269,7 +269,7 @@ public:
        {\r
                auto str = print();\r
                context_.reset();\r
-               CASPAR_LOG(info) << str << L" Successfully Uninitialized.";     \r
+               CASPAR_LOG(info) << str << " Successfully Uninitialized.";      \r
        }\r
 \r
        // frame_producer\r
@@ -292,31 +292,31 @@ public:
                return length_;\r
        }\r
        \r
-       std::wstring print() const override\r
+       std::string print() const override\r
        {\r
                return context_->print();\r
        }\r
 \r
-       virtual boost::property_tree::wptree info() const override\r
+       virtual boost::property_tree::ptree info() const override\r
        {\r
-               boost::property_tree::wptree info;\r
-               info.add(L"type", L"decklink-producer");\r
+               boost::property_tree::ptree info;\r
+               info.add("type", "decklink-producer");\r
                return info;\r
        }\r
 };\r
 \r
-safe_ptr<core::frame_producer> create_producer(const safe_ptr<core::frame_factory>& frame_factory, const std::vector<std::wstring>& params)\r
+safe_ptr<core::frame_producer> create_producer(const safe_ptr<core::frame_factory>& frame_factory, const std::vector<std::string>& params)\r
 {\r
-       if(params.empty() || !boost::iequals(params[0], "decklink"))\r
+       if(params.empty() || !iequals(params[0], "decklink"))\r
                return core::frame_producer::empty();\r
 \r
-       auto device_index       = get_param(L"DEVICE", params, 1);\r
-       auto filter_str         = get_param(L"FILTER", params);         \r
-       auto length                     = get_param(L"LENGTH", params, std::numeric_limits<uint32_t>::max());   \r
-       auto format_desc        = core::video_format_desc::get(get_param(L"FORMAT", params, L"INVALID"));\r
+       auto device_index       = get_param("DEVICE", params, 1);\r
+       auto filter_str         = get_param("FILTER", params);  \r
+       auto length                     = get_param("LENGTH", params, std::numeric_limits<uint32_t>::max());    \r
+       auto format_desc        = core::video_format_desc::get(get_param("FORMAT", params, "INVALID"));\r
        \r
-       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
+       boost::replace_all(filter_str, "DEINTERLACE", "YADIF=0:-1");\r
+       boost::replace_all(filter_str, "DEINTERLACE_BOB", "YADIF=1:-1");\r
        \r
        if(format_desc.format == core::video_format::invalid)\r
                format_desc = frame_factory->get_video_format_desc();\r
index a190ec58e862f44d24ff9872e533aa3371fd642f..74a3678c319f090176a36eae71604f809f703ad8 100644 (file)
@@ -28,6 +28,6 @@
 \r
 namespace caspar { namespace decklink {\r
        \r
-safe_ptr<core::frame_producer> create_producer(const safe_ptr<core::frame_factory>& frame_factory, const std::vector<std::wstring>& params);\r
+safe_ptr<core::frame_producer> create_producer(const safe_ptr<core::frame_factory>& frame_factory, const std::vector<std::string>& params);\r
 \r
 }}\r
index 504d46d2dd399a309d6502c7c73cc8de4bd40e95..41a4f85f8121df76d5f9d84082619040012a8099 100644 (file)
@@ -101,12 +101,12 @@ BMDDisplayMode get_display_mode(const T& device, BMDDisplayMode format, BMDPixel
                \r
        BMDDisplayModeSupport displayModeSupport;\r
        if(FAILED(device->DoesSupportVideoMode(mode->GetDisplayMode(), pix_fmt, flag, &displayModeSupport, nullptr)) || displayModeSupport == bmdDisplayModeNotSupported)\r
-               CASPAR_LOG(warning) << L"Device does not support video-format: " << mode->GetDisplayMode();\r
+               CASPAR_LOG(warning) << "Device does not support video-format: " << mode->GetDisplayMode();\r
                //BOOST_THROW_EXCEPTION(caspar_exception() << msg_info("Device does not support requested video-format.")\r
                //                                                                               << arg_value_info(boost::lexical_cast<std::string>(format))\r
                //                                                                               << arg_name_info("format"));\r
        else if(displayModeSupport == bmdDisplayModeSupportedWithConversion)\r
-               CASPAR_LOG(warning) << L"Device supports video-format with conversion: " << mode->GetDisplayMode();\r
+               CASPAR_LOG(warning) << "Device supports video-format with conversion: " << mode->GetDisplayMode();\r
 \r
        return mode->GetDisplayMode();\r
 }\r
@@ -118,16 +118,16 @@ static BMDDisplayMode get_display_mode(const T& device, core::video_format::type
 }\r
 \r
 template<typename T>\r
-static std::wstring get_version(T& iterator)\r
+static std::string get_version(T& iterator)\r
 {\r
        CComQIPtr<IDeckLinkAPIInformation> info = iterator;\r
        if (!info)\r
-               return L"Unknown";\r
+               return "Unknown";\r
        \r
        BSTR ver;               \r
        info->GetString(BMDDeckLinkAPIVersion, &ver);\r
                \r
-       return ver;                                     \r
+       return u8(ver);                                 \r
 }\r
 \r
 static CComPtr<IDeckLink> get_device(size_t device_index)\r
@@ -147,11 +147,11 @@ static CComPtr<IDeckLink> get_device(size_t device_index)
 }\r
 \r
 template <typename T>\r
-static std::wstring get_model_name(const T& device)\r
+static std::string get_model_name(const T& device)\r
 {      \r
        BSTR pModelName;\r
        device->GetModelName(&pModelName);\r
-       return std::wstring(pModelName);\r
+       return u8(pModelName);\r
 }\r
 \r
 }}
\ No newline at end of file
index ff162446959aa11e263b7ea0406b97b6db315906..8de03206ad737171830dcb34458fb07955a535eb 100644 (file)
@@ -94,11 +94,11 @@ public:
                , oc_(avformat_alloc_context(), av_free)\r
                , format_desc_(format_desc)\r
                , executor_(print())\r
-               , file_write_executor_(print() + L"/output")\r
+               , file_write_executor_(print() + "/output")\r
                , frame_number_(0)\r
        {\r
                // TODO: Ask stakeholders about case where file already exists.\r
-               boost::filesystem2::remove(boost::filesystem2::wpath(env::media_folder() + widen(filename))); // Delete the file if it exists\r
+               boost::filesystem2::remove(boost::filesystem2::path(env::media_folder() + filename)); // Delete the file if it exists\r
 \r
                graph_->add_guide("frame-time", 0.5);\r
                graph_->set_color("frame-time", diagnostics::color(0.1f, 1.0f, 0.1f));\r
@@ -133,7 +133,7 @@ public:
                                \r
                THROW_ON_ERROR2(av_write_header(oc_.get()), "[ffmpeg_consumer]");\r
 \r
-               CASPAR_LOG(info) << print() << L" Successfully Initialized.";   \r
+               CASPAR_LOG(info) << print() << " Successfully Initialized.";    \r
        }\r
 \r
        ~ffmpeg_consumer()\r
@@ -152,12 +152,12 @@ public:
                if (!(oc_->oformat->flags & AVFMT_NOFILE)) \r
                        LOG_ON_ERROR2(avio_close(oc_->pb), "[ffmpeg_consumer]"); // Close the output ffmpeg.\r
 \r
-               CASPAR_LOG(info) << print() << L" Successfully Uninitialized."; \r
+               CASPAR_LOG(info) << print() << " Successfully Uninitialized.";  \r
        }\r
                        \r
-       std::wstring print() const\r
+       std::string print() const\r
        {\r
-               return L"ffmpeg[" + widen(filename_) + L"]";\r
+               return "ffmpeg[" + filename_ + "]";\r
        }\r
 \r
        std::shared_ptr<AVStream> add_video_stream(enum CodecID codec_id, const std::string& options)\r
@@ -382,19 +382,19 @@ public:
 \r
 struct ffmpeg_consumer_proxy : public core::frame_consumer\r
 {\r
-       const std::wstring      filename_;\r
+       const std::string       filename_;\r
        const bool                      key_only_;\r
-       const std::wstring      codec_;\r
-       const std::wstring      options_;\r
+       const std::string       codec_;\r
+       const std::string       options_;\r
 \r
        std::unique_ptr<ffmpeg_consumer> consumer_;\r
 \r
 public:\r
 \r
-       ffmpeg_consumer_proxy(const std::wstring& filename, bool key_only, const std::wstring codec, const std::wstring& options)\r
+       ffmpeg_consumer_proxy(const std::string& filename, bool key_only, const std::string codec, const std::string& options)\r
                : filename_(filename)\r
                , key_only_(key_only)\r
-               , codec_(boost::to_lower_copy(codec))\r
+               , codec_(to_lower_copy(codec))\r
                , options_(options)\r
        {\r
        }\r
@@ -402,7 +402,7 @@ public:
        virtual void initialize(const core::video_format_desc& format_desc, int)\r
        {\r
                consumer_.reset();\r
-               consumer_.reset(new ffmpeg_consumer(narrow(filename_), format_desc, narrow(codec_), narrow(options_)));\r
+               consumer_.reset(new ffmpeg_consumer((filename_), format_desc, codec_, options_));\r
        }\r
        \r
        virtual bool send(const safe_ptr<core::read_frame>& frame) override\r
@@ -411,19 +411,19 @@ public:
                return true;\r
        }\r
        \r
-       virtual std::wstring print() const override\r
+       virtual std::string print() const override\r
        {\r
-               return consumer_ ? consumer_->print() : L"[ffmpeg_consumer]";\r
+               return consumer_ ? consumer_->print() : "[ffmpeg_consumer]";\r
        }\r
 \r
-       virtual boost::property_tree::wptree info() const override\r
+       virtual boost::property_tree::ptree info() const override\r
        {\r
-               boost::property_tree::wptree info;\r
-               info.add(L"type", L"ffmpeg-consumer");\r
-               info.add(L"key-only", key_only_);\r
-               info.add(L"filename", filename_);\r
-               info.add(L"codec", codec_);\r
-               info.add(L"options", options_);\r
+               boost::property_tree::ptree info;\r
+               info.add("type", "ffmpeg-consumer");\r
+               info.add("key-only", key_only_);\r
+               info.add("filename", filename_);\r
+               info.add("codec", codec_);\r
+               info.add("options", options_);\r
                return info;\r
        }\r
                \r
@@ -443,33 +443,33 @@ public:
        }\r
 };     \r
 \r
-safe_ptr<core::frame_consumer> create_consumer(const std::vector<std::wstring>& params)\r
+safe_ptr<core::frame_consumer> create_consumer(const std::vector<std::string>& params)\r
 {\r
-       if(params.size() < 1 || params[0] != L"FILE")\r
+       if(params.size() < 1 || params[0] != "FILE")\r
                return core::frame_consumer::empty();\r
        \r
-       auto filename   = (params.size() > 1 ? params[1] : L"");\r
-       bool key_only   = get_param(L"KEY_ONLY", params, false);\r
-       auto codec              = get_param(L"CODEC", params, L"libx264");\r
-       auto options    = get_param(L"OPTIONS", params);\r
+       auto filename   = (params.size() > 1 ? params[1] : "");\r
+       bool key_only   = get_param("KEY_ONLY", params, false);\r
+       auto codec              = get_param("CODEC", params, "libx264");\r
+       auto options    = get_param("OPTIONS", params);\r
        \r
-       if(codec == L"H264")\r
-               codec = L"libx264";\r
+       if(codec == "H264")\r
+               codec = "libx264";\r
 \r
-       if(codec == L"DVCPRO")\r
-               codec = L"dvvideo";\r
+       if(codec == "DVCPRO")\r
+               codec = "dvvideo";\r
 \r
-       boost::to_lower(options);\r
+       to_lower(options);\r
 \r
        return make_safe<ffmpeg_consumer_proxy>(env::media_folder() + filename, key_only, codec, options);\r
 }\r
 \r
-safe_ptr<core::frame_consumer> create_consumer(const boost::property_tree::wptree& ptree)\r
+safe_ptr<core::frame_consumer> create_consumer(const boost::property_tree::ptree& ptree)\r
 {\r
-       auto filename   = ptree.get<std::wstring>(L"path");\r
-       auto key_only   = ptree.get(L"key-only", false);\r
-       auto codec              = ptree.get(L"codec", L"libx264");\r
-       auto options    = ptree.get(L"options", L"");\r
+       auto filename   = ptree.get<std::string>("path");\r
+       auto key_only   = ptree.get("key-only", false);\r
+       auto codec              = ptree.get("codec", "libx264");\r
+       auto options    = ptree.get("options", "");\r
        \r
        return make_safe<ffmpeg_consumer_proxy>(env::media_folder() + filename, key_only, codec, options);\r
 }\r
index 9f27cdd36bbc5e0840e21f5820db0a718764e993..457f3425b3b1a5375365aeea5ef11ccdd078d1ef 100644 (file)
@@ -35,7 +35,7 @@ namespace core {
 namespace ffmpeg {\r
 \r
        \r
-safe_ptr<core::frame_consumer> create_consumer(const std::vector<std::wstring>& params);\r
-safe_ptr<core::frame_consumer> create_consumer(const boost::property_tree::wptree& ptree);\r
+safe_ptr<core::frame_consumer> create_consumer(const std::vector<std::string>& params);\r
+safe_ptr<core::frame_consumer> create_consumer(const boost::property_tree::ptree& ptree);\r
 \r
 }}
\ No newline at end of file
index 39f8977bb4bd660717e09d382efa58a4f6c108fc..e75c2f191f09a38eac08d96d4e2f7954721c28b1 100644 (file)
@@ -137,17 +137,17 @@ void log_callback(void* ptr, int level, const char* fmt, va_list vl)
     sanitize((uint8_t*)line);\r
        \r
        if(level == AV_LOG_DEBUG)\r
-               CASPAR_LOG(debug) << L"[ffmpeg] " << line;\r
+               CASPAR_LOG(debug) << "[ffmpeg] " << line;\r
        else if(level == AV_LOG_INFO)\r
-               CASPAR_LOG(info) << L"[ffmpeg] " << line;\r
+               CASPAR_LOG(info) << "[ffmpeg] " << line;\r
        else if(level == AV_LOG_WARNING)\r
-               CASPAR_LOG(warning) << L"[ffmpeg] " << line;\r
+               CASPAR_LOG(warning) << "[ffmpeg] " << line;\r
        else if(level == AV_LOG_ERROR)\r
-               CASPAR_LOG(error) << L"[ffmpeg] " << line;\r
+               CASPAR_LOG(error) << "[ffmpeg] " << line;\r
        else if(level == AV_LOG_FATAL)\r
-               CASPAR_LOG(fatal) << L"[ffmpeg] " << line;\r
+               CASPAR_LOG(fatal) << "[ffmpeg] " << line;\r
        else\r
-               CASPAR_LOG(trace) << L"[ffmpeg] " << line;\r
+               CASPAR_LOG(trace) << "[ffmpeg] " << line;\r
 \r
     //colored_fputs(av_clip(level>>3, 0, 6), line);\r
 }\r
@@ -195,52 +195,52 @@ void init()
 {\r
     avfilter_register_all();\r
        //fix_yadif_filter_format_query();\r
-       av_register_all();
+       av_register_all();\r
     avformat_network_init();\r
        avcodec_init();\r
     avcodec_register_all();\r
        av_lockmgr_register(ffmpeg_lock_callback);\r
        av_log_set_callback(log_callback);\r
        \r
-       core::register_consumer_factory([](const std::vector<std::wstring>& params){return create_consumer(params);});\r
+       core::register_consumer_factory([](const std::vector<std::string>& params){return create_consumer(params);});\r
        core::register_producer_factory(create_producer);\r
 }\r
 \r
 void uninit()\r
 {\r
-       avfilter_uninit();
+       avfilter_uninit();\r
     avformat_network_deinit();\r
        av_lockmgr_register(nullptr);\r
 }\r
 \r
-std::wstring make_version(unsigned int ver)\r
+std::string make_version(unsigned int ver)\r
 {\r
-       std::wstringstream str;\r
-       str << ((ver >> 16) & 0xFF) << L"." << ((ver >> 8) & 0xFF) << L"." << ((ver >> 0) & 0xFF);\r
+       std::stringstream str;\r
+       str << ((ver >> 16) & 0xFF) << "." << ((ver >> 8) & 0xFF) << "." << ((ver >> 0) & 0xFF);\r
        return str.str();\r
 }\r
 \r
-std::wstring get_avcodec_version()\r
+std::string get_avcodec_version()\r
 {\r
        return make_version(avcodec_version());\r
 }\r
 \r
-std::wstring get_avformat_version()\r
+std::string get_avformat_version()\r
 {\r
        return make_version(avformat_version());\r
 }\r
 \r
-std::wstring get_avutil_version()\r
+std::string get_avutil_version()\r
 {\r
        return make_version(avutil_version());\r
 }\r
 \r
-std::wstring get_avfilter_version()\r
+std::string get_avfilter_version()\r
 {\r
        return make_version(avfilter_version());\r
 }\r
 \r
-std::wstring get_swscale_version()\r
+std::string get_swscale_version()\r
 {\r
        return make_version(swscale_version());\r
 }\r
index 0c491878a1bfabaea372b7bd7df1573047f8d258..0db486b202204df0998abf1f8a15a66219af1514 100644 (file)
@@ -28,10 +28,10 @@ namespace caspar { namespace ffmpeg {
 void init();\r
 void uninit();\r
 \r
-std::wstring get_avcodec_version();\r
-std::wstring get_avformat_version();\r
-std::wstring get_avutil_version();\r
-std::wstring get_avfilter_version();\r
-std::wstring get_swscale_version();\r
+std::string get_avcodec_version();\r
+std::string get_avformat_version();\r
+std::string get_avutil_version();\r
+std::string get_avfilter_version();\r
+std::string get_swscale_version();\r
 \r
 }}
\ No newline at end of file
index 3d7fa6727607859218c881b8b81fb0718f5804b9..1508316762dffcd38f8872591918f7b6faad8018 100644 (file)
@@ -70,87 +70,87 @@ static void throw_on_ffmpeg_error(int ret, const char* source, const char* func,
        case AVERROR_BSF_NOT_FOUND:\r
                ::boost::exception_detail::throw_exception_(averror_bsf_not_found()<<                                                                           \r
                        msg_info(av_error_str(ret)) <<                                                  \r
-                       source_info(narrow(source)) <<                                          \r
+                       source_info((source)) <<                                                \r
                        boost::errinfo_api_function(func) <<                                    \r
                        boost::errinfo_errno(AVUNERROR(ret)), local_func, file, line);  \r
        case AVERROR_DECODER_NOT_FOUND:\r
                ::boost::exception_detail::throw_exception_(averror_decoder_not_found()<<                                                                               \r
                        msg_info(av_error_str(ret)) <<                                                  \r
-                       source_info(narrow(source)) <<                                          \r
+                       source_info((source)) <<                                                \r
                        boost::errinfo_api_function(func) <<                                    \r
                        boost::errinfo_errno(AVUNERROR(ret)), local_func, file, line);\r
        case AVERROR_DEMUXER_NOT_FOUND:\r
                ::boost::exception_detail::throw_exception_(averror_demuxer_not_found()<<                                                                               \r
                        msg_info(av_error_str(ret)) <<                                                  \r
-                       source_info(narrow(source)) <<                                          \r
+                       source_info((source)) <<                                                \r
                        boost::errinfo_api_function(func) <<                                    \r
                        boost::errinfo_errno(AVUNERROR(ret)), local_func, file, line);\r
        case AVERROR_ENCODER_NOT_FOUND:\r
                ::boost::exception_detail::throw_exception_(averror_encoder_not_found()<<                                                                               \r
                        msg_info(av_error_str(ret)) <<                                                  \r
-                       source_info(narrow(source)) <<                                          \r
+                       source_info((source)) <<                                                \r
                        boost::errinfo_api_function(func) <<                                    \r
                        boost::errinfo_errno(AVUNERROR(ret)), local_func, file, line);  \r
        case AVERROR_EOF:       \r
                ::boost::exception_detail::throw_exception_(averror_eof()<<                                                                             \r
                        msg_info(av_error_str(ret)) <<                                                  \r
-                       source_info(narrow(source)) <<                                          \r
+                       source_info((source)) <<                                                \r
                        boost::errinfo_api_function(func) <<                                    \r
                        boost::errinfo_errno(AVUNERROR(ret)), local_func, file, line);\r
        case AVERROR_EXIT:                              \r
                ::boost::exception_detail::throw_exception_(averror_exit()<<                                                                            \r
                        msg_info(av_error_str(ret)) <<                                                  \r
-                       source_info(narrow(source)) <<                                          \r
+                       source_info((source)) <<                                                \r
                        boost::errinfo_api_function(func) <<                                    \r
                        boost::errinfo_errno(AVUNERROR(ret)), local_func, file, line);\r
        case AVERROR_FILTER_NOT_FOUND:                          \r
                ::boost::exception_detail::throw_exception_(averror_filter_not_found()<<                                                                                \r
                        msg_info(av_error_str(ret)) <<                                                  \r
-                       source_info(narrow(source)) <<                                          \r
+                       source_info((source)) <<                                                \r
                        boost::errinfo_api_function(func) <<                                    \r
                        boost::errinfo_errno(AVUNERROR(ret)), local_func, file, line);\r
        case AVERROR_MUXER_NOT_FOUND:   \r
                ::boost::exception_detail::throw_exception_(averror_muxer_not_found()<<                                                                         \r
                        msg_info(av_error_str(ret)) <<                                                  \r
-                       source_info(narrow(source)) <<                                          \r
+                       source_info((source)) <<                                                \r
                        boost::errinfo_api_function(func) <<                                    \r
                        boost::errinfo_errno(AVUNERROR(ret)), local_func, file, line);\r
        case AVERROR_OPTION_NOT_FOUND:  \r
                ::boost::exception_detail::throw_exception_(averror_option_not_found()<<                                                                                \r
                        msg_info(av_error_str(ret)) <<                                                  \r
-                       source_info(narrow(source)) <<                                          \r
+                       source_info((source)) <<                                                \r
                        boost::errinfo_api_function(func) <<                                    \r
                        boost::errinfo_errno(AVUNERROR(ret)), local_func, file, line);\r
        case AVERROR_PATCHWELCOME:      \r
                ::boost::exception_detail::throw_exception_(averror_patchwelcome()<<                                                                            \r
                        msg_info(av_error_str(ret)) <<                                                  \r
-                       source_info(narrow(source)) <<                                          \r
+                       source_info((source)) <<                                                \r
                        boost::errinfo_api_function(func) <<                                    \r
                        boost::errinfo_errno(AVUNERROR(ret)), local_func, file, line);\r
        case AVERROR_PROTOCOL_NOT_FOUND:        \r
                ::boost::exception_detail::throw_exception_(averror_protocol_not_found()<<                                                                              \r
                        msg_info(av_error_str(ret)) <<                                                  \r
-                       source_info(narrow(source)) <<                                          \r
+                       source_info((source)) <<                                                \r
                        boost::errinfo_api_function(func) <<                                    \r
                        boost::errinfo_errno(AVUNERROR(ret)), local_func, file, line);\r
        case AVERROR_STREAM_NOT_FOUND:\r
                ::boost::exception_detail::throw_exception_(averror_stream_not_found()<<                                                                                \r
                        msg_info(av_error_str(ret)) <<                                                  \r
-                       source_info(narrow(source)) <<                                          \r
+                       source_info((source)) <<                                                \r
                        boost::errinfo_api_function(func) <<                                    \r
                        boost::errinfo_errno(AVUNERROR(ret)), local_func, file, line);\r
        default:\r
                ::boost::exception_detail::throw_exception_(ffmpeg_error()<<                                                                            \r
                        msg_info(av_error_str(ret)) <<                                                  \r
-                       source_info(narrow(source)) <<                                          \r
+                       source_info((source)) <<                                                \r
                        boost::errinfo_api_function(func) <<                                    \r
                        boost::errinfo_errno(AVUNERROR(ret)), local_func, file, line);\r
        }\r
 }\r
 \r
-static void throw_on_ffmpeg_error(int ret, const std::wstring& source, const char* func, const char* local_func, const char* file, int line)\r
+static void throw_on_ffmpeg_error(int ret, const std::string& source, const char* func, const char* local_func, const char* file, int line)\r
 {\r
-       throw_on_ffmpeg_error(ret, narrow(source).c_str(), func, local_func, file, line);\r
+       throw_on_ffmpeg_error(ret, (source).c_str(), func, local_func, file, line);\r
 }\r
 \r
 \r
index 8e79c32b073f3496722cc5988c1ae72ef54e7801..aa54ed33a77670b394f5252cb54f39c361db0f53 100644 (file)
@@ -69,10 +69,10 @@ struct audio_resampler::implementation
 \r
                        buffer2_.resize(AVCODEC_MAX_AUDIO_FRAME_SIZE*2);\r
 \r
-                       CASPAR_LOG(warning) << L"Resampling." <<\r
-                                                                       L" sample_rate:" << input_sample_rate  <<\r
-                                                                       L" audio_channels:" << input_channels  <<\r
-                                                                       L" sample_fmt:" << input_sample_format;\r
+                       CASPAR_LOG(warning) << "Resampling." <<\r
+                                                                       " sample_rate:" << input_sample_rate  <<\r
+                                                                       " audio_channels:" << input_channels  <<\r
+                                                                       " sample_fmt:" << input_sample_format;\r
 \r
                        if(resampler)\r
                                resampler_.reset(resampler, audio_resample_close);\r
index 2167f53f6404a56a6b54d7103d3961067f58920b..8ad472d12d339bdc0e2f834fc83a892d17c1194c 100644 (file)
@@ -61,7 +61,7 @@ namespace caspar { namespace ffmpeg {
                                \r
 struct ffmpeg_producer : public core::frame_producer\r
 {\r
-       const std::wstring                                                                                      filename_;\r
+       const std::string                                                                                       filename_;\r
        \r
        const safe_ptr<diagnostics::graph>                                                      graph_;\r
        boost::timer                                                                                            frame_timer_;\r
@@ -86,7 +86,7 @@ struct ffmpeg_producer : public core::frame_producer
        uint32_t                                                                                                        file_frame_number_;\r
        \r
 public:\r
-       explicit ffmpeg_producer(const safe_ptr<core::frame_factory>& frame_factory, const std::wstring& filename, const std::wstring& filter, bool loop, uint32_t start, uint32_t length) \r
+       explicit ffmpeg_producer(const safe_ptr<core::frame_factory>& frame_factory, const std::string& filename, const std::string& filter, bool loop, uint32_t start, uint32_t length) \r
                : filename_(filename)\r
                , frame_factory_(frame_factory)         \r
                , format_desc_(frame_factory->get_video_format_desc())\r
@@ -196,61 +196,61 @@ public:
                return file_nb_frames;\r
        }\r
        \r
-       virtual boost::unique_future<std::wstring> call(const std::wstring& param) override\r
+       virtual boost::unique_future<std::string> call(const std::string& param) override\r
        {\r
-               boost::promise<std::wstring> promise;\r
+               boost::promise<std::string> promise;\r
                promise.set_value(do_call(param));\r
                return promise.get_future();\r
        }\r
                                \r
-       virtual std::wstring print() const override\r
+       virtual std::string print() const override\r
        {\r
-               return L"ffmpeg[" + boost::filesystem::wpath(filename_).filename() + L"|" \r
-                                                 + print_mode() + L"|" \r
-                                                 + boost::lexical_cast<std::wstring>(file_frame_number_) + L"/" + boost::lexical_cast<std::wstring>(file_nb_frames()) + L"]";\r
+               return "ffmpeg[" + boost::filesystem::path(filename_).filename() + "|" \r
+                                                 + print_mode() + "|" \r
+                                                 + boost::lexical_cast<std::string>(file_frame_number_) + "/" + boost::lexical_cast<std::string>(file_nb_frames()) + "]";\r
        }\r
 \r
-       boost::property_tree::wptree info() const override\r
+       boost::property_tree::ptree info() const override\r
        {\r
-               boost::property_tree::wptree info;\r
-               info.add(L"type",                               L"ffmpeg-producer");\r
-               info.add(L"filename",                   filename_);\r
-               info.add(L"width",                              video_decoder_ ? video_decoder_->width() : 0);\r
-               info.add(L"height",                             video_decoder_ ? video_decoder_->height() : 0);\r
-               info.add(L"progressive",                video_decoder_ ? video_decoder_->is_progressive() : false);\r
-               info.add(L"fps",                                fps_);\r
-               info.add(L"loop",                               input_.loop());\r
-               info.add(L"frame-number",               frame_number_);\r
+               boost::property_tree::ptree info;\r
+               info.add("type",                                "ffmpeg-producer");\r
+               info.add("filename",                    filename_);\r
+               info.add("width",                               video_decoder_ ? video_decoder_->width() : 0);\r
+               info.add("height",                              video_decoder_ ? video_decoder_->height() : 0);\r
+               info.add("progressive",         video_decoder_ ? video_decoder_->is_progressive() : false);\r
+               info.add("fps",                         fps_);\r
+               info.add("loop",                                input_.loop());\r
+               info.add("frame-number",                frame_number_);\r
                auto nb_frames2 = nb_frames();\r
-               info.add(L"nb-frames",                  nb_frames2 == std::numeric_limits<int64_t>::max() ? -1 : nb_frames2);\r
-               info.add(L"file-frame-number",  file_frame_number_);\r
-               info.add(L"file-nb-frames",             file_nb_frames());\r
+               info.add("nb-frames",                   nb_frames2 == std::numeric_limits<int64_t>::max() ? -1 : nb_frames2);\r
+               info.add("file-frame-number",   file_frame_number_);\r
+               info.add("file-nb-frames",              file_nb_frames());\r
                return info;\r
        }\r
 \r
        // ffmpeg_producer\r
 \r
-       std::wstring print_mode() const\r
+       std::string print_mode() const\r
        {\r
-               return video_decoder_ ? ffmpeg::print_mode(video_decoder_->width(), video_decoder_->height(), fps_, !video_decoder_->is_progressive()) : L"";\r
+               return video_decoder_ ? ffmpeg::print_mode(video_decoder_->width(), video_decoder_->height(), fps_, !video_decoder_->is_progressive()) : "";\r
        }\r
                                        \r
-       std::wstring do_call(const std::wstring& param)\r
+       std::string do_call(const std::string& param)\r
        {\r
-               static const boost::wregex loop_exp(L"LOOP\\s*(?<VALUE>\\d?)", boost::regex::icase);\r
-               static const boost::wregex seek_exp(L"SEEK\\s+(?<VALUE>\\d+)", boost::regex::icase);\r
+               static const boost::regex loop_exp("LOOP\\s*(?<VALUE>\\d?)", boost::regex::icase);\r
+               static const boost::regex seek_exp("SEEK\\s+(?<VALUE>\\d+)", boost::regex::icase);\r
                \r
-               boost::wsmatch what;\r
+               boost::smatch what;\r
                if(boost::regex_match(param, what, loop_exp))\r
                {\r
                        if(!what["VALUE"].str().empty())\r
                                input_.loop(boost::lexical_cast<bool>(what["VALUE"].str()));\r
-                       return boost::lexical_cast<std::wstring>(input_.loop());\r
+                       return boost::lexical_cast<std::string>(input_.loop());\r
                }\r
                if(boost::regex_match(param, what, seek_exp))\r
                {\r
                        input_.seek(boost::lexical_cast<uint32_t>(what["VALUE"].str()));\r
-                       return L"";\r
+                       return "";\r
                }\r
 \r
                BOOST_THROW_EXCEPTION(invalid_argument());\r
@@ -311,20 +311,20 @@ public:
        }\r
 };\r
 \r
-safe_ptr<core::frame_producer> create_producer(const safe_ptr<core::frame_factory>& frame_factory, const std::vector<std::wstring>& params)\r
+safe_ptr<core::frame_producer> create_producer(const safe_ptr<core::frame_factory>& frame_factory, const std::vector<std::string>& params)\r
 {              \r
-       auto filename = probe_stem(env::media_folder() + L"\\" + params.at(0));\r
+       auto filename = probe_stem(env::media_folder() + "\\" + params.at(0));\r
 \r
        if(filename.empty())\r
                return core::frame_producer::empty();\r
        \r
-       auto loop               = boost::range::find(params, L"LOOP") != params.end();\r
-       auto start              = get_param(L"SEEK", params, static_cast<uint32_t>(0));\r
-       auto length             = get_param(L"LENGTH", params, std::numeric_limits<uint32_t>::max());\r
-       auto filter_str = get_param(L"FILTER", params, L"");    \r
+       auto loop               = boost::range::find(params, "LOOP") != params.end();\r
+       auto start              = get_param("SEEK", params, static_cast<uint32_t>(0));\r
+       auto length             = get_param("LENGTH", params, std::numeric_limits<uint32_t>::max());\r
+       auto filter_str = get_param("FILTER", params, "");      \r
                \r
-       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
+       boost::replace_all(filter_str, "DEINTERLACE", "YADIF=0:-1");\r
+       boost::replace_all(filter_str, "DEINTERLACE_BOB", "YADIF=1:-1");\r
        \r
        return create_producer_destroy_proxy(make_safe<ffmpeg_producer>(frame_factory, filename, filter_str, loop, start, length));\r
 }\r
index ebfb5b3c32f76baa3bff3c6c1e1a67f46664b0ca..51964ed5ff8ef80c6ae9140c63de1d0c2842f416 100644 (file)
@@ -37,6 +37,6 @@ struct frame_factory;
        \r
 namespace ffmpeg {\r
 \r
-safe_ptr<core::frame_producer> create_producer(const safe_ptr<core::frame_factory>& frame_factory, const std::vector<std::wstring>& params);\r
+safe_ptr<core::frame_producer> create_producer(const safe_ptr<core::frame_factory>& frame_factory, const std::vector<std::string>& params);\r
 \r
 }}
\ No newline at end of file
index 9c2ef158a3cd37aff26d90d319dedac7a9cfd180..64d23c78485db04653043ddd437067696c7112cc 100644 (file)
@@ -104,7 +104,7 @@ static int query_formats_410(AVFilterContext *ctx)
 \r
 struct filter::implementation\r
 {\r
-       std::wstring                                    filters_;\r
+       std::string                                     filters_;\r
        std::shared_ptr<AVFilterGraph>  graph_; \r
        AVFilterContext*                                buffersink_ctx_;\r
        AVFilterContext*                                buffersrc_ctx_;\r
@@ -112,7 +112,7 @@ struct filter::implementation
        std::vector<PixelFormat>                pix_fmts_;\r
        std::queue<safe_ptr<AVFrame>>   bypass_;\r
                \r
-       implementation(const std::wstring& filters, const std::vector<PixelFormat>& pix_fmts) \r
+       implementation(const std::string& filters, const std::vector<PixelFormat>& pix_fmts) \r
                : filters_(filters)\r
                , parallel_yadif_ctx_(nullptr)\r
                , pix_fmts_(pix_fmts)\r
@@ -182,7 +182,7 @@ struct filter::implementation
                                        inputs->pad_idx                 = 0;\r
                                        inputs->next                    = nullptr;\r
                        \r
-                                       std::string filters = boost::to_lower_copy(narrow(filters_));\r
+                                       std::string filters = to_lower_copy((filters_));\r
                                        THROW_ON_ERROR2(avfilter_graph_parse(graph_.get(), filters.c_str(), &inputs, &outputs, NULL), "[filter]");\r
                        \r
                                        auto yadif_filter = boost::adaptors::filtered([&](AVFilterContext* p){return strstr(p->name, "yadif") != 0;});\r
@@ -314,12 +314,12 @@ struct filter::implementation
        }\r
 };\r
 \r
-filter::filter(const std::wstring& filters, const std::vector<PixelFormat>& pix_fmts) : impl_(new implementation(filters, pix_fmts)){}\r
+filter::filter(const std::string& filters, const std::vector<PixelFormat>& pix_fmts) : impl_(new implementation(filters, pix_fmts)){}\r
 filter::filter(filter&& other) : impl_(std::move(other.impl_)){}\r
 filter& filter::operator=(filter&& other){impl_ = std::move(other.impl_); return *this;}\r
 void filter::push(const std::shared_ptr<AVFrame>& frame){impl_->push(frame);}\r
 std::shared_ptr<AVFrame> filter::poll(){return impl_->poll();}\r
-std::wstring filter::filter_str() const{return impl_->filters_;}\r
+std::string filter::filter_str() const{return impl_->filters_;}\r
 std::vector<safe_ptr<AVFrame>> filter::poll_all()\r
 {      \r
        std::vector<safe_ptr<AVFrame>> frames;\r
index f1989201b729803c4dac927065b4c16572076046..74ff9b5a2ad54614dd64352b1d256da0da91d7aa 100644 (file)
@@ -34,15 +34,15 @@ enum PixelFormat;
 \r
 namespace caspar { namespace ffmpeg {\r
 \r
-static std::wstring append_filter(const std::wstring& filters, const std::wstring& filter)\r
+static std::string append_filter(const std::string& filters, const std::string& filter)\r
 {\r
-       return filters + (filters.empty() ? L"" : L",") + filter;\r
+       return filters + (filters.empty() ? "" : ",") + filter;\r
 }\r
 \r
 class filter : boost::noncopyable\r
 {\r
 public:\r
-       filter(const std::wstring& filters = L"", const std::vector<PixelFormat>& pix_fmts = std::vector<PixelFormat>());\r
+       filter(const std::string& filters = "", const std::vector<PixelFormat>& pix_fmts = std::vector<PixelFormat>());\r
        filter(filter&& other);\r
        filter& operator=(filter&& other);\r
 \r
@@ -50,27 +50,27 @@ public:
        std::shared_ptr<AVFrame> poll();\r
        std::vector<safe_ptr<AVFrame>> poll_all();\r
 \r
-       std::wstring filter_str() const;\r
+       std::string filter_str() const;\r
                        \r
-       static bool is_double_rate(const std::wstring& filters)\r
+       static bool is_double_rate(const std::string& filters)\r
        {\r
-               if(boost::to_upper_copy(filters).find(L"YADIF=1") != std::string::npos)\r
+               if(to_upper_copy(filters).find("YADIF=1") != std::string::npos)\r
                        return true;\r
        \r
-               if(boost::to_upper_copy(filters).find(L"YADIF=3") != std::string::npos)\r
+               if(to_upper_copy(filters).find("YADIF=3") != std::string::npos)\r
                        return true;\r
 \r
                return false;\r
        }\r
 \r
-       static bool is_deinterlacing(const std::wstring& filters)\r
+       static bool is_deinterlacing(const std::string& filters)\r
        {\r
-               if(boost::to_upper_copy(filters).find(L"YADIF") != std::string::npos)\r
+               if(to_upper_copy(filters).find("YADIF") != std::string::npos)\r
                        return true;    \r
                return false;\r
        }       \r
        \r
-       static int delay(const std::wstring& filters)\r
+       static int delay(const std::string& filters)\r
        {\r
                return is_double_rate(filters) ? 1 : 1;\r
        }\r
index 58916005ad80f4a4c29e7c501fed783e82c3c1e5..e4f79b11243ee264d06ed1ac690c5db846d6bb63 100644 (file)
@@ -68,7 +68,7 @@ struct input::implementation : boost::noncopyable
        const safe_ptr<AVFormatContext>                                                         format_context_; // Destroy this last\r
        const int                                                                                                       default_stream_index_;\r
                        \r
-       const std::wstring                                                                                      filename_;\r
+       const std::string                                                                                       filename_;\r
        tbb::atomic<bool>                                                                                       loop_;\r
        const uint32_t                                                                                          start_;         \r
        const uint32_t                                                                                          length_;\r
@@ -85,7 +85,7 @@ struct input::implementation : boost::noncopyable
 \r
        tbb::recursive_mutex                                                                            mutex_;\r
 \r
-       explicit implementation(const safe_ptr<diagnostics::graph>& graph, const std::wstring& filename, bool loop, uint32_t start, uint32_t length) \r
+       explicit implementation(const safe_ptr<diagnostics::graph>& graph, const std::string& filename, bool loop, uint32_t start, uint32_t length) \r
                : graph_(graph)\r
                , format_context_(open_input(filename))         \r
                , default_stream_index_(av_find_default_stream_index(format_context_.get()))\r
@@ -108,7 +108,7 @@ struct input::implementation : boost::noncopyable
                is_running_ = true;\r
                thread_ = boost::thread([this]{run();});\r
 \r
-               CASPAR_LOG(info) << print() << L" Initialized.";\r
+               CASPAR_LOG(info) << print() << " Initialized.";\r
        }\r
 \r
        ~implementation()\r
@@ -269,13 +269,13 @@ struct input::implementation : boost::noncopyable
                return ret == AVERROR_EOF || ret == AVERROR(EIO) || frame_number_ >= length_; // av_read_frame doesn't always correctly return AVERROR_EOF;\r
        }\r
        \r
-       std::wstring print() const\r
+       std::string print() const\r
        {\r
-               return L"ffmpeg_input[" + filename_ + L")]";\r
+               return "ffmpeg_input[" + filename_ + ")]";\r
        }\r
 };\r
 \r
-input::input(const safe_ptr<diagnostics::graph>& graph, const std::wstring& filename, bool loop, uint32_t start, uint32_t length) \r
+input::input(const safe_ptr<diagnostics::graph>& graph, const std::string& filename, bool loop, uint32_t start, uint32_t length) \r
        : impl_(new implementation(graph, filename, loop, start, length)){}\r
 bool input::eof() const {return impl_->is_eof_;}\r
 bool input::try_pop(std::shared_ptr<AVPacket>& packet){return impl_->try_pop(packet);}\r
index 197fb117dc225d91582085a4722073f5a498e012..3999cd015003f18c3639e3d1e882c31ba6747ad8 100644 (file)
@@ -45,7 +45,7 @@ namespace ffmpeg {
 class input : boost::noncopyable\r
 {\r
 public:\r
-       explicit input(const safe_ptr<diagnostics::graph>& graph, const std::wstring& filename, bool loop, uint32_t start, uint32_t length);\r
+       explicit input(const safe_ptr<diagnostics::graph>& graph, const std::string& filename, bool loop, uint32_t start, uint32_t length);\r
 \r
        bool try_pop(std::shared_ptr<AVPacket>& packet);\r
        bool eof() const;\r
index 201074d81b325c0d645e20eea0aa93f8ebb96d6e..d887ade44936843fe249c8ca1a85cb6095baecb5 100644 (file)
@@ -40,18 +40,18 @@ struct display_mode
                invalid\r
        };\r
 \r
-       static std::wstring print(display_mode::type value)\r
+       static std::string print(display_mode::type value)\r
        {\r
                switch(value)\r
                {\r
-                       case simple:                                            return L"simple";\r
-                       case duplicate:                                         return L"duplicate";\r
-                       case half:                                                      return L"half";\r
-                       case interlace:                                         return L"interlace";\r
-                       case deinterlace_bob:                           return L"deinterlace_bob";\r
-                       case deinterlace_bob_reinterlace:       return L"deinterlace_bob_reinterlace";\r
-                       case deinterlace:                                       return L"deinterlace";\r
-                       default:                                                        return L"invalid";\r
+                       case simple:                                            return "simple";\r
+                       case duplicate:                                         return "duplicate";\r
+                       case half:                                                      return "half";\r
+                       case interlace:                                         return "interlace";\r
+                       case deinterlace_bob:                           return "deinterlace_bob";\r
+                       case deinterlace_bob_reinterlace:       return "deinterlace_bob_reinterlace";\r
+                       case deinterlace:                                       return "deinterlace";\r
+                       default:                                                        return "invalid";\r
                }\r
        }\r
 };\r
index 9fb12d076de5a0b957c77237a920f2f746619982..f17ce46f6454fef0482e96ebbf6800907140f9b3 100644 (file)
@@ -60,43 +60,41 @@ extern "C"
 #include <queue>\r
 #include <vector>\r
 \r
-using namespace caspar::core;\r
-\r
 namespace caspar { namespace ffmpeg {\r
        \r
 struct frame_muxer::implementation : boost::noncopyable\r
 {      \r
-       std::queue<std::queue<safe_ptr<write_frame>>>   video_streams_;\r
-       std::queue<core::audio_buffer>                                  audio_streams_;\r
-       std::queue<safe_ptr<basic_frame>>                               frame_buffer_;\r
-       display_mode::type                                                              display_mode_;\r
-       const double                                                                    in_fps_;\r
-       const video_format_desc                                                 format_desc_;\r
-       bool                                                                                    auto_transcode_;\r
-       bool                                                                                    auto_deinterlace_;\r
+       std::queue<std::queue<safe_ptr<core::write_frame>>>     video_streams_;\r
+       std::queue<core::audio_buffer>                                          audio_streams_;\r
+       std::queue<safe_ptr<core::basic_frame>>                         frame_buffer_;\r
+       display_mode::type                                                                      display_mode_;\r
+       const double                                                                            in_fps_;\r
+       const core::video_format_desc                                                   format_desc_;\r
+       bool                                                                                            auto_transcode_;\r
+       bool                                                                                            auto_deinterlace_;\r
        \r
-       std::vector<size_t>                                                             audio_cadence_;\r
+       std::vector<size_t>                                                                     audio_cadence_;\r
                        \r
-       safe_ptr<core::frame_factory>                                   frame_factory_;\r
+       safe_ptr<core::frame_factory>                                           frame_factory_;\r
        \r
-       filter                                                                                  filter_;\r
-       const std::wstring                                                              filter_str_;\r
-       bool                                                                                    force_deinterlacing_;\r
-       display_mode::type                                                              force_deinterlacing_mode_;\r
+       filter                                                                                          filter_;\r
+       const std::string                                                                       filter_str_;\r
+       bool                                                                                            force_deinterlacing_;\r
+       display_mode::type                                                                      force_deinterlacing_mode_;\r
                \r
-       implementation(double in_fps, const safe_ptr<core::frame_factory>& frame_factory, const std::wstring& filter_str, display_mode::type force_deinterlacing_mode)\r
+       implementation(double in_fps, const safe_ptr<core::frame_factory>& frame_factory, const std::string& filter_str, display_mode::type force_deinterlacing_mode)\r
                : display_mode_(display_mode::invalid)\r
                , in_fps_(in_fps)\r
                , format_desc_(frame_factory->get_video_format_desc())\r
-               , auto_transcode_(env::properties().get(L"configuration.auto-transcode", true))\r
-               , auto_deinterlace_(env::properties().get(L"configuration.auto-deinterlace", true))\r
+               , auto_transcode_(env::properties().get("configuration.auto-transcode", true))\r
+               , auto_deinterlace_(env::properties().get("configuration.auto-deinterlace", true))\r
                , audio_cadence_(format_desc_.audio_cadence)\r
                , frame_factory_(frame_factory)\r
                , filter_str_(filter_str)\r
                , force_deinterlacing_(false)\r
                , force_deinterlacing_mode_(force_deinterlacing_mode)\r
        {\r
-               video_streams_.push(std::queue<safe_ptr<write_frame>>());\r
+               video_streams_.push(std::queue<safe_ptr<core::write_frame>>());\r
                audio_streams_.push(core::audio_buffer());\r
                boost::range::sort(audio_cadence_);\r
                boost::range::reverse(audio_cadence_);\r
@@ -109,7 +107,7 @@ struct frame_muxer::implementation : boost::noncopyable
                \r
                if(video_frame == flush_video())\r
                {       \r
-                       video_streams_.push(std::queue<safe_ptr<write_frame>>());\r
+                       video_streams_.push(std::queue<safe_ptr<core::write_frame>>());\r
                }\r
                else if(video_frame == empty_video())\r
                {\r
@@ -198,7 +196,7 @@ struct frame_muxer::implementation : boost::noncopyable
                }\r
        }\r
                \r
-       std::shared_ptr<basic_frame> poll()\r
+       std::shared_ptr<core::basic_frame> poll()\r
        {\r
                if(!frame_buffer_.empty())\r
                {\r
@@ -210,7 +208,7 @@ struct frame_muxer::implementation : boost::noncopyable
                if(video_streams_.size() > 1 && audio_streams_.size() > 1 && (!video_ready2() || !audio_ready2()))\r
                {\r
                        if(!video_streams_.front().empty() || !audio_streams_.front().empty())\r
-                               CASPAR_LOG(trace) << "Truncating: " << video_streams_.front().size() << L" video-frames, " << audio_streams_.front().size() << L" audio-samples.";\r
+                               CASPAR_LOG(trace) << "Truncating: " << video_streams_.front().size() << " video-frames, " << audio_streams_.front().size() << " audio-samples.";\r
 \r
                        video_streams_.pop();\r
                        audio_streams_.pop();\r
@@ -284,7 +282,7 @@ struct frame_muxer::implementation : boost::noncopyable
                                \r
        void update_display_mode(const std::shared_ptr<AVFrame>& frame)\r
        {\r
-               std::wstring filter_str = filter_str_;\r
+               std::string filter_str = filter_str_;\r
 \r
                display_mode_ = display_mode::simple;\r
                if(auto_transcode_)\r
@@ -310,23 +308,23 @@ struct frame_muxer::implementation : boost::noncopyable
                        if(force_deinterlacing_ && mode != core::field_mode::progressive && display_mode_ != display_mode::deinterlace && display_mode_ != display_mode::deinterlace_bob)                       \r
                        {       \r
                                if(force_deinterlacing_mode_ == display_mode::deinterlace)\r
-                                       CASPAR_LOG(warning) << L"[frame_muxer] Forcing non bob deinterlacing.";\r
+                                       CASPAR_LOG(warning) << "[frame_muxer] Forcing non bob deinterlacing.";\r
                                display_mode_ = force_deinterlacing_mode_;\r
                        }\r
 \r
                        if(display_mode_ == display_mode::deinterlace)\r
-                               filter_str = append_filter(filter_str, L"YADIF=0:-1");\r
+                               filter_str = append_filter(filter_str, "YADIF=0:-1");\r
                        else if(display_mode_ == display_mode::deinterlace_bob || display_mode_ == display_mode::deinterlace_bob_reinterlace)\r
-                               filter_str = append_filter(filter_str, L"YADIF=1:-1");\r
+                               filter_str = append_filter(filter_str, "YADIF=1:-1");\r
                }\r
 \r
                if(display_mode_ == display_mode::invalid)\r
                {\r
-                       CASPAR_LOG(warning) << L"[frame_muxer] Auto-transcode: Failed to detect display-mode.";\r
+                       CASPAR_LOG(warning) << "[frame_muxer] Auto-transcode: Failed to detect display-mode.";\r
                        display_mode_ = display_mode::simple;\r
                }\r
                        \r
-               if(!boost::iequals(filter_.filter_str(), filter_str))\r
+               if(!iequals(filter_.filter_str(), filter_str))\r
                {\r
                        for(int n = 0; n < filter_.delay(); ++n)\r
                        {\r
@@ -336,7 +334,7 @@ struct frame_muxer::implementation : boost::noncopyable
                                        video_streams_.back().push(make_write_frame(this, make_safe_ptr(av_frame), frame_factory_, 0));\r
                        }\r
                        filter_ = filter(filter_str);\r
-                       CASPAR_LOG(info) << "[frame_muxer] " << display_mode::print(display_mode_) << L" " << print_mode(frame->width, frame->height, in_fps_, frame->interlaced_frame > 0);\r
+                       CASPAR_LOG(info) << "[frame_muxer] " << display_mode::print(display_mode_) << " " << print_mode(frame->width, frame->height, in_fps_, frame->interlaced_frame > 0);\r
                }\r
        }\r
 \r
@@ -372,11 +370,11 @@ struct frame_muxer::implementation : boost::noncopyable
        }\r
 };\r
 \r
-frame_muxer::frame_muxer(double in_fps, const safe_ptr<core::frame_factory>& frame_factory, const std::wstring& filter, display_mode::type force_deinterlacing_mode)\r
+frame_muxer::frame_muxer(double in_fps, const safe_ptr<core::frame_factory>& frame_factory, const std::string& filter, display_mode::type force_deinterlacing_mode)\r
        : impl_(new implementation(in_fps, frame_factory, filter, force_deinterlacing_mode)){}\r
 void frame_muxer::push(const std::shared_ptr<AVFrame>& video_frame, int hints){impl_->push(video_frame, hints);}\r
 void frame_muxer::push(const std::shared_ptr<core::audio_buffer>& audio_samples){return impl_->push(audio_samples);}\r
-std::shared_ptr<basic_frame> frame_muxer::poll(){return impl_->poll();}\r
+std::shared_ptr<core::basic_frame> frame_muxer::poll(){return impl_->poll();}\r
 uint32_t frame_muxer::calc_nb_frames(uint32_t nb_frames) const {return impl_->calc_nb_frames(nb_frames);}\r
 bool frame_muxer::video_ready() const{return impl_->video_ready();}\r
 bool frame_muxer::audio_ready() const{return impl_->audio_ready();}\r
index b98ab9bfed962c80bab937f2dfd90301c3e85091..4b4fdc709cce53aea38b08700119b9d1014ecaca 100644 (file)
@@ -48,7 +48,7 @@ namespace ffmpeg {
 class frame_muxer : boost::noncopyable\r
 {\r
 public:\r
-       frame_muxer(double in_fps, const safe_ptr<core::frame_factory>& frame_factory, const std::wstring& filter = L"", display_mode::type force_deinterlace_mode = display_mode::deinterlace_bob_reinterlace);\r
+       frame_muxer(double in_fps, const safe_ptr<core::frame_factory>& frame_factory, const std::string& filter = "", display_mode::type force_deinterlace_mode = display_mode::deinterlace_bob_reinterlace);\r
        \r
        void push(const std::shared_ptr<AVFrame>& video_frame, int hints = 0);\r
        void push(const std::shared_ptr<core::audio_buffer>& audio_samples);\r
index ede72036a1ce19e7f34a774df02db62183a8efbb..985efaa90e6a53338564cc0f79ca1f6f335b0d3c 100644 (file)
@@ -442,27 +442,27 @@ safe_ptr<AVCodecContext> open_codec(AVFormatContext& context, enum AVMediaType t
        return safe_ptr<AVCodecContext>(context.streams[index]->codec, tbb_avcodec_close);\r
 }\r
 \r
-safe_ptr<AVFormatContext> open_input(const std::wstring& filename)\r
+safe_ptr<AVFormatContext> open_input(const std::string& filename)\r
 {\r
        AVFormatContext* weak_context = nullptr;\r
-       THROW_ON_ERROR2(avformat_open_input(&weak_context, narrow(filename).c_str(), nullptr, nullptr), filename);\r
+       THROW_ON_ERROR2(avformat_open_input(&weak_context, (filename).c_str(), nullptr, nullptr), filename);\r
        safe_ptr<AVFormatContext> context(weak_context, av_close_input_file);                   \r
        THROW_ON_ERROR2(avformat_find_stream_info(weak_context, nullptr), filename);\r
        fix_meta_data(*context);\r
        return context;\r
 }\r
 \r
-std::wstring print_mode(size_t width, size_t height, double fps, bool interlaced)\r
+std::string print_mode(size_t width, size_t height, double fps, bool interlaced)\r
 {\r
-       std::wostringstream fps_ss;\r
+       std::stringstream fps_ss;\r
        fps_ss << std::fixed << std::setprecision(2) << (!interlaced ? fps : 2.0 * fps);\r
 \r
-       return boost::lexical_cast<std::wstring>(width) + L"x" + boost::lexical_cast<std::wstring>(height) + (!interlaced ? L"p" : L"i") + fps_ss.str();\r
+       return boost::lexical_cast<std::string>(width) + "x" + boost::lexical_cast<std::string>(height) + (!interlaced ? "p" : "i") + fps_ss.str();\r
 }\r
 \r
-bool is_valid_file(const std::wstring filename)\r
+bool is_valid_file(const std::string filename)\r
 {                      \r
-       auto filename2 = narrow(filename);\r
+       auto filename2 = (filename);\r
 \r
        std::ifstream file(filename);\r
 \r
@@ -482,16 +482,16 @@ bool is_valid_file(const std::wstring filename)
        return av_probe_input_format2(&pb, true, &score) != nullptr;\r
 }\r
 \r
-std::wstring probe_stem(const std::wstring stem)\r
+std::string probe_stem(const std::string stem)\r
 {\r
-       auto stem2 = boost::filesystem2::wpath(stem);\r
+       auto stem2 = boost::filesystem2::path(stem);\r
        auto dir = stem2.parent_path();\r
-       for(auto it = boost::filesystem2::wdirectory_iterator(dir); it != boost::filesystem2::wdirectory_iterator(); ++it)\r
+       for(auto it = boost::filesystem2::directory_iterator(dir); it != boost::filesystem2::directory_iterator(); ++it)\r
        {\r
-               if(boost::iequals(it->path().stem(), stem2.filename()) && is_valid_file(it->path().file_string()))\r
+               if(iequals(it->path().stem(), stem2.filename()) && is_valid_file(it->path().file_string()))\r
                        return it->path().file_string();\r
        }\r
-       return L"";\r
+       return "";\r
 }\r
 //\r
 //void av_dup_frame(AVFrame* frame)\r
index 2960c2e94a1af35e89201831f400082b7e11228f..79920fd80b5a9a5b70c78264e7b4ae8180b204c8 100644 (file)
@@ -62,16 +62,16 @@ safe_ptr<core::write_frame> make_write_frame(const void* tag, const safe_ptr<AVF
 safe_ptr<AVPacket> create_packet();\r
 \r
 safe_ptr<AVCodecContext> open_codec(AVFormatContext& context,  enum AVMediaType type, int& index);\r
-safe_ptr<AVFormatContext> open_input(const std::wstring& filename);\r
+safe_ptr<AVFormatContext> open_input(const std::string& filename);\r
 \r
 bool is_sane_fps(AVRational time_base);\r
 AVRational fix_time_base(AVRational time_base);\r
 \r
 double read_fps(AVFormatContext& context, double fail_value);\r
 \r
-std::wstring print_mode(size_t width, size_t height, double fps, bool interlaced);\r
+std::string print_mode(size_t width, size_t height, double fps, bool interlaced);\r
 \r
-std::wstring probe_stem(const std::wstring stem);\r
-bool is_valid_file(const std::wstring filename);\r
+std::string probe_stem(const std::string stem);\r
+bool is_valid_file(const std::string filename);\r
 \r
 }}
\ No newline at end of file
index 8c072b7b8bd455fc29b22ab45226af6b9aaa4b0a..732c4da0c49d64ba09b372df99a92e73764c083f 100644 (file)
@@ -36,14 +36,14 @@ void init()
        core::register_producer_factory(create_cg_producer);\r
 }\r
 \r
-std::wstring get_cg_version()\r
+std::string get_cg_version()\r
 {\r
-       return L"Unknown";\r
+       return "Unknown";\r
 }\r
 \r
-std::wstring get_version()\r
+std::string get_version()\r
 {              \r
-       std::wstring version = L"Not found";\r
+       std::string version = "Not found";\r
 #ifdef WIN32\r
        HKEY   hkey;\r
  \r
@@ -56,7 +56,7 @@ std::wstring get_version()
                dwSize = sizeof(ver_str);\r
                RegQueryValueEx(hkey, TEXT("Version"), NULL, &dwType, (PBYTE)&ver_str, &dwSize);\r
  \r
-               version = ver_str;\r
+               version = u8(ver_str);\r
 \r
                RegCloseKey(hkey);\r
        }\r
index bda6402f620fd17e3b90a243ae09bb5139b00ae9..2cdb040924fd7ed0bf443bc2647717f3dfb8b76b 100644 (file)
@@ -27,7 +27,7 @@ namespace caspar { namespace flash {
 \r
 void init();\r
 \r
-std::wstring get_cg_version();\r
-std::wstring get_version();\r
+std::string get_cg_version();\r
+std::string get_version();\r
 \r
 }}
\ No newline at end of file
index 85873a21febb880ba2840365e8b9fa87f6cedd7b..4dd6cebb87ac93379e9113904a231d4cd9c10079 100644 (file)
@@ -475,7 +475,7 @@ HRESULT STDMETHODCALLTYPE FlashAxContainer::QueryService( REFGUID rsid, REFIID r
                        {\r
                                delete m_lpDD4;\r
                                m_lpDD4 = NULL;\r
-                               CASPAR_LOG(info) << print_() << " DirectDraw not installed. Running without DirectDraw.";\r
+                               CASPAR_LOG(info) << u8(print_()) << " DirectDraw not installed. Running without DirectDraw.";\r
                                return E_NOINTERFACE;\r
                        }\r
                }\r
@@ -600,23 +600,23 @@ void FlashAxContainer::EnterFullscreen()
 \r
 void STDMETHODCALLTYPE FlashAxContainer::OnFlashCall(BSTR request)\r
 {\r
-       std::wstring str(request);\r
-       if(str.find(TEXT("DisplayedTemplate")) != std::wstring::npos)\r
+       std::string str = u8(request);\r
+       if(str.find("DisplayedTemplate") != std::wstring::npos)\r
        {\r
                ATLTRACE(_T("ShockwaveFlash::DisplayedTemplate\n"));\r
                bReadyToRender_ = true;\r
        }\r
-       else if(str.find(TEXT("OnCommand")) != std::wstring::npos) {\r
+       else if(str.find("OnCommand") != std::wstring::npos) {\r
                //this is how templatehost 1.8 reports that a command has been received\r
-               CASPAR_LOG(debug)  << print_()  << L" Command: \n-------------------------------------------\n" << str << L"\n-------------------------------------------";\r
+               CASPAR_LOG(debug)  << u8(print_())  << " Command: \n-------------------------------------------\n" << str << "\n-------------------------------------------";\r
                bCallSuccessful_ = true;\r
        }\r
-       else if(str.find(TEXT("Activity")) != std::wstring::npos)\r
+       else if(str.find("Activity") != std::wstring::npos)\r
        {\r
-               CASPAR_LOG(debug) << print_() << L" Activity: \n-------------------------------------------\n" << str << L"\n-------------------------------------------";\r
+               CASPAR_LOG(debug) << u8(print_()) << " Activity: \n-------------------------------------------\n" << str << "\n-------------------------------------------";\r
 \r
                //this is how templatehost 1.7 reports that a command has been received\r
-               if(str.find(TEXT("Command recieved")) != std::wstring::npos)\r
+               if(str.find("Command recieved") != std::wstring::npos)\r
                        bCallSuccessful_ = true;\r
 \r
                /*if(pFlashProducer_ != 0 && pFlashProducer_->pMonitor_) {\r
@@ -625,9 +625,9 @@ void STDMETHODCALLTYPE FlashAxContainer::OnFlashCall(BSTR request)
                                pFlashProducer_->pMonitor_->Inform(str.substr(pos, str.find(TEXT('<'), pos)-pos));\r
                }*/\r
        }\r
-       else if(str.find(TEXT("OnNotify")) != std::wstring::npos)\r
+       else if(str.find("OnNotify") != std::wstring::npos)\r
        {\r
-               CASPAR_LOG(info) << print_() << L" Notification: \n-------------------------------------------\n" << str << L"\n-------------------------------------------";\r
+               CASPAR_LOG(info) << u8(print_()) << " Notification: \n-------------------------------------------\n" << str << "\n-------------------------------------------";\r
 \r
                //if(pFlashProducer_ != 0 && pFlashProducer_->pMonitor_) {\r
                //      std::wstring::size_type pos = str.find(TEXT('@'));\r
@@ -635,31 +635,31 @@ void STDMETHODCALLTYPE FlashAxContainer::OnFlashCall(BSTR request)
                //              pFlashProducer_->pMonitor_->Inform(str.substr(pos, str.find(TEXT('<'), pos)-pos));\r
                //}\r
        }\r
-       else if(str.find(TEXT("IsEmpty")) != std::wstring::npos)\r
+       else if(str.find("IsEmpty") != std::wstring::npos)\r
        {\r
-               CASPAR_LOG(info) << print_() << L" Empty.";\r
+               CASPAR_LOG(info) << u8(print_()) << " Empty.";\r
                ATLTRACE(_T("ShockwaveFlash::IsEmpty\n"));\r
                bIsEmpty_ = true;\r
        }\r
-       else if(str.find(TEXT("OnError")) != std::wstring::npos)\r
+       else if(str.find("OnError") != std::wstring::npos)\r
        {\r
-               CASPAR_LOG(error) << print_() << L" Error: \n-------------------------------------------\n" << str << L"\n-------------------------------------------";\r
+               CASPAR_LOG(error) << u8(print_()) << " Error: \n-------------------------------------------\n" << str << "\n-------------------------------------------";\r
        }\r
-       else if(str.find(TEXT("OnDebug")) != std::wstring::npos)\r
+       else if(str.find("OnDebug") != std::wstring::npos)\r
        {\r
-               CASPAR_LOG(error) << print_() << L" Debug: \n-------------------------------------------\n" << str << L"\n-------------------------------------------";\r
+               CASPAR_LOG(error) << u8(print_()) << " Debug: \n-------------------------------------------\n" << str << "\n-------------------------------------------";\r
        }\r
        //else if(str.find(TEXT("OnTemplateDescription")) != std::wstring::npos)\r
        //{\r
-       //      CASPAR_LOG(error) << print_() << L" TemplateDescription: \n-------------------------------------------\n" << str << L"\n-------------------------------------------";\r
+       //      CASPAR_LOG(error) << u8(print_()) << L" TemplateDescription: \n-------------------------------------------\n" << str << L"\n-------------------------------------------";\r
        //}\r
        //else if(str.find(TEXT("OnGetInfo")) != std::wstring::npos)\r
        //{\r
-       //      CASPAR_LOG(error) << print_() << L" Info: \n-------------------------------------------\n" << str << L"\n-------------------------------------------";\r
+       //      CASPAR_LOG(error) << u8(print_()) << L" Info: \n-------------------------------------------\n" << str << L"\n-------------------------------------------";\r
        //}\r
        //else\r
        //{\r
-       //      CASPAR_LOG(error) << print_() << L" Unknown: \n-------------------------------------------\n" << str << L"\n-------------------------------------------";\r
+       //      CASPAR_LOG(error) << u8(print_()) << L" Unknown: \n-------------------------------------------\n" << str << L"\n-------------------------------------------";\r
        //}\r
 \r
        CComPtr<IShockwaveFlash> spFlash;\r
@@ -773,7 +773,7 @@ HRESULT FlashAxContainer::CreateAxControl()
                        if(hr2 == S_OK && spFlash)\r
                        {\r
                                if(FAILED(spFlash->put_WMode(TEXT("Transparent"))))\r
-                                       CASPAR_LOG(warning) << print_() << L" Failed to set flash container to transparent mode.";\r
+                                       CASPAR_LOG(warning) << u8(print_()) << L" Failed to set flash container to transparent mode.";\r
                                //spFlash->put_WMode(TEXT("GPU"));\r
                                hResultQuality = spFlash->put_Quality2(TEXT("Best"));\r
                        }\r
index 0236304814fefad7791354b04a53a19c6e57eda3..adbe00ff7970059c9d9c074464943cb5b900cbb6 100644 (file)
@@ -45,88 +45,88 @@ public:
                : flash_producer_(frame_producer)\r
        {}\r
        \r
-       boost::unique_future<std::wstring> add(int layer, std::wstring filename,  bool play_on_load, const std::wstring& label, const std::wstring& data)\r
+       boost::unique_future<std::string> add(int layer, std::string filename,  bool play_on_load, const std::string& label, const std::string& data)\r
        {\r
                if(filename.size() > 0 && filename[0] == L'/')\r
                        filename = filename.substr(1, filename.size()-1);\r
 \r
-               auto str = (boost::wformat(L"<invoke name=\"Add\" returntype=\"xml\"><arguments><number>%1%</number><string>%2%</string>%3%<string>%4%</string><string><![CDATA[%5%]]></string></arguments></invoke>") % layer % filename % (play_on_load?TEXT("<true/>"):TEXT("<false/>")) % label % data).str();\r
+               auto str = (boost::format("<invoke name=\"Add\" returntype=\"xml\"><arguments><number>%1%</number><string>%2%</string>%3%<string>%4%</string><string><![CDATA[%5%]]></string></arguments></invoke>") % layer % filename % (play_on_load?TEXT("<true/>"):TEXT("<false/>")) % label % data).str();\r
 \r
                CASPAR_LOG(info) << flash_producer_->print() << " Invoking add-command: " << str;\r
                return flash_producer_->call(str);\r
        }\r
 \r
-       boost::unique_future<std::wstring> remove(int layer)\r
+       boost::unique_future<std::string> remove(int layer)\r
        {\r
-               auto str = (boost::wformat(L"<invoke name=\"Delete\" returntype=\"xml\"><arguments><array><property id=\"0\"><number>%1%</number></property></array></arguments></invoke>") % layer).str();\r
+               auto str = (boost::format("<invoke name=\"Delete\" returntype=\"xml\"><arguments><array><property id=\"0\"><number>%1%</number></property></array></arguments></invoke>") % layer).str();\r
                CASPAR_LOG(info) << flash_producer_->print() << " Invoking remove-command: " << str;\r
                return flash_producer_->call(str);\r
        }\r
 \r
-       boost::unique_future<std::wstring> play(int layer)\r
+       boost::unique_future<std::string> play(int layer)\r
        {\r
-               auto str = (boost::wformat(L"<invoke name=\"Play\" returntype=\"xml\"><arguments><array><property id=\"0\"><number>%1%</number></property></array></arguments></invoke>") % layer).str();\r
+               auto str = (boost::format("<invoke name=\"Play\" returntype=\"xml\"><arguments><array><property id=\"0\"><number>%1%</number></property></array></arguments></invoke>") % layer).str();\r
                CASPAR_LOG(info) << flash_producer_->print() << " Invoking play-command: " << str;\r
                return flash_producer_->call(str);\r
        }\r
 \r
-       boost::unique_future<std::wstring> stop(int layer, unsigned int)\r
+       boost::unique_future<std::string> stop(int layer, unsigned int)\r
        {\r
-               auto str = (boost::wformat(L"<invoke name=\"Stop\" returntype=\"xml\"><arguments><array><property id=\"0\"><number>%1%</number></property></array><number>0</number></arguments></invoke>") % layer).str();\r
+               auto str = (boost::format("<invoke name=\"Stop\" returntype=\"xml\"><arguments><array><property id=\"0\"><number>%1%</number></property></array><number>0</number></arguments></invoke>") % layer).str();\r
                CASPAR_LOG(info) << flash_producer_->print() << " Invoking stop-command: " << str;\r
                return flash_producer_->call(str);\r
        }\r
 \r
-       boost::unique_future<std::wstring> next(int layer)\r
+       boost::unique_future<std::string> next(int layer)\r
        {\r
-               auto str = (boost::wformat(L"<invoke name=\"Next\" returntype=\"xml\"><arguments><array><property id=\"0\"><number>%1%</number></property></array></arguments></invoke>") % layer).str();\r
+               auto str = (boost::format("<invoke name=\"Next\" returntype=\"xml\"><arguments><array><property id=\"0\"><number>%1%</number></property></array></arguments></invoke>") % layer).str();\r
                CASPAR_LOG(info) << flash_producer_->print() << " Invoking next-command: " << str;\r
                return flash_producer_->call(str);\r
        }\r
 \r
-       boost::unique_future<std::wstring> update(int layer, const std::wstring& data)\r
+       boost::unique_future<std::string> update(int layer, const std::string& data)\r
        {\r
-               auto str = (boost::wformat(L"<invoke name=\"SetData\" returntype=\"xml\"><arguments><array><property id=\"0\"><number>%1%</number></property></array><string><![CDATA[%2%]]></string></arguments></invoke>") % layer % data).str();\r
+               auto str = (boost::format("<invoke name=\"SetData\" returntype=\"xml\"><arguments><array><property id=\"0\"><number>%1%</number></property></array><string><![CDATA[%2%]]></string></arguments></invoke>") % layer % data).str();\r
                CASPAR_LOG(info) << flash_producer_->print() <<" Invoking update-command: " << str;\r
                return flash_producer_->call(str);\r
        }\r
 \r
-       boost::unique_future<std::wstring> invoke(int layer, const std::wstring& label)\r
+       boost::unique_future<std::string> invoke(int layer, const std::string& label)\r
        {\r
-               auto str = (boost::wformat(L"<invoke name=\"Invoke\" returntype=\"xml\"><arguments><array><property id=\"0\"><number>%1%</number></property></array><string>%2%</string></arguments></invoke>") % layer % label).str();\r
+               auto str = (boost::format("<invoke name=\"Invoke\" returntype=\"xml\"><arguments><array><property id=\"0\"><number>%1%</number></property></array><string>%2%</string></arguments></invoke>") % layer % label).str();\r
                CASPAR_LOG(info) << flash_producer_->print() << " Invoking invoke-command: " << str;\r
                return flash_producer_->call(str);\r
        }\r
 \r
-       boost::unique_future<std::wstring> description(int layer)\r
+       boost::unique_future<std::string> description(int layer)\r
        {\r
-               auto str = (boost::wformat(L"<invoke name=\"GetDescription\" returntype=\"xml\"><arguments><array><property id=\"0\"><number>%1%</number></property></array></arguments></invoke>") % layer).str();\r
+               auto str = (boost::format("<invoke name=\"GetDescription\" returntype=\"xml\"><arguments><array><property id=\"0\"><number>%1%</number></property></array></arguments></invoke>") % layer).str();\r
                CASPAR_LOG(info) << flash_producer_->print() << " Invoking description-command: " << str;\r
                return flash_producer_->call(str);\r
        }\r
 \r
-       boost::unique_future<std::wstring> template_host_info()\r
+       boost::unique_future<std::string> template_host_info()\r
        {\r
-               auto str = (boost::wformat(L"<invoke name=\"GetInfo\" returntype=\"xml\"><arguments></arguments></invoke>")).str();\r
+               auto str = (boost::format("<invoke name=\"GetInfo\" returntype=\"xml\"><arguments></arguments></invoke>")).str();\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
+       boost::unique_future<std::string> call(const std::string& 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
+               static const boost::regex add_exp                       ("ADD (?<LAYER>\\d+) (?<FILENAME>[^\\s]+) (?<PLAY_ON_LOAD>\\d)( (?<DATA>.*))?");\r
+               static const boost::regex remove_exp            ("REMOVE (?<LAYER>\\d+)");\r
+               static const boost::regex play_exp                      ("PLAY (?<LAYER>\\d+)");\r
+               static const boost::regex stop_exp                      ("STOP (?<LAYER>\\d+)");\r
+               static const boost::regex next_exp                      ("NEXT (?<LAYER>\\d+)");\r
+               static const boost::regex update_exp            ("UPDATE (?<LAYER>\\d+) (?<DATA>.+)");\r
+               static const boost::regex invoke_exp            ("INVOKE (?<LAYER>\\d+) (?<LABEL>.+)");\r
+               static const boost::regex description_exp       ("INFO (?<LAYER>\\d+)");\r
+               static const boost::regex info_exp                      ("INFO");\r
                \r
-               boost::wsmatch what;\r
+               boost::smatch 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
+                       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()), "", 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
@@ -136,7 +136,7 @@ public:
                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
+                       return invoke(boost::lexical_cast<int>(what["LAYER"].str()), what["LABE"].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
@@ -155,38 +155,38 @@ public:
                return flash_producer_->last_frame();\r
        }               \r
                        \r
-       std::wstring print() const\r
+       std::string print() const\r
        {\r
                return flash_producer_->print();\r
        }\r
 \r
-       boost::property_tree::wptree info() const\r
+       boost::property_tree::ptree info() const\r
        {\r
-               boost::property_tree::wptree info;\r
-               info.add(L"type", L"cg-producer");\r
+               boost::property_tree::ptree info;\r
+               info.add("type", "cg-producer");\r
                return info;\r
        }\r
 \r
-       std::wstring timed_invoke(int layer, const std::wstring& label)\r
+       std::string timed_invoke(int layer, const std::string& label)\r
        {\r
                auto result = invoke(layer, label);\r
                if(result.timed_wait(boost::posix_time::seconds(2)))\r
                        return result.get();\r
-               return L"";\r
+               return "";\r
        }\r
-       std::wstring timed_description(int layer)\r
+       std::string timed_description(int layer)\r
        {\r
                auto result = description(layer);\r
                if(result.timed_wait(boost::posix_time::seconds(2)))\r
                        return result.get();\r
-               return L"";\r
+               return "";\r
        }\r
-       std::wstring timed_template_host_info()\r
+       std::string timed_template_host_info()\r
        {\r
                auto result = template_host_info();\r
                if(result.timed_wait(boost::posix_time::seconds(2)))\r
                        return result.get();\r
-               return L"";\r
+               return "";\r
        }\r
 };\r
        \r
@@ -194,9 +194,9 @@ safe_ptr<cg_producer> get_default_cg_producer(const safe_ptr<core::video_channel
 {      \r
        auto flash_producer = video_channel->stage()->foreground(render_layer).get();\r
 \r
-       if(flash_producer->print().find(L"flash[") == std::string::npos) // UGLY hack\r
+       if(flash_producer->print().find("flash[") == std::string::npos) // UGLY hack\r
        {\r
-               flash_producer = make_safe<cg_producer>(flash::create_producer(video_channel->mixer(), boost::assign::list_of<std::wstring>()));        \r
+               flash_producer = make_safe<cg_producer>(flash::create_producer(video_channel->mixer(), boost::assign::list_of<std::string>())); \r
                video_channel->stage()->load(render_layer, flash_producer); \r
                video_channel->stage()->play(render_layer);\r
        }\r
@@ -204,46 +204,46 @@ safe_ptr<cg_producer> get_default_cg_producer(const safe_ptr<core::video_channel
        return static_pointer_cast<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_ct_producer(const safe_ptr<core::frame_factory> frame_factory, const std::vector<std::string>& params) \r
 {\r
-       std::wstring filename = env::media_folder() + L"\\" + params[0] + L".ct";\r
+       std::string filename = env::media_folder() + "\\" + params[0] + ".ct";\r
        if(!boost::filesystem::exists(filename))\r
                return core::frame_producer::empty();\r
                \r
-       boost::filesystem2::wpath path(filename);\r
+       boost::filesystem2::path path(filename);\r
        path = boost::filesystem2::complete(path);\r
        filename = path.file_string();\r
 \r
-       auto flash_producer = flash::create_producer(frame_factory, boost::assign::list_of<std::wstring>());    \r
+       auto flash_producer = flash::create_producer(frame_factory, boost::assign::list_of<std::string>());     \r
        auto producer = make_safe<cg_producer>(flash_producer);\r
        producer->add(0, filename, 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_cg_producer(const safe_ptr<core::frame_factory> frame_factory, const std::vector<std::string>& params) \r
 {\r
-       if(params.empty() || params.at(0) != L"[CG]")\r
+       if(params.empty() || params.at(0) != "[CG]")\r
                return core::frame_producer::empty();\r
 \r
-       return make_safe<cg_producer>(flash::create_producer(frame_factory, boost::assign::list_of<std::wstring>()));   \r
+       return make_safe<cg_producer>(flash::create_producer(frame_factory, boost::assign::list_of<std::string>()));    \r
 }\r
 \r
 cg_producer::cg_producer(const safe_ptr<core::frame_producer>& frame_producer) : impl_(new implementation(frame_producer)){}\r
 cg_producer::cg_producer(cg_producer&& other) : impl_(std::move(other.impl_)){}\r
 safe_ptr<core::basic_frame> cg_producer::receive(int hints){return impl_->receive(hints);}\r
 safe_ptr<core::basic_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::add(int layer, const std::string& template_name,  bool play_on_load, const std::string& startFromLabel, const std::string& 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
+void cg_producer::update(int layer, const std::string& data){impl_->update(layer, data);}\r
+std::string cg_producer::print() const{return impl_->print();}\r
+boost::unique_future<std::string> cg_producer::call(const std::string& str){return impl_->call(str);}\r
+std::string cg_producer::invoke(int layer, const std::string& label){return impl_->timed_invoke(layer, label);}\r
+std::string cg_producer::description(int layer){return impl_->timed_description(layer);}\r
+std::string cg_producer::template_host_info(){return impl_->timed_template_host_info();}\r
+boost::property_tree::ptree cg_producer::info() const{return impl_->info();}\r
 \r
 }}
\ No newline at end of file
index 020d2493c1e5a206e63079d8a42df67ae87baa61..85f48cea5261ffdf015e4da97fadae9e7a230eb6 100644 (file)
@@ -44,21 +44,21 @@ public:
 \r
        virtual safe_ptr<core::basic_frame> receive(int) override;\r
        virtual safe_ptr<core::basic_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
+       virtual std::string print() const override;\r
+       virtual boost::unique_future<std::string> call(const std::string&) override;\r
+       virtual boost::property_tree::ptree info() const override;\r
 \r
        //cg_producer\r
 \r
-       void add(int layer, const std::wstring& template_name,  bool play_on_load, const std::wstring& start_from_label = TEXT(""), const std::wstring& data = TEXT(""));\r
+       void add(int layer, const std::string& template_name,  bool play_on_load, const std::string& start_from_label = "", const std::string& data = "");\r
        void remove(int layer);\r
        void play(int layer);\r
        void stop(int layer, unsigned int mix_out_duration);\r
        void next(int layer);\r
-       void update(int layer, const std::wstring& data);\r
-       std::wstring invoke(int layer, const std::wstring& label);\r
-       std::wstring description(int layer);\r
-       std::wstring template_host_info();\r
+       void update(int layer, const std::string& data);\r
+       std::string invoke(int layer, const std::string& label);\r
+       std::string description(int layer);\r
+       std::string template_host_info();\r
 \r
 private:\r
        struct implementation;\r
@@ -66,7 +66,7 @@ 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::string>& params);\r
+safe_ptr<core::frame_producer> create_cg_producer(const safe_ptr<core::frame_factory> frame_factory, const std::vector<std::string>& params);\r
 \r
 }}
\ No newline at end of file
index 224efcd6bc2bbb2cb495b14ec4782086dd441c81..59b40777d4a300d1b543ddd218852afefea00d5a 100644 (file)
@@ -90,10 +90,10 @@ private:
 \r
 struct template_host\r
 {\r
-       std::wstring  video_mode;\r
-       std::wstring  filename;\r
-       size_t            width;\r
-       size_t            height;\r
+       std::string video_mode;\r
+       std::string     filename;\r
+       size_t          width;\r
+       size_t          height;\r
 };\r
 \r
 template_host get_template_host(const core::video_format_desc& desc)\r
@@ -101,15 +101,15 @@ template_host get_template_host(const core::video_format_desc& desc)
        try\r
        {\r
                std::vector<template_host> template_hosts;\r
-               BOOST_FOREACH(auto& xml_mapping, env::properties().get_child(L"configuration.template-hosts"))\r
+               BOOST_FOREACH(auto& xml_mapping, env::properties().get_child("configuration.template-hosts"))\r
                {\r
                        try\r
                        {\r
                                template_host template_host;\r
-                               template_host.video_mode                = xml_mapping.second.get(L"video-mode", L"");\r
-                               template_host.filename                  = xml_mapping.second.get(L"filename",   L"cg.fth");\r
-                               template_host.width                             = xml_mapping.second.get(L"width",              desc.width);\r
-                               template_host.height                    = xml_mapping.second.get(L"height",             desc.height);\r
+                               template_host.video_mode                = xml_mapping.second.get("video-mode", "");\r
+                               template_host.filename                  = xml_mapping.second.get("filename",    "cg.fth");\r
+                               template_host.width                             = xml_mapping.second.get("width",               desc.width);\r
+                               template_host.height                    = xml_mapping.second.get("height",              desc.height);\r
                                template_hosts.push_back(template_host);\r
                        }\r
                        catch(...){}\r
@@ -117,7 +117,7 @@ template_host get_template_host(const core::video_format_desc& desc)
 \r
                auto template_host_it = boost::find_if(template_hosts, [&](template_host template_host){return template_host.video_mode == desc.name;});\r
                if(template_host_it == template_hosts.end())\r
-                       template_host_it = boost::find_if(template_hosts, [&](template_host template_host){return template_host.video_mode == L"";});\r
+                       template_host_it = boost::find_if(template_hosts, [&](template_host template_host){return template_host.video_mode == "";});\r
 \r
                if(template_host_it != template_hosts.end())\r
                        return *template_host_it;\r
@@ -125,11 +125,11 @@ template_host get_template_host(const core::video_format_desc& desc)
        catch(...){}\r
                \r
        template_host template_host;\r
-       template_host.filename = L"cg.fth";\r
+       template_host.filename = "cg.fth";\r
 \r
-       for(auto it = boost::filesystem2::wdirectory_iterator(env::template_folder()); it != boost::filesystem2::wdirectory_iterator(); ++it)\r
+       for(auto it = boost::filesystem2::directory_iterator(env::template_folder()); it != boost::filesystem2::directory_iterator(); ++it)\r
        {\r
-               if(boost::iequals(it->path().extension(), L"." + desc.name))\r
+               if(iequals(it->path().extension(), "." + desc.name))\r
                {\r
                        template_host.filename = it->filename();\r
                        break;\r
@@ -143,7 +143,7 @@ template_host get_template_host(const core::video_format_desc& desc)
 \r
 class flash_renderer\r
 {      \r
-       const std::wstring filename_;\r
+       const std::string filename_;\r
 \r
        const std::shared_ptr<core::frame_factory> frame_factory_;\r
        \r
@@ -161,7 +161,7 @@ class flash_renderer
        const size_t height_;\r
        \r
 public:\r
-       flash_renderer(const safe_ptr<diagnostics::graph>& graph, const std::shared_ptr<core::frame_factory>& frame_factory, const std::wstring& filename, int width, int height) \r
+       flash_renderer(const safe_ptr<diagnostics::graph>& graph, const std::shared_ptr<core::frame_factory>& frame_factory, const std::string& filename, int width, int height) \r
                : graph_(graph)\r
                , filename_(filename)\r
                , frame_factory_(frame_factory)\r
@@ -179,29 +179,29 @@ public:
                graph_->set_color("skip-sync", diagnostics::color(0.8f, 0.3f, 0.2f));                   \r
                \r
                if(FAILED(CComObject<caspar::flash::FlashAxContainer>::CreateInstance(&ax_)))\r
-                       BOOST_THROW_EXCEPTION(caspar_exception() << msg_info(narrow(print()) + " Failed to create FlashAxContainer"));\r
+                       BOOST_THROW_EXCEPTION(caspar_exception() << msg_info(print() + " Failed to create FlashAxContainer"));\r
                \r
                ax_->set_print([this]{return L"flash_renderer";});\r
 \r
                if(FAILED(ax_->CreateAxControl()))\r
-                       BOOST_THROW_EXCEPTION(caspar_exception() << msg_info(narrow(print()) + " Failed to Create FlashAxControl"));\r
+                       BOOST_THROW_EXCEPTION(caspar_exception() << msg_info(print() + " Failed to Create FlashAxControl"));\r
                \r
                CComPtr<IShockwaveFlash> spFlash;\r
                if(FAILED(ax_->QueryControl(&spFlash)))\r
-                       BOOST_THROW_EXCEPTION(caspar_exception() << msg_info(narrow(print()) + " Failed to Query FlashAxControl"));\r
+                       BOOST_THROW_EXCEPTION(caspar_exception() << msg_info(print() + " Failed to Query FlashAxControl"));\r
                                                                                                \r
                if(FAILED(spFlash->put_Playing(true)) )\r
-                       BOOST_THROW_EXCEPTION(caspar_exception() << msg_info(narrow(print()) + " Failed to start playing Flash"));\r
+                       BOOST_THROW_EXCEPTION(caspar_exception() << msg_info(print() + " Failed to start playing Flash"));\r
 \r
-               if(FAILED(spFlash->put_Movie(CComBSTR(filename.c_str()))))\r
-                       BOOST_THROW_EXCEPTION(caspar_exception() << msg_info(narrow(print()) + " Failed to Load Template Host"));\r
+               if(FAILED(spFlash->put_Movie(CComBSTR(u16(filename).c_str()))))\r
+                       BOOST_THROW_EXCEPTION(caspar_exception() << msg_info(print() + " Failed to Load Template Host"));\r
                                                                                \r
                if(FAILED(spFlash->put_ScaleMode(2)))  //Exact fit. Scale without respect to the aspect ratio.\r
-                       BOOST_THROW_EXCEPTION(caspar_exception() << msg_info(narrow(print()) + " Failed to Set Scale Mode"));\r
+                       BOOST_THROW_EXCEPTION(caspar_exception() << msg_info(print() + " Failed to Set Scale Mode"));\r
                                                \r
                ax_->SetSize(width_, height_);          \r
        \r
-               CASPAR_LOG(info) << print() << L" Successfully initialized with template-host: " << filename << L" width: " << width_ << L" height: " << height_ << L".";\r
+               CASPAR_LOG(info) << print() << " Successfully initialized with template-host: " << filename << " width: " << width_ << " height: " << height_ << ".";\r
        }\r
 \r
        ~flash_renderer()\r
@@ -211,18 +211,18 @@ public:
                        ax_->DestroyAxControl();\r
                        ax_->Release();\r
                }\r
-               CASPAR_LOG(info) << print() << L" Uninitialized.";\r
+               CASPAR_LOG(info) << print() << " Uninitialized.";\r
        }\r
        \r
-       std::wstring call(const std::wstring& param)\r
+       std::string call(const std::string& param)\r
        {               \r
                std::wstring result;\r
 \r
-               if(!ax_->FlashCall(param, result))\r
-                       CASPAR_LOG(warning) << print() << L" Flash call failed:" << param;//BOOST_THROW_EXCEPTION(invalid_operation() << msg_info("Flash function call failed.") << arg_name_info("param") << arg_value_info(narrow(param)));\r
+               if(!ax_->FlashCall(u16(param), result))\r
+                       CASPAR_LOG(warning) << print() << " Flash call failed:" << param;//BOOST_THROW_EXCEPTION(invalid_operation() << msg_info("Flash function call failed.") << arg_name_info("param") << arg_value_info((param)));\r
                graph_->add_tag("param");\r
 \r
-               return result;\r
+               return u8(result);\r
        }\r
        \r
        safe_ptr<core::basic_frame> render_frame(bool has_underflow)\r
@@ -272,15 +272,15 @@ public:
                return ax_->GetFPS();   \r
        }\r
        \r
-       std::wstring print()\r
+       std::string print()\r
        {\r
-               return L"flash[" + boost::filesystem::wpath(filename_).filename() + L"]";               \r
+               return "flash[" + boost::filesystem::path(filename_).filename() + "]";          \r
        }\r
 };\r
 \r
 struct flash_producer : public core::frame_producer\r
 {      \r
-       const std::wstring filename_;   \r
+       const std::string filename_;    \r
        const safe_ptr<core::frame_factory> frame_factory_;\r
 \r
        tbb::atomic<int> fps_;\r
@@ -297,16 +297,16 @@ struct flash_producer : public core::frame_producer
        int width_;\r
        int height_;\r
 public:\r
-       flash_producer(const safe_ptr<core::frame_factory>& frame_factory, const std::wstring& filename, size_t width, size_t height) \r
+       flash_producer(const safe_ptr<core::frame_factory>& frame_factory, const std::string& filename, size_t width, size_t height) \r
                : filename_(filename)           \r
                , frame_factory_(frame_factory)\r
-               , context_(L"flash_producer")\r
+               , context_("flash_producer")\r
                , last_frame_(core::basic_frame::empty())\r
                , width_(width > 0 ? width : frame_factory->get_video_format_desc().width)\r
                , height_(height > 0 ? height : frame_factory->get_video_format_desc().height)\r
        {       \r
                if(!boost::filesystem::exists(filename))\r
-                       BOOST_THROW_EXCEPTION(file_not_found() << boost::errinfo_file_name(narrow(filename)));  \r
+                       BOOST_THROW_EXCEPTION(file_not_found() << boost::errinfo_file_name(filename));  \r
 \r
                fps_ = 0;\r
 \r
@@ -344,9 +344,9 @@ public:
                return last_frame_;\r
        }               \r
        \r
-       virtual boost::unique_future<std::wstring> call(const std::wstring& param) override\r
+       virtual boost::unique_future<std::string> call(const std::string& param) override\r
        {       \r
-               return context_.begin_invoke([=]() -> std::wstring\r
+               return context_.begin_invoke([=]() -> std::string\r
                {\r
                        if(!context_)\r
                                initialize();\r
@@ -357,7 +357,7 @@ public:
 \r
                                //const auto& format_desc = frame_factory_->get_video_format_desc();\r
                                //if(abs(context_->fps() - format_desc.fps) > 0.01 && abs(context_->fps()/2.0 - format_desc.fps) > 0.01)\r
-                               //      CASPAR_LOG(warning) << print() << " Invalid frame-rate: " << context_->fps() << L". Should be either " << format_desc.fps << L" or " << format_desc.fps*2.0 << L".";\r
+                               //      CASPAR_LOG(warning) << print() << " Invalid frame-rate: " << context_->fps() << ". Should be either " << format_desc.fps << " or " << format_desc.fps*2.0 << ".";\r
                        }\r
                        catch(...)\r
                        {\r
@@ -366,19 +366,19 @@ public:
                                frame_buffer_.push(core::basic_frame::empty());\r
                        }\r
 \r
-                       return L"";\r
+                       return "";\r
                });\r
        }\r
                \r
-       virtual std::wstring print() const override\r
+       virtual std::string print() const override\r
        { \r
-               return L"flash[" + boost::filesystem::wpath(filename_).filename() + L"|" + boost::lexical_cast<std::wstring>(fps_) + L"]";              \r
+               return "flash[" + boost::filesystem::path(filename_).filename() + "|" + boost::lexical_cast<std::string>(fps_) + "]";           \r
        }       \r
 \r
-       virtual boost::property_tree::wptree info() const override\r
+       virtual boost::property_tree::ptree info() const override\r
        {\r
-               boost::property_tree::wptree info;\r
-               info.add(L"type", L"flash-producer");\r
+               boost::property_tree::ptree info;\r
+               info.add("type", "flash-producer");\r
                return info;\r
        }\r
 \r
@@ -436,7 +436,7 @@ public:
 \r
                                graph_->set_value("output-buffer-count", static_cast<float>(frame_buffer_.size())/static_cast<float>(frame_buffer_.capacity()));        \r
                                fps_.fetch_and_store(static_cast<int>(context_->fps()*100.0));                          \r
-                               graph_->set_text(narrow(print()));\r
+                               graph_->set_text(print());\r
 \r
                                render(renderer);\r
                        }\r
@@ -450,25 +450,25 @@ public:
        }\r
 };\r
 \r
-safe_ptr<core::frame_producer> create_producer(const safe_ptr<core::frame_factory>& frame_factory, const std::vector<std::wstring>& params)\r
+safe_ptr<core::frame_producer> create_producer(const safe_ptr<core::frame_factory>& frame_factory, const std::vector<std::string>& params)\r
 {\r
        auto template_host = get_template_host(frame_factory->get_video_format_desc());\r
        \r
-       return create_producer_destroy_proxy(make_safe<flash_producer>(frame_factory, env::template_folder() + L"\\" + template_host.filename, template_host.width, template_host.height));\r
+       return create_producer_destroy_proxy(make_safe<flash_producer>(frame_factory, env::template_folder() + "\\" + template_host.filename, template_host.width, template_host.height));\r
 }\r
 \r
-std::wstring find_template(const std::wstring& template_name)\r
+std::string find_template(const std::string& template_name)\r
 {\r
-       if(boost::filesystem::exists(template_name + L".ft")) \r
-               return template_name + L".ft";\r
+       if(boost::filesystem::exists(template_name + ".ft")) \r
+               return template_name + ".ft";\r
        \r
-       if(boost::filesystem::exists(template_name + L".ct"))\r
-               return template_name + L".ct";\r
+       if(boost::filesystem::exists(template_name + ".ct"))\r
+               return template_name + ".ct";\r
        \r
-       if(boost::filesystem::exists(template_name + L".swf"))\r
-               return template_name + L".swf";\r
+       if(boost::filesystem::exists(template_name + ".swf"))\r
+               return template_name + ".swf";\r
 \r
-       return L"";\r
+       return "";\r
 }\r
 \r
 }}
\ No newline at end of file
index a0a34764d68745e7b4bb0e5f105b6ac3a76ef3a3..e7da11f39b50f5bf5a9c0f77b51f00818743aaea 100644 (file)
@@ -30,8 +30,8 @@
 \r
 namespace caspar { namespace flash {\r
 \r
-safe_ptr<core::frame_producer> create_producer(const safe_ptr<core::frame_factory>& frame_factory, const std::vector<std::wstring>& params);\r
+safe_ptr<core::frame_producer> create_producer(const safe_ptr<core::frame_factory>& frame_factory, const std::vector<std::string>& params);\r
 \r
-std::wstring find_template(const std::wstring& templateName);\r
+std::string find_template(const std::string& templateName);\r
 \r
 }}
\ No newline at end of file
index d88bdf35563d6418e681ab67585d388c48099a46..25e0c4c039ef033bc6aa84c9f4105f167d112218 100644 (file)
@@ -60,7 +60,7 @@ public:
                {\r
                        try\r
                        {\r
-                               auto filename = narrow(env::data_folder()) +  boost::posix_time::to_iso_string(boost::posix_time::second_clock::local_time()) + ".png";\r
+                               auto filename = (env::data_folder()) +  boost::posix_time::to_iso_string(boost::posix_time::second_clock::local_time()) + ".png";\r
 \r
                                auto bitmap = std::shared_ptr<FIBITMAP>(FreeImage_Allocate(format_desc.width, format_desc.height, 32), FreeImage_Unload);\r
                                memcpy(FreeImage_GetBits(bitmap.get()), frame->image_data().begin(), frame->image_size());\r
@@ -77,15 +77,15 @@ public:
                return false;\r
        }\r
 \r
-       virtual std::wstring print() const override\r
+       virtual std::string print() const override\r
        {\r
-               return L"image[]";\r
+               return "image[]";\r
        }\r
 \r
-       virtual boost::property_tree::wptree info() const override\r
+       virtual boost::property_tree::ptree info() const override\r
        {\r
-               boost::property_tree::wptree info;\r
-               info.add(L"type", L"image-consumer");\r
+               boost::property_tree::ptree info;\r
+               info.add("type", "image-consumer");\r
                return info;\r
        }\r
 \r
@@ -100,9 +100,9 @@ public:
        }\r
 };\r
 \r
-safe_ptr<core::frame_consumer> create_consumer(const std::vector<std::wstring>& params)\r
+safe_ptr<core::frame_consumer> create_consumer(const std::vector<std::string>& params)\r
 {\r
-       if(params.size() < 1 || params[0] != L"IMAGE")\r
+       if(params.size() < 1 || params[0] != "IMAGE")\r
                return core::frame_consumer::empty();\r
 \r
        return make_safe<image_consumer>();\r
index 7a3aa1f00d071d5c0cd38a9fe471b9a57750224d..c4203d4956762f4e468c3aa7416ab60222344a73 100644 (file)
@@ -38,6 +38,6 @@ namespace core {
 \r
 namespace image {\r
        \r
-safe_ptr<core::frame_consumer> create_consumer(const std::vector<std::wstring>& params);\r
+safe_ptr<core::frame_consumer> create_consumer(const std::vector<std::string>& params);\r
 \r
 }}
\ No newline at end of file
index 63b6e3d489306cb0c820299ddf371b211df70a3a..260b12a00d7b521ef49c9409ea6283e7ac2713dd 100644 (file)
@@ -38,12 +38,12 @@ void init()
 {\r
        core::register_producer_factory(create_scroll_producer);\r
        core::register_producer_factory(create_producer);\r
-       core::register_consumer_factory([](const std::vector<std::wstring>& params){return create_consumer(params);});\r
+       core::register_consumer_factory([](const std::vector<std::string>& params){return create_consumer(params);});\r
 }\r
 \r
-std::wstring get_version()\r
+std::string get_version()\r
 {\r
-       return widen(std::string(FreeImage_GetVersion()));\r
+       return std::string(FreeImage_GetVersion());\r
 }\r
 \r
 }}
\ No newline at end of file
index 512afff49717284c8132bcd066f6a2b426836d42..b858b6d25dd003e0808a33882797d63c0d1ce15b 100644 (file)
@@ -27,6 +27,6 @@ namespace caspar { namespace image {
 \r
 void init();\r
 \r
-std::wstring get_version();\r
+std::string get_version();\r
 \r
 }}
\ No newline at end of file
index a21ec916696a23439c05177554d7d769857f4795..38dbab64f658a783a5887425c9baa0e69b0ed55b 100644 (file)
 \r
 #include <algorithm>\r
 \r
-using namespace boost::assign;\r
-\r
 namespace caspar { namespace image {\r
 \r
 struct image_producer : public core::frame_producer\r
 {      \r
-       const std::wstring filename_;\r
+       const std::string filename_;\r
        safe_ptr<core::basic_frame> frame_;\r
        \r
-       explicit image_producer(const safe_ptr<core::frame_factory>& frame_factory, const std::wstring& filename) \r
+       explicit image_producer(const safe_ptr<core::frame_factory>& frame_factory, const std::string& filename) \r
                : filename_(filename)\r
                , frame_(core::basic_frame::empty())    \r
        {\r
@@ -63,7 +61,7 @@ struct image_producer : public core::frame_producer
                frame->commit();\r
                frame_ = std::move(frame);\r
 \r
-               CASPAR_LOG(info) << print() << L" Initialized";\r
+               CASPAR_LOG(info) << print() << " Initialized";\r
        }\r
        \r
        // frame_producer\r
@@ -78,34 +76,34 @@ struct image_producer : public core::frame_producer
                return frame_;\r
        }\r
 \r
-       virtual std::wstring print() const override\r
+       virtual std::string print() const override\r
        {\r
-               return L"image_producer[" + filename_ + L"]";\r
+               return "image_producer[" + filename_ + "]";\r
        }\r
 \r
-       virtual boost::property_tree::wptree info() const override\r
+       virtual boost::property_tree::ptree info() const override\r
        {\r
-               boost::property_tree::wptree info;\r
-               info.add(L"type", L"image-producer");\r
-               info.add(L"filename", filename_);\r
+               boost::property_tree::ptree info;\r
+               info.add("type", "image-producer");\r
+               info.add("filename", filename_);\r
                return info;\r
        }\r
 };\r
 \r
-safe_ptr<core::frame_producer> create_producer(const safe_ptr<core::frame_factory>& frame_factory, const std::vector<std::wstring>& params)\r
+safe_ptr<core::frame_producer> create_producer(const safe_ptr<core::frame_factory>& frame_factory, const std::vector<std::string>& params)\r
 {\r
-       static const std::vector<std::wstring> extensions = 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
-       std::wstring filename = env::media_folder() + L"\\" + params[0];\r
+       static const std::vector<std::string> extensions = boost::assign::list_of("png")("tga")("bmp")("jpg")("jpeg")("gif")("tiff")("tif")("jp2")("jpx")("j2k")("j2c");\r
+       std::string filename = env::media_folder() + "\\" + params[0];\r
        \r
-       auto ext = std::find_if(extensions.begin(), extensions.end(), [&](const std::wstring& ex) -> bool\r
+       auto ext = std::find_if(extensions.begin(), extensions.end(), [&](const std::string& ex) -> bool\r
                {                                       \r
-                       return boost::filesystem::is_regular_file(boost::filesystem::wpath(filename).replace_extension(ex));\r
+                       return boost::filesystem::is_regular_file(boost::filesystem::path(filename).replace_extension(ex));\r
                });\r
 \r
        if(ext == extensions.end())\r
                return core::frame_producer::empty();\r
 \r
-       return make_safe<image_producer>(frame_factory, filename + L"." + *ext);\r
+       return make_safe<image_producer>(frame_factory, filename + "." + *ext);\r
 }\r
 \r
 \r
index 036950a7a8e9198eff64963e0738d0c9a87e618c..aca25c140dec37cee86517c073c8b02b4a60c3fb 100644 (file)
@@ -28,6 +28,6 @@
 \r
 namespace caspar { namespace image {\r
 \r
-safe_ptr<core::frame_producer> create_producer(const safe_ptr<core::frame_factory>& frame_factory, const std::vector<std::wstring>& params);\r
+safe_ptr<core::frame_producer> create_producer(const safe_ptr<core::frame_factory>& frame_factory, const std::vector<std::string>& params);\r
 \r
 }}
\ No newline at end of file
index a084c0d86713abd1c58cc2c0c3e8f2068dde0b10..a3b4c266fc2ac5d3266d257c1bc20412d3934367 100644 (file)
 #include <algorithm>\r
 #include <array>\r
 \r
-using namespace boost::assign;\r
-\r
 namespace caspar { namespace image {\r
                \r
 struct image_scroll_producer : public core::frame_producer\r
 {      \r
-       const std::wstring                                                      filename_;\r
+       const std::string                                                       filename_;\r
        std::vector<safe_ptr<core::basic_frame>>        frames_;\r
        core::video_format_desc                                         format_desc_;\r
        size_t                                                                          width_;\r
@@ -63,7 +61,7 @@ struct image_scroll_producer : public core::frame_producer
 \r
        safe_ptr<core::basic_frame>                                     last_frame_;\r
        \r
-       explicit image_scroll_producer(const safe_ptr<core::frame_factory>& frame_factory, const std::wstring& filename, int speed) \r
+       explicit image_scroll_producer(const safe_ptr<core::frame_factory>& frame_factory, const std::string& filename, int speed) \r
                : filename_(filename)\r
                , delta_(0)\r
                , format_desc_(frame_factory->get_video_format_desc())\r
@@ -157,7 +155,7 @@ struct image_scroll_producer : public core::frame_producer
                        }\r
                }\r
 \r
-               CASPAR_LOG(info) << print() << L" Initialized";\r
+               CASPAR_LOG(info) << print() << " Initialized";\r
        }\r
        \r
        // frame_producer\r
@@ -200,16 +198,16 @@ struct image_scroll_producer : public core::frame_producer
                return last_frame_;\r
        }\r
                \r
-       virtual std::wstring print() const override\r
+       virtual std::string print() const override\r
        {\r
-               return L"image_scroll_producer[" + filename_ + L"]";\r
+               return "image_scroll_producer[" + filename_ + "]";\r
        }\r
 \r
-       virtual boost::property_tree::wptree info() const override\r
+       virtual boost::property_tree::ptree info() const override\r
        {\r
-               boost::property_tree::wptree info;\r
-               info.add(L"type", L"image-scroll-producer");\r
-               info.add(L"filename", filename_);\r
+               boost::property_tree::ptree info;\r
+               info.add("type", "image-scroll-producer");\r
+               info.add("filename", filename_);\r
                return info;\r
        }\r
 \r
@@ -229,21 +227,21 @@ struct image_scroll_producer : public core::frame_producer
        }\r
 };\r
 \r
-safe_ptr<core::frame_producer> create_scroll_producer(const safe_ptr<core::frame_factory>& frame_factory, const std::vector<std::wstring>& params)\r
+safe_ptr<core::frame_producer> create_scroll_producer(const safe_ptr<core::frame_factory>& frame_factory, const std::vector<std::string>& params)\r
 {\r
-       static const std::vector<std::wstring> extensions = 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
-       std::wstring filename = env::media_folder() + L"\\" + params[0];\r
+       static const std::vector<std::string> extensions = boost::assign::list_of("png")("tga")("bmp")("jpg")("jpeg")("gif")("tiff")("tif")("jp2")("jpx")("j2k")("j2c");\r
+       std::string filename = env::media_folder() + "\\" + params[0];\r
        \r
-       auto ext = std::find_if(extensions.begin(), extensions.end(), [&](const std::wstring& ex) -> bool\r
+       auto ext = std::find_if(extensions.begin(), extensions.end(), [&](const std::string& ex) -> bool\r
                {                                       \r
-                       return boost::filesystem::is_regular_file(boost::filesystem::wpath(filename).replace_extension(ex));\r
+                       return boost::filesystem::is_regular_file(boost::filesystem::path(filename).replace_extension(ex));\r
                });\r
 \r
        if(ext == extensions.end())\r
                return core::frame_producer::empty();\r
        \r
        size_t speed = 0;\r
-       auto speed_it = std::find(params.begin(), params.end(), L"SPEED");\r
+       auto speed_it = std::find(params.begin(), params.end(), "SPEED");\r
        if(speed_it != params.end())\r
        {\r
                if(++speed_it != params.end())\r
@@ -253,7 +251,7 @@ safe_ptr<core::frame_producer> create_scroll_producer(const safe_ptr<core::frame
        if(speed == 0)\r
                return core::frame_producer::empty();\r
 \r
-       return make_safe<image_scroll_producer>(frame_factory, filename + L"." + *ext, speed);\r
+       return make_safe<image_scroll_producer>(frame_factory, filename + "." + *ext, speed);\r
 }\r
 \r
 }}
\ No newline at end of file
index 42d2a7d28bc82807593e883db35e2816333a2009..0426fe204fa90505cfec8fccf75964016a957436 100644 (file)
@@ -28,6 +28,6 @@
 \r
 namespace caspar { namespace image {\r
 \r
-safe_ptr<core::frame_producer> create_scroll_producer(const safe_ptr<core::frame_factory>& frame_factory, const std::vector<std::wstring>& params);\r
+safe_ptr<core::frame_producer> create_scroll_producer(const safe_ptr<core::frame_factory>& frame_factory, const std::vector<std::string>& params);\r
 \r
 }}
\ No newline at end of file
index 42f1f3c7dc73766fa4d718ed526d53a639737fed..44ec26d3ad0963f8770c81f86ede15e7ea7c4ce6 100644 (file)
@@ -58,9 +58,4 @@ std::shared_ptr<FIBITMAP> load_image(const std::string& filename)
        return bitmap;\r
 }\r
 \r
-std::shared_ptr<FIBITMAP> load_image(const std::wstring& filename)\r
-{\r
-       return load_image(narrow(filename));\r
-}\r
-\r
 }}
\ No newline at end of file
index face6479cb8435ed1998aaa21d2f04a399979455..0e264afc756232091846ffcbac62f128724e3f1b 100644 (file)
@@ -29,6 +29,5 @@
 namespace caspar { namespace image {\r
 \r
 std::shared_ptr<FIBITMAP> load_image(const std::string& filename);\r
-std::shared_ptr<FIBITMAP> load_image(const std::wstring& filename);\r
 \r
 }}\r
index 17e900e90ae6bb888224962371b131ad49d0ff32..6e149cd369f418c65c3b4d6ce105000b8dcbeca3 100644 (file)
@@ -79,7 +79,7 @@ public:
                input_.try_push(std::make_shared<audio_buffer_16>());\r
                input_.try_push(std::make_shared<audio_buffer_16>());\r
 \r
-               CASPAR_LOG(info) << print() << L" Successfully Uninitialized."; \r
+               CASPAR_LOG(info) << print() << " Successfully Uninitialized.";  \r
        }\r
 \r
        // frame consumer\r
@@ -104,15 +104,15 @@ public:
                return true;\r
        }\r
        \r
-       virtual std::wstring print() const override\r
+       virtual std::string print() const override\r
        {\r
-               return L"oal[" + boost::lexical_cast<std::wstring>(channel_index_) + L"|" + format_desc_.name + L"]";\r
+               return "oal[" + boost::lexical_cast<std::string>(channel_index_) + "|" + format_desc_.name + "]";\r
        }\r
 \r
-       virtual boost::property_tree::wptree info() const override\r
+       virtual boost::property_tree::ptree info() const override\r
        {\r
-               boost::property_tree::wptree info;\r
-               info.add(L"type", L"oal-consumer");\r
+               boost::property_tree::ptree info;\r
+               info.add("type", "oal-consumer");\r
                return info;\r
        }\r
        \r
@@ -144,9 +144,9 @@ public:
        }\r
 };\r
 \r
-safe_ptr<core::frame_consumer> create_consumer(const std::vector<std::wstring>& params)\r
+safe_ptr<core::frame_consumer> create_consumer(const std::vector<std::string>& params)\r
 {\r
-       if(params.size() < 1 || params[0] != L"AUDIO")\r
+       if(params.size() < 1 || params[0] != "AUDIO")\r
                return core::frame_consumer::empty();\r
 \r
        return make_safe<oal_consumer>();\r
index 6d8dd04e68405e20470ca41f18732aeb130e80d9..2e6e68343e84e34f8e129f6c70dd29b2c65dfc81 100644 (file)
@@ -35,7 +35,7 @@ namespace core {
 \r
 namespace oal {\r
        \r
-safe_ptr<core::frame_consumer> create_consumer(const std::vector<std::wstring>& params);\r
+safe_ptr<core::frame_consumer> create_consumer(const std::vector<std::string>& params);\r
 safe_ptr<core::frame_consumer> create_consumer();\r
 \r
 }}
\ No newline at end of file
index 696fe3ea2a70d69d80e2f3344f0c5dd8844d996c..a1264e8309d19319334bd6b5372d1ecfd81f8d9f 100644 (file)
@@ -29,7 +29,7 @@ namespace caspar { namespace oal {
 \r
 void init()\r
 {\r
-       core::register_consumer_factory([](const std::vector<std::wstring>& params){return create_consumer(params);});\r
+       core::register_consumer_factory([](const std::vector<std::string>& params){return create_consumer(params);});\r
 }\r
 \r
 }}
\ No newline at end of file
index 32233d2cdb7bc7fb0f8e7ae25efa4490c869f013..7e8bad1b85e9d1c295995868acc57a4607f2e27b 100644 (file)
@@ -80,7 +80,7 @@ enum stretch
 \r
 struct configuration\r
 {\r
-       std::wstring    name;\r
+       std::string     name;\r
        size_t                  screen_index;\r
        stretch                 stretch;\r
        bool                    windowed;\r
@@ -88,7 +88,7 @@ struct configuration
        bool                    key_only;\r
 \r
        configuration()\r
-               : name(L"ogl")\r
+               : name("ogl")\r
                , screen_index(0)\r
                , stretch(fill)\r
                , windowed(true)\r
@@ -139,7 +139,7 @@ public:
                , screen_height_(format_desc.height)\r
                , square_width_(format_desc.square_width)\r
                , square_height_(format_desc.square_height)\r
-               , filter_(format_desc.field_mode == core::field_mode::progressive || !config.auto_deinterlace ? L"" : L"YADIF=0:-1", boost::assign::list_of(PIX_FMT_BGRA))\r
+               , filter_(format_desc.field_mode == core::field_mode::progressive || !config.auto_deinterlace ? "" : "YADIF=0:-1", boost::assign::list_of(PIX_FMT_BGRA))\r
        {               \r
                frame_buffer_.set_capacity(2);\r
                \r
@@ -156,11 +156,11 @@ public:
                        displayDevices.push_back(d_device);\r
 \r
                if(config_.screen_index >= displayDevices.size())\r
-                       BOOST_THROW_EXCEPTION(out_of_range() << arg_name_info("screen_index_") << msg_info(narrow(print())));\r
+                       BOOST_THROW_EXCEPTION(out_of_range() << arg_name_info("screen_index_") << msg_info((print())));\r
                \r
                DEVMODE devmode = {};\r
                if(!EnumDisplaySettings(displayDevices[config_.screen_index].DeviceName, ENUM_CURRENT_SETTINGS, &devmode))\r
-                       BOOST_THROW_EXCEPTION(invalid_operation() << arg_name_info("screen_index") << msg_info(narrow(print()) + " EnumDisplaySettings"));\r
+                       BOOST_THROW_EXCEPTION(invalid_operation() << arg_name_info("screen_index") << msg_info(print() + " EnumDisplaySettings"));\r
                \r
                screen_x_               = devmode.dmPosition.x;\r
                screen_y_               = devmode.dmPosition.y;\r
@@ -183,7 +183,7 @@ public:
                if(!GLEW_VERSION_2_1)\r
                        BOOST_THROW_EXCEPTION(not_supported() << msg_info("Missing OpenGL 2.1 support."));\r
 \r
-               window_.Create(sf::VideoMode(screen_width_, screen_height_, 32), narrow(print()), config_.windowed ? sf::Style::Resize | sf::Style::Close : sf::Style::Fullscreen);\r
+               window_.Create(sf::VideoMode(screen_width_, screen_height_, 32), (print()), config_.windowed ? sf::Style::Resize | sf::Style::Close : sf::Style::Fullscreen);\r
                window_.ShowMouseCursor(false);\r
                window_.SetPosition(screen_x_, screen_y_);\r
                window_.SetSize(screen_width_, screen_height_);\r
@@ -364,9 +364,9 @@ public:
                return is_running_;\r
        }\r
                \r
-       std::wstring print() const\r
+       std::string print() const\r
        {       \r
-               return config_.name + L"[" + boost::lexical_cast<std::wstring>(channel_index_) + L"|" + format_desc_.name + L"]";\r
+               return config_.name + "[" + boost::lexical_cast<std::string>(channel_index_) + "|" + format_desc_.name + "]";\r
        }\r
        \r
        void calculate_aspect()\r
@@ -443,7 +443,7 @@ public:
                {\r
                        auto str = print();\r
                        consumer_.reset();\r
-                       CASPAR_LOG(info) << str << L" Successfully Uninitialized.";     \r
+                       CASPAR_LOG(info) << str << " Successfully Uninitialized.";      \r
                }\r
        }\r
 \r
@@ -453,7 +453,7 @@ public:
        {\r
                consumer_.reset();\r
                consumer_.reset(new ogl_consumer(config_, format_desc, channel_index));\r
-               CASPAR_LOG(info) << print() << L" Successfully Initialized.";   \r
+               CASPAR_LOG(info) << print() << " Successfully Initialized.";    \r
        }\r
        \r
        virtual bool send(const safe_ptr<core::read_frame>& frame) override\r
@@ -461,18 +461,18 @@ public:
                return consumer_->send(frame);\r
        }\r
        \r
-       virtual std::wstring print() const override\r
+       virtual std::string print() const override\r
        {\r
-               return consumer_ ? consumer_->print() : L"[ogl_consumer]";\r
+               return consumer_ ? consumer_->print() : "[ogl_consumer]";\r
        }\r
 \r
-       virtual boost::property_tree::wptree info() const override\r
+       virtual boost::property_tree::ptree info() const override\r
        {\r
-               boost::property_tree::wptree info;\r
-               info.add(L"type", L"ogl-consumer");\r
-               info.add(L"key-only", config_.key_only);\r
-               info.add(L"windowed", config_.windowed);\r
-               info.add(L"auto-deinterlace", config_.auto_deinterlace);\r
+               boost::property_tree::ptree info;\r
+               info.add("type", "ogl-consumer");\r
+               info.add("key-only", config_.key_only);\r
+               info.add("windowed", config_.windowed);\r
+               info.add("auto-deinterlace", config_.auto_deinterlace);\r
                return info;\r
        }\r
 \r
@@ -492,9 +492,9 @@ public:
        }\r
 };     \r
 \r
-safe_ptr<core::frame_consumer> create_consumer(const std::vector<std::wstring>& params)\r
+safe_ptr<core::frame_consumer> create_consumer(const std::vector<std::string>& params)\r
 {\r
-       if(params.size() < 1 || params[0] != L"SCREEN")\r
+       if(params.size() < 1 || params[0] != "SCREEN")\r
                return core::frame_consumer::empty();\r
        \r
        configuration config;\r
@@ -505,24 +505,24 @@ safe_ptr<core::frame_consumer> create_consumer(const std::vector<std::wstring>&
        if(params.size() > 2) \r
                config.windowed = lexical_cast_or_default<bool>(params[3], config.windowed);\r
 \r
-       config.key_only = std::find(params.begin(), params.end(), L"KEY_ONLY") != params.end();\r
+       config.key_only = std::find(params.begin(), params.end(), "KEY_ONLY") != params.end();\r
 \r
        return make_safe<ogl_consumer_proxy>(config);\r
 }\r
 \r
-safe_ptr<core::frame_consumer> create_consumer(const boost::property_tree::wptree& ptree) \r
+safe_ptr<core::frame_consumer> create_consumer(const boost::property_tree::ptree& ptree) \r
 {\r
        configuration config;\r
-       config.name                             = ptree.get(L"name",     config.name);\r
-       config.screen_index             = ptree.get(L"device",   config.screen_index+1)-1;\r
-       config.windowed                 = ptree.get(L"windowed", config.windowed);\r
-       config.key_only                 = ptree.get(L"key-only", config.key_only);\r
-       config.auto_deinterlace = ptree.get(L"auto-deinterlace", config.auto_deinterlace);\r
+       config.name                             = ptree.get("name",      config.name);\r
+       config.screen_index             = ptree.get("device",   config.screen_index+1)-1;\r
+       config.windowed                 = ptree.get("windowed", config.windowed);\r
+       config.key_only                 = ptree.get("key-only", config.key_only);\r
+       config.auto_deinterlace = ptree.get("auto-deinterlace", config.auto_deinterlace);\r
        \r
-       auto stretch_str = ptree.get(L"stretch", L"default");\r
-       if(stretch_str == L"uniform")\r
+       auto stretch_str = ptree.get("stretch", "default");\r
+       if(stretch_str == "uniform")\r
                config.stretch = stretch::uniform;\r
-       else if(stretch_str == L"uniform_to_fill")\r
+       else if(stretch_str == "uniform_to_fill")\r
                config.stretch = stretch::uniform_to_fill;\r
        \r
        return make_safe<ogl_consumer_proxy>(config);\r
index 611e8f651d225740ca0a5c33ae1b3d6c9eff7dc6..8bb9b9c1dfa31030afb0e300f092b2857ca4d55f 100644 (file)
@@ -35,7 +35,7 @@ namespace core {
 namespace ogl {\r
 \r
 \r
-safe_ptr<core::frame_consumer> create_consumer(const std::vector<std::wstring>& params);\r
-safe_ptr<core::frame_consumer> create_consumer(const boost::property_tree::wptree& ptree);\r
+safe_ptr<core::frame_consumer> create_consumer(const std::vector<std::string>& params);\r
+safe_ptr<core::frame_consumer> create_consumer(const boost::property_tree::ptree& ptree);\r
 \r
 }}
\ No newline at end of file
index ab3086d36e0ad0f7015a6df6c4046148563f2b66..3e30c516ca7d059f04ee3dc7abcce25ee1c35af2 100644 (file)
@@ -29,7 +29,7 @@ namespace caspar { namespace ogl {
 \r
 void init()\r
 {\r
-       caspar::core::register_consumer_factory([](const std::vector<std::wstring>& params){return create_consumer(params);});\r
+       caspar::core::register_consumer_factory([](const std::vector<std::string>& params){return create_consumer(params);});\r
 }\r
 \r
 }}
\ No newline at end of file
index ad081fdacb21305729c74b4934f41b0735c69cf8..6f192b4ffda5fc5739a7ca940fa75800ccefcb12 100644 (file)
@@ -106,7 +106,7 @@ namespace amcp {
                {\r
                        _parameters2 = _parameters;\r
                        for(size_t n = 0; n < _parameters.size(); ++n)\r
-                               _parameters[n] = boost::to_upper_copy(_parameters[n]);\r
+                               _parameters[n] = to_upper_copy(_parameters[n]);\r
                        return (TNeedChannel && !GetChannel()) || _parameters.size() < TMinParameters ? false : DoExecute();\r
                }\r
 \r
index 72b67333e236eccb3da0a379bab0aa49d038ea8d..0b766a6d97118809a5b8f9e47eec646079321e2a 100644 (file)
@@ -26,7 +26,7 @@
 namespace caspar { namespace protocol { namespace amcp {\r
        \r
 AMCPCommandQueue::AMCPCommandQueue() \r
-       : executor_(L"AMCPCommandQueue")\r
+       : executor_("AMCPCommandQueue")\r
 {\r
 }\r
 \r
@@ -49,14 +49,14 @@ void AMCPCommandQueue::AddCommand(AMCPCommandPtr pCurrentCommand)
                        try\r
                        {\r
                                if(pCurrentCommand->Execute()) \r
-                                       CASPAR_LOG(info) << "Executed command: " << pCurrentCommand->print();\r
+                                       CASPAR_LOG(info) << "Executed command: " << u8(pCurrentCommand->print());\r
                                else \r
-                                       CASPAR_LOG(info) << "Failed to execute command: " << pCurrentCommand->print();\r
+                                       CASPAR_LOG(info) << "Failed to execute command: " << u8(pCurrentCommand->print());\r
                        }\r
                        catch(...)\r
                        {\r
                                CASPAR_LOG_CURRENT_EXCEPTION();\r
-                               CASPAR_LOG(info) << "Failed to execute command:" << pCurrentCommand->print();\r
+                               CASPAR_LOG(info) << "Failed to execute command:" << u8(pCurrentCommand->print());\r
                        }\r
                                \r
                        pCurrentCommand->SendReply();\r
index 75f8e3f9ddfa90b6f17c8f544f87bc38d4ec4b88..d75b84d36cfcc5a5f4255f7f6d84351de3933029 100644 (file)
@@ -98,13 +98,13 @@ std::wstring MediaInfo(const boost::filesystem::wpath& path)
        if(boost::filesystem::is_regular_file(path))\r
        {\r
                std::wstring clipttype = TEXT(" N/A ");\r
-               std::wstring extension = boost::to_upper_copy(path.extension());\r
+               std::wstring extension = to_upper_copy(path.extension());\r
                if(extension == TEXT(".TGA") || extension == TEXT(".COL") || extension == L".PNG" || extension == L".JPEG" || extension == L".JPG" ||\r
                        extension == L"GIF" || extension == L"BMP")\r
                        clipttype = TEXT(" STILL ");\r
                else if(extension == TEXT(".WAV") || extension == TEXT(".MP3"))\r
                        clipttype = TEXT(" STILL ");\r
-               else if(caspar::ffmpeg::is_valid_file(path.file_string()) || extension == L".CT")\r
+               else if(caspar::ffmpeg::is_valid_file(u8(path.file_string())) || extension == L".CT")\r
                        clipttype = TEXT(" MOVIE ");\r
 \r
                if(clipttype != TEXT(" N/A "))\r
@@ -138,17 +138,17 @@ std::wstring MediaInfo(const boost::filesystem::wpath& path)
 std::wstring ListMedia()\r
 {      \r
        std::wstringstream replyString;\r
-       for (boost::filesystem::wrecursive_directory_iterator itr(env::media_folder()), end; itr != end; ++itr) \r
+       for (boost::filesystem::wrecursive_directory_iterator itr(u16(env::media_folder())), end; itr != end; ++itr)    \r
                replyString << MediaInfo(itr->path());\r
        \r
-       return boost::to_upper_copy(replyString.str());\r
+       return to_upper_copy(replyString.str());\r
 }\r
 \r
 std::wstring ListTemplates() \r
 {\r
        std::wstringstream replyString;\r
 \r
-       for (boost::filesystem::wrecursive_directory_iterator itr(env::template_folder()), end; itr != end; ++itr)\r
+       for (boost::filesystem::wrecursive_directory_iterator itr(u16(env::template_folder())), end; itr != end; ++itr)\r
        {               \r
                if(boost::filesystem::is_regular_file(itr->path()) && (itr->path().extension() == L".ft" || itr->path().extension() == L".ct"))\r
                {\r
@@ -164,7 +164,7 @@ std::wstring ListTemplates()
                        auto sizeWStr = std::wstring(sizeStr.begin(), sizeStr.end());\r
 \r
                        std::wstring dir = relativePath.parent_path().external_directory_string();\r
-                       std::wstring file = boost::to_upper_copy(relativePath.filename());\r
+                       std::wstring file = to_upper_copy(relativePath.filename());\r
                        relativePath = boost::filesystem::wpath(dir + L"/" + file);\r
                                                \r
                        auto str = relativePath.replace_extension(TEXT("")).external_file_string();\r
@@ -232,24 +232,24 @@ bool CallCommand::DoExecute()
                for(auto it = std::begin(_parameters2)+2; it != std::end(_parameters2); ++it)\r
                        param += L" " + *it;\r
                \r
-               boost::unique_future<std::wstring> result;\r
+               boost::unique_future<std::string> result;\r
                if(what == L"B")\r
-                       result = GetChannel()->stage()->call(GetLayerIndex(), false, param);\r
+                       result = GetChannel()->stage()->call(GetLayerIndex(), false, u8(param));\r
                else if(what == L"F")\r
-                       result = GetChannel()->stage()->call(GetLayerIndex(), true, param);\r
+                       result = GetChannel()->stage()->call(GetLayerIndex(), true, u8(param));\r
                else\r
-                       result = GetChannel()->stage()->call(GetLayerIndex(), true, _parameters.at(0) + L" " + param);\r
+                       result = GetChannel()->stage()->call(GetLayerIndex(), true, u8(_parameters.at(0)) + " " + u8(param));\r
        \r
                if(!result.timed_wait(boost::posix_time::seconds(2)))\r
                        BOOST_THROW_EXCEPTION(timed_out());\r
 \r
-               CASPAR_LOG(info) << "Executed call: " <<  _parameters[0] << TEXT(" successfully");\r
+               CASPAR_LOG(info) << "Executed call: " <<  u8(_parameters[0]) << TEXT(" successfully");\r
                \r
                std::wstringstream replyString;\r
                if(result.get().empty())\r
                        replyString << TEXT("202 CALL OK\r\n");\r
                else\r
-                       replyString << TEXT("201 CALL OK\r\n") << result.get() << L"\r\n";\r
+                       replyString << TEXT("201 CALL OK\r\n") << u16(result.get()) << L"\r\n";\r
                \r
                SetReplyString(replyString.str());\r
 \r
@@ -294,7 +294,7 @@ bool MixerCommand::DoExecute()
                        };\r
 \r
                        int layer = GetLayerIndex();\r
-                       GetChannel()->stage()->apply_frame_transform(GetLayerIndex(), transform, duration, tween);\r
+                       GetChannel()->stage()->apply_frame_transform(GetLayerIndex(), transform, duration, u8(tween));\r
                }\r
                else if(_parameters[0] == L"FILL" || _parameters[0] == L"FILL_RECT")\r
                {\r
@@ -319,7 +319,7 @@ bool MixerCommand::DoExecute()
                        };\r
                                \r
                        int layer = GetLayerIndex();\r
-                       GetChannel()->stage()->apply_frame_transform(GetLayerIndex(), transform, duration, tween);\r
+                       GetChannel()->stage()->apply_frame_transform(GetLayerIndex(), transform, duration, u8(tween));\r
                }\r
                else if(_parameters[0] == L"CLIP" || _parameters[0] == L"CLIP_RECT")\r
                {\r
@@ -340,7 +340,7 @@ bool MixerCommand::DoExecute()
                        };\r
                                \r
                        int layer = GetLayerIndex();\r
-                       GetChannel()->stage()->apply_frame_transform(GetLayerIndex(), transform, duration, tween);\r
+                       GetChannel()->stage()->apply_frame_transform(GetLayerIndex(), transform, duration, u8(tween));\r
                }\r
                else if(_parameters[0] == L"GRID")\r
                {\r
@@ -365,7 +365,7 @@ bool MixerCommand::DoExecute()
                                                transform.clip_scale[1]                 = delta;                        \r
                                                return transform;\r
                                        };\r
-                                       GetChannel()->stage()->apply_frame_transform(index, transform, duration, tween);\r
+                                       GetChannel()->stage()->apply_frame_transform(index, transform, duration, u8(tween));\r
                                }\r
                        }\r
                }\r
@@ -373,7 +373,7 @@ bool MixerCommand::DoExecute()
                {\r
                        auto blend_str = _parameters.at(1);                                                             \r
                        int layer = GetLayerIndex();\r
-                       GetChannel()->mixer()->set_blend_mode(GetLayerIndex(), get_blend_mode(blend_str));      \r
+                       GetChannel()->mixer()->set_blend_mode(GetLayerIndex(), get_blend_mode(u8(blend_str)));  \r
                }\r
                else if(_parameters[0] == L"BRIGHTNESS")\r
                {\r
@@ -387,7 +387,7 @@ bool MixerCommand::DoExecute()
                        };\r
                                \r
                        int layer = GetLayerIndex();\r
-                       GetChannel()->stage()->apply_frame_transform(GetLayerIndex(), transform, duration, tween);      \r
+                       GetChannel()->stage()->apply_frame_transform(GetLayerIndex(), transform, duration, u8(tween));  \r
                }\r
                else if(_parameters[0] == L"SATURATION")\r
                {\r
@@ -401,7 +401,7 @@ bool MixerCommand::DoExecute()
                        };\r
                                \r
                        int layer = GetLayerIndex();\r
-                       GetChannel()->stage()->apply_frame_transform(GetLayerIndex(), transform, duration, tween);      \r
+                       GetChannel()->stage()->apply_frame_transform(GetLayerIndex(), transform, duration, u8(tween));  \r
                }\r
                else if(_parameters[0] == L"CONTRAST")\r
                {\r
@@ -415,7 +415,7 @@ bool MixerCommand::DoExecute()
                        };\r
                                \r
                        int layer = GetLayerIndex();\r
-                       GetChannel()->stage()->apply_frame_transform(GetLayerIndex(), transform, duration, tween);      \r
+                       GetChannel()->stage()->apply_frame_transform(GetLayerIndex(), transform, duration, u8(tween));  \r
                }\r
                else if(_parameters[0] == L"LEVELS")\r
                {\r
@@ -435,7 +435,7 @@ bool MixerCommand::DoExecute()
                        };\r
                                \r
                        int layer = GetLayerIndex();\r
-                       GetChannel()->stage()->apply_frame_transform(GetLayerIndex(), transform, duration, tween);      \r
+                       GetChannel()->stage()->apply_frame_transform(GetLayerIndex(), transform, duration, u8(tween));  \r
                }\r
                else if(_parameters[0] == L"VOLUME")\r
                {\r
@@ -450,7 +450,7 @@ bool MixerCommand::DoExecute()
                        };\r
                                \r
                        int layer = GetLayerIndex();\r
-                       GetChannel()->stage()->apply_frame_transform(GetLayerIndex(), transform, duration, tween);\r
+                       GetChannel()->stage()->apply_frame_transform(GetLayerIndex(), transform, duration, u8(tween));\r
                }\r
                else if(_parameters[0] == L"CLEAR")\r
                {\r
@@ -534,10 +534,13 @@ bool AddCommand::DoExecute()
        //Perform loading of the clip\r
        try\r
        {\r
-               auto consumer = create_consumer(_parameters);\r
+               std::vector<std::string> params;\r
+               boost::range::transform(_parameters, std::back_inserter(params), u16_u8);\r
+\r
+               auto consumer = create_consumer(params);\r
                GetChannel()->output()->add(GetLayerIndex(consumer->index()), consumer);\r
        \r
-               CASPAR_LOG(info) << "Added " <<  _parameters[0] << TEXT(" successfully");\r
+               CASPAR_LOG(info) << "Added " << u8(_parameters[0]) << " successfully";\r
 \r
                SetReplyString(TEXT("202 ADD OK\r\n"));\r
 \r
@@ -562,9 +565,12 @@ bool RemoveCommand::DoExecute()
        //Perform loading of the clip\r
        try\r
        {\r
+               std::vector<std::string> params;\r
+               boost::range::transform(_parameters, std::back_inserter(params), u16_u8);\r
+\r
                auto index = GetLayerIndex(std::numeric_limits<int>::min());\r
                if(index == std::numeric_limits<int>::min())\r
-                       index = create_consumer(_parameters)->index();\r
+                       index = create_consumer(params)->index();\r
 \r
                GetChannel()->output()->remove(index);\r
 \r
@@ -592,10 +598,14 @@ bool LoadCommand::DoExecute()
        try\r
        {\r
                _parameters[0] = _parameters[0];\r
-               auto pFP = create_producer(GetChannel()->mixer(), _parameters);         \r
+               \r
+               std::vector<std::string> params;\r
+               boost::range::transform(_parameters, std::back_inserter(params), u16_u8);\r
+\r
+               auto pFP = create_producer(GetChannel()->mixer(), params);              \r
                GetChannel()->stage()->load(GetLayerIndex(), pFP, true);\r
        \r
-               CASPAR_LOG(info) << "Loaded " <<  _parameters[0] << TEXT(" successfully");\r
+               CASPAR_LOG(info) << "Loaded " << u8(_parameters[0]) << TEXT(" successfully");\r
 \r
                SetReplyString(TEXT("202 LOAD OK\r\n"));\r
 \r
@@ -673,7 +683,7 @@ bool LoadbgCommand::DoExecute()
                transitionInfo.duration = lexical_cast_or_default<size_t>(what["DURATION"].str());\r
                auto direction = what["DIRECTION"].matched ? what["DIRECTION"].str() : L"";\r
                auto tween = what["TWEEN"].matched ? what["TWEEN"].str() : L"";\r
-               transitionInfo.tweener = get_tweener(tween);            \r
+               transitionInfo.tweener = get_tweener(u8(tween));                \r
 \r
                if(transition == TEXT("CUT"))\r
                        transitionInfo.type = transition::cut;\r
@@ -700,16 +710,19 @@ bool LoadbgCommand::DoExecute()
        try\r
        {\r
                _parameters[0] = _parameters[0];\r
-               auto pFP = create_producer(GetChannel()->mixer(), _parameters);\r
+               std::vector<std::string> params;\r
+               boost::range::transform(_parameters, std::back_inserter(params), u16_u8);\r
+\r
+               auto pFP = create_producer(GetChannel()->mixer(), params);\r
                if(pFP == frame_producer::empty())\r
-                       BOOST_THROW_EXCEPTION(file_not_found() << msg_info(_parameters.size() > 0 ? narrow(_parameters[0]) : ""));\r
+                       BOOST_THROW_EXCEPTION(file_not_found() << msg_info(_parameters.size() > 0 ? u8(_parameters[0]) : ""));\r
 \r
                bool auto_play = std::find(_parameters.begin(), _parameters.end(), L"AUTO") != _parameters.end();\r
 \r
                auto pFP2 = create_transition_producer(GetChannel()->get_video_format_desc().field_mode, pFP, transitionInfo);\r
                GetChannel()->stage()->load(GetLayerIndex(), pFP2, false, auto_play ? transitionInfo.duration : -1); // TODO: LOOP\r
        \r
-               CASPAR_LOG(info) << "Loaded " << _parameters[0] << TEXT(" successfully to background");\r
+               CASPAR_LOG(info) << "Loaded " << u8(_parameters[0]) << " successfully to background";\r
                SetReplyString(TEXT("202 LOADBG OK\r\n"));\r
 \r
                return true;\r
@@ -760,7 +773,7 @@ bool PlayCommand::DoExecute()
                        if(!lbg.Execute())\r
                                CASPAR_LOG(warning) << " Failed to play.";\r
 \r
-                       CASPAR_LOG(info) << "Playing " << _parameters[0];\r
+                       CASPAR_LOG(info) << "Playing " << u8(_parameters[0]);\r
                }\r
 \r
                GetChannel()->stage()->play(GetLayerIndex());\r
@@ -807,7 +820,7 @@ bool ClearCommand::DoExecute()
 \r
 bool PrintCommand::DoExecute()\r
 {\r
-       GetChannel()->output()->add(create_consumer(boost::assign::list_of(L"IMAGE")));\r
+       GetChannel()->output()->add(create_consumer(boost::assign::list_of("IMAGE")));\r
                \r
        SetReplyString(TEXT("202 PRINT OK\r\n"));\r
 \r
@@ -817,7 +830,7 @@ bool PrintCommand::DoExecute()
 bool LogCommand::DoExecute()\r
 {\r
        if(_parameters.at(0) == L"LEVEL")\r
-               log::set_log_level(_parameters.at(1));\r
+               log::set_log_level(u8(_parameters.at(1)));\r
 \r
        SetReplyString(TEXT("202 LOG OK\r\n"));\r
 \r
@@ -919,7 +932,7 @@ bool CGCommand::DoExecuteAdd() {
                else \r
                {\r
                        //The data is not an XML-string, it must be a filename\r
-                       std::wstring filename = env::data_folder();\r
+                       std::wstring filename = u16(env::data_folder());\r
                        filename.append(dataString);\r
                        filename.append(TEXT(".ftd"));\r
 \r
@@ -938,19 +951,19 @@ bool CGCommand::DoExecuteAdd() {
                }\r
        }\r
 \r
-       std::wstring fullFilename = flash::find_template(env::template_folder() + _parameters[2]);\r
+       std::wstring fullFilename = u16(flash::find_template(env::template_folder() + u8(_parameters[2])));\r
        if(!fullFilename.empty())\r
        {\r
                std::wstring extension = boost::filesystem::wpath(fullFilename).extension();\r
                std::wstring filename = _parameters[2];\r
                filename.append(extension);\r
 \r
-               flash::get_default_cg_producer(safe_ptr<core::video_channel>(GetChannel()), GetLayerIndex(flash::cg_producer::DEFAULT_LAYER))->add(layer, filename, bDoStart, label, (pDataString!=0) ? pDataString : TEXT(""));\r
+               flash::get_default_cg_producer(safe_ptr<core::video_channel>(GetChannel()), GetLayerIndex(flash::cg_producer::DEFAULT_LAYER))->add(layer, u8(filename), bDoStart, u8(label), u8((pDataString!=0) ? pDataString : TEXT("")));\r
                SetReplyString(TEXT("202 CG OK\r\n"));\r
        }\r
        else\r
        {\r
-               CASPAR_LOG(warning) << "Could not find template " << _parameters[2];\r
+               CASPAR_LOG(warning) << "Could not find template " << u8(_parameters[2]);\r
                SetReplyString(TEXT("404 CG ERROR\r\n"));\r
        }\r
        return true;\r
@@ -1067,7 +1080,7 @@ bool CGCommand::DoExecuteUpdate()
                if(dataString.at(0) != TEXT('<'))\r
                {\r
                        //The data is not an XML-string, it must be a filename\r
-                       std::wstring filename = env::data_folder();\r
+                       std::wstring filename = u16(env::data_folder());\r
                        filename.append(dataString);\r
                        filename.append(TEXT(".ftd"));\r
 \r
@@ -1086,7 +1099,7 @@ bool CGCommand::DoExecuteUpdate()
                }               \r
 \r
                int layer = _ttoi(_parameters.at(1).c_str());\r
-               flash::get_default_cg_producer(safe_ptr<core::video_channel>(GetChannel()), GetLayerIndex(flash::cg_producer::DEFAULT_LAYER))->update(layer, dataString);\r
+               flash::get_default_cg_producer(safe_ptr<core::video_channel>(GetChannel()), GetLayerIndex(flash::cg_producer::DEFAULT_LAYER))->update(layer, u8(dataString));\r
        }\r
        catch(...)\r
        {\r
@@ -1111,8 +1124,8 @@ bool CGCommand::DoExecuteInvoke()
                        return false;\r
                }\r
                int layer = _ttoi(_parameters[1].c_str());\r
-               auto result = flash::get_default_cg_producer(safe_ptr<core::video_channel>(GetChannel()), GetLayerIndex(flash::cg_producer::DEFAULT_LAYER))->invoke(layer, _parameters2[2]);\r
-               replyString << result << TEXT("\r\n"); \r
+               auto result = flash::get_default_cg_producer(safe_ptr<core::video_channel>(GetChannel()), GetLayerIndex(flash::cg_producer::DEFAULT_LAYER))->invoke(layer, u8(_parameters2[2]));\r
+               replyString << u16(result) << TEXT("\r\n"); \r
        }\r
        else \r
        {\r
@@ -1140,12 +1153,12 @@ bool CGCommand::DoExecuteInfo()
                int layer = _ttoi(_parameters[1].c_str());\r
                auto desc = flash::get_default_cg_producer(safe_ptr<core::video_channel>(GetChannel()), GetLayerIndex(flash::cg_producer::DEFAULT_LAYER))->description(layer);\r
                \r
-               replyString << desc << TEXT("\r\n"); \r
+               replyString << u16(desc) << TEXT("\r\n"); \r
        }\r
        else \r
        {\r
                auto info = flash::get_default_cg_producer(safe_ptr<core::video_channel>(GetChannel()), GetLayerIndex(flash::cg_producer::DEFAULT_LAYER))->template_host_info();\r
-               replyString << info << TEXT("\r\n"); \r
+               replyString << u16(info) << TEXT("\r\n"); \r
        }       \r
 \r
        SetReplyString(replyString.str());\r
@@ -1174,7 +1187,7 @@ bool DataCommand::DoExecuteStore()
                return false;\r
        }\r
 \r
-       std::wstring filename = env::data_folder();\r
+       std::wstring filename = u16(env::data_folder());\r
        filename.append(_parameters[1]);\r
        filename.append(TEXT(".ftd"));\r
 \r
@@ -1201,7 +1214,7 @@ bool DataCommand::DoExecuteRetrieve()
                return false;\r
        }\r
 \r
-       std::wstring filename = env::data_folder();\r
+       std::wstring filename = u16(env::data_folder());\r
        filename.append(_parameters[1]);\r
        filename.append(TEXT(".ftd"));\r
 \r
@@ -1236,11 +1249,11 @@ bool DataCommand::DoExecuteList()
        std::wstringstream replyString;\r
        replyString << TEXT("200 DATA LIST OK\r\n");\r
 \r
-       for (boost::filesystem::wrecursive_directory_iterator itr(env::data_folder()), end; itr != end; ++itr)\r
+       for (boost::filesystem::wrecursive_directory_iterator itr(u16(env::data_folder())), end; itr != end; ++itr)\r
        {                       \r
                if(boost::filesystem::is_regular_file(itr->path()))\r
                {\r
-                       if(!boost::iequals(itr->path().extension(), L".ftd"))\r
+                       if(!iequals(itr->path().extension(), L".ftd"))\r
                                continue;\r
                        \r
                        auto relativePath = boost::filesystem::wpath(itr->path().file_string().substr(env::data_folder().size()-1, itr->path().file_string().size()));\r
@@ -1255,7 +1268,7 @@ bool DataCommand::DoExecuteList()
        \r
        replyString << TEXT("\r\n");\r
 \r
-       SetReplyString(boost::to_upper_copy(replyString.str()));\r
+       SetReplyString(to_upper_copy(replyString.str()));\r
        return true;\r
 }\r
 \r
@@ -1266,11 +1279,11 @@ bool CinfCommand::DoExecute()
        try\r
        {\r
                std::wstring info;\r
-               for (boost::filesystem::wrecursive_directory_iterator itr(env::media_folder()), end; itr != end; ++itr)\r
+               for (boost::filesystem::wrecursive_directory_iterator itr(u16(env::media_folder())), end; itr != end; ++itr)\r
                {\r
                        auto path = itr->path();\r
                        auto file = path.replace_extension(L"").filename();\r
-                       if(boost::iequals(file, _parameters.at(0)))\r
+                       if(iequals(file, _parameters.at(0)))\r
                                info += MediaInfo(itr->path()) + L"\r\n";\r
                }\r
 \r
@@ -1292,87 +1305,86 @@ bool CinfCommand::DoExecute()
        return true;\r
 }\r
 \r
-void GenerateChannelInfo(int index, const safe_ptr<core::video_channel>& pChannel, std::wstringstream& replyString)\r
+void GenerateChannelInfo(int index, const safe_ptr<core::video_channel>& pChannel, std::stringstream& replyString)\r
 {\r
-       replyString << index+1 << TEXT(" ") << pChannel->get_video_format_desc().name << TEXT(" PLAYING") << TEXT("\r\n");\r
+       replyString << index+1 << " " << pChannel->get_video_format_desc().name << " PLAYING" << "\r\n";\r
 }\r
 \r
 bool InfoCommand::DoExecute()\r
 {\r
-       std::wstringstream replyString;\r
+       std::stringstream replyString;\r
        \r
-       boost::property_tree::xml_writer_settings<wchar_t> w(' ', 3);\r
+       boost::property_tree::xml_writer_settings<char> w(' ', 3);\r
 \r
        try\r
        {\r
                if(_parameters.size() >= 1 && _parameters[0] == L"TEMPLATE")\r
                {               \r
-                       replyString << L"201 INFO TEMPLATE OK\r\n";\r
+                       replyString << "201 INFO TEMPLATE OK\r\n";\r
 \r
                        // Needs to be extended for any file, not just flash.\r
 \r
-                       auto filename = flash::find_template(env::template_folder() + _parameters.at(1));\r
+                       auto filename = u16(flash::find_template(env::template_folder() + u8(_parameters.at(1))));\r
                                                \r
-                       std::wstringstream str;\r
-                       str << widen(flash::read_template_meta_info(filename));\r
-                       boost::property_tree::wptree info;\r
+                       std::stringstream str;\r
+                       str << flash::read_template_meta_info(filename);\r
+                       boost::property_tree::ptree info;\r
                        boost::property_tree::xml_parser::read_xml(str, info, boost::property_tree::xml_parser::trim_whitespace | boost::property_tree::xml_parser::no_comments);\r
 \r
                        boost::property_tree::xml_parser::write_xml(replyString, info, w);\r
                }\r
                else if(_parameters.size() >= 1 && _parameters[0] == L"CONFIG")\r
                {               \r
-                       replyString << L"201 INFO CONFIG OK\r\n";\r
-\r
+                       replyString << "201 INFO CONFIG OK\r\n";\r
                        boost::property_tree::write_xml(replyString, caspar::env::properties(), w);\r
                }\r
                else if(_parameters.size() >= 1 && _parameters[0] == L"PATHS")\r
                {\r
-                       replyString << L"201 INFO PATHS OK\r\n";\r
+                       replyString << "201 INFO PATHS OK\r\n";\r
 \r
-                       boost::property_tree::wptree info;\r
-                       info.add_child(L"paths", caspar::env::properties().get_child(L"configuration.paths"));\r
-                       info.add(L"paths.initial-path", boost::filesystem2::initial_path<boost::filesystem2::wpath>().directory_string() + L"\\");\r
+                       boost::property_tree::ptree info;\r
+                       info.add_child("paths", caspar::env::properties().get_child("configuration.paths"));\r
+                       info.add("paths.initial-path", boost::filesystem2::initial_path().directory_string() + "\\");\r
 \r
                        boost::property_tree::write_xml(replyString, info, w);\r
                }\r
                else if(_parameters.size() >= 1 && _parameters[0] == L"SYSTEM")\r
                {\r
-                       replyString << L"201 INFO SYSTEM OK\r\n";\r
+                       replyString << "201 INFO SYSTEM OK\r\n";\r
                        \r
-                       boost::property_tree::wptree info;\r
+                       boost::property_tree::ptree info;\r
                        \r
-                       info.add(L"system.name",                                        caspar::get_system_product_name());\r
-                       info.add(L"system.windows.name",                        caspar::get_win_product_name());\r
-                       info.add(L"system.windows.service-pack",        caspar::get_win_sp_version());\r
-                       info.add(L"system.cpu",                                         caspar::get_cpu_info());\r
+                       info.add("system.name",                                 caspar::get_system_product_name());\r
+                       info.add("system.windows.name",                 caspar::get_win_product_name());\r
+                       info.add("system.windows.service-pack", caspar::get_win_sp_version());\r
+                       info.add("system.cpu",                                  caspar::get_cpu_info());\r
        \r
                        BOOST_FOREACH(auto device, caspar::decklink::get_device_list())\r
-                               info.add(L"system.decklink.device", device);\r
+                               info.add("system.decklink.device", device);\r
 \r
                        BOOST_FOREACH(auto device, caspar::bluefish::get_device_list())\r
-                               info.add(L"system.bluefish.device", device);\r
+                               info.add("system.bluefish.device", device);\r
                                \r
-                       info.add(L"system.flash",                                       caspar::flash::get_version());\r
-                       info.add(L"system.free-image",                          caspar::image::get_version());\r
-                       info.add(L"system.ffmpeg.avcodec",                      caspar::ffmpeg::get_avcodec_version());\r
-                       info.add(L"system.ffmpeg.avformat",                     caspar::ffmpeg::get_avformat_version());\r
-                       info.add(L"system.ffmpeg.avfilter",                     caspar::ffmpeg::get_avfilter_version());\r
-                       info.add(L"system.ffmpeg.avutil",                       caspar::ffmpeg::get_avutil_version());\r
-                       info.add(L"system.ffmpeg.swscale",                      caspar::ffmpeg::get_swscale_version());\r
+                       info.add("system.flash",                                        caspar::flash::get_version());\r
+                       info.add("system.free-image",                           caspar::image::get_version());\r
+                       info.add("system.ffmpeg.avcodec",                       caspar::ffmpeg::get_avcodec_version());\r
+                       info.add("system.ffmpeg.avformat",                      caspar::ffmpeg::get_avformat_version());\r
+                       info.add("system.ffmpeg.avfilter",                      caspar::ffmpeg::get_avfilter_version());\r
+                       info.add("system.ffmpeg.avutil",                        caspar::ffmpeg::get_avutil_version());\r
+                       info.add("system.ffmpeg.swscale",                       caspar::ffmpeg::get_swscale_version());\r
                                                \r
                        boost::property_tree::write_xml(replyString, info, w);\r
                }\r
                else if(_parameters.size() >= 1 && _parameters[0] == L"SERVER")\r
                {\r
-                       replyString << L"201 INFO SYSTEM OK\r\n";\r
+                       replyString << "201 INFO SYSTEM OK\r\n";\r
                        \r
-                       boost::property_tree::wptree info;\r
+                       boost::property_tree::ptree info;\r
 \r
                        int index = 0;\r
                        BOOST_FOREACH(auto channel, channels_)\r
-                               info.add_child(L"channels.channel", channel->info())\r
-                                       .add(L"index", ++index);\r
+                               info.add_child("channels.channel", channel->info())\r
+                                       .add("index", ++index);\r
                        \r
                        boost::property_tree::write_xml(replyString, info, w);\r
                }\r
@@ -1380,8 +1392,8 @@ bool InfoCommand::DoExecute()
                {                       \r
                        if(_parameters.size() >= 1)\r
                        {\r
-                               replyString << TEXT("201 INFO OK\r\n");\r
-                               boost::property_tree::wptree info;\r
+                               replyString << "201 INFO OK\r\n";\r
+                               boost::property_tree::ptree info;\r
 \r
                                std::vector<std::wstring> split;\r
                                boost::split(split, _parameters[0], boost::is_any_of("-"));\r
@@ -1394,22 +1406,22 @@ bool InfoCommand::DoExecute()
                                \r
                                if(layer == std::numeric_limits<int>::min())\r
                                {       \r
-                                       info.add_child(L"channel", channels_.at(channel)->info())\r
-                                                       .add(L"index", channel);\r
+                                       info.add_child("channel", channels_.at(channel)->info())\r
+                                                       .add("index", channel);\r
                                }\r
                                else\r
                                {\r
                                        if(_parameters.size() >= 2)\r
                                        {\r
                                                if(_parameters[1] == L"B")\r
-                                                       info.add_child(L"producer", channels_.at(channel)->stage()->background(layer).get()->info());\r
+                                                       info.add_child("producer", channels_.at(channel)->stage()->background(layer).get()->info());\r
                                                else\r
-                                                       info.add_child(L"producer", channels_.at(channel)->stage()->foreground(layer).get()->info());\r
+                                                       info.add_child("producer", channels_.at(channel)->stage()->foreground(layer).get()->info());\r
                                        }\r
                                        else\r
                                        {\r
-                                               info.add_child(L"layer", channels_.at(channel)->stage()->info(layer).get())\r
-                                                       .add(L"index", layer);\r
+                                               info.add_child("layer", channels_.at(channel)->stage()->info(layer).get())\r
+                                                       .add("index", layer);\r
                                        }\r
                                }\r
                                boost::property_tree::xml_parser::write_xml(replyString, info, w);\r
@@ -1417,10 +1429,9 @@ bool InfoCommand::DoExecute()
                        else\r
                        {\r
                                // This is needed for backwards compatibility with old clients\r
-                               replyString << TEXT("200 INFO OK\r\n");\r
+                               replyString << "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
                        }\r
 \r
                }\r
@@ -1431,8 +1442,8 @@ bool InfoCommand::DoExecute()
                return false;\r
        }\r
 \r
-       replyString << TEXT("\r\n");\r
-       SetReplyString(replyString.str());\r
+       replyString << "\r\n";\r
+       SetReplyString(u16(replyString.str()));\r
        return true;\r
 }\r
 \r
@@ -1450,7 +1461,7 @@ bool ClsCommand::DoExecute()
        replyString << TEXT("200 CLS OK\r\n");\r
        replyString << ListMedia();\r
        replyString << TEXT("\r\n");\r
-       SetReplyString(boost::to_upper_copy(replyString.str()));\r
+       SetReplyString(to_upper_copy(replyString.str()));\r
        return true;\r
 }\r
 \r
@@ -1468,14 +1479,14 @@ bool TlsCommand::DoExecute()
 \r
 bool VersionCommand::DoExecute()\r
 {\r
-       std::wstring replyString = TEXT("201 VERSION OK\r\n") + env::version() + TEXT("\r\n");\r
+       std::wstring replyString = TEXT("201 VERSION OK\r\n") + u16(env::version()) + TEXT("\r\n");\r
 \r
        if(_parameters.size() > 0)\r
        {\r
                if(_parameters[0] == L"FLASH")\r
-                       replyString = TEXT("201 VERSION OK\r\n") + flash::get_version() + TEXT("\r\n");\r
+                       replyString = TEXT("201 VERSION OK\r\n") + u16(flash::get_version()) + TEXT("\r\n");\r
                else if(_parameters[0] == L"TEMPLATEHOST")\r
-                       replyString = TEXT("201 VERSION OK\r\n") + flash::get_cg_version() + TEXT("\r\n");\r
+                       replyString = TEXT("201 VERSION OK\r\n") + u16(flash::get_cg_version()) + TEXT("\r\n");\r
                else if(_parameters[0] != L"SERVER")\r
                        replyString = TEXT("403 VERSION ERROR\r\n");\r
        }\r
@@ -1500,7 +1511,7 @@ bool SetCommand::DoExecute()
 \r
        if(name == TEXT("MODE"))\r
        {\r
-               auto format_desc = core::video_format_desc::get(value);\r
+               auto format_desc = core::video_format_desc::get(u8(value));\r
                if(format_desc.format != core::video_format::invalid)\r
                {\r
                        GetChannel()->set_video_format_desc(format_desc);\r
index 46dcfb3217615028c159077740ddec5b92866889..470f7f0ae105f5d66a48aeac0ef69a737fe17fc0 100644 (file)
@@ -156,7 +156,7 @@ AMCPCommandPtr AMCPProtocolStrategy::InterpretCommandString(const std::wstring&
        AMCPCommandPtr pCommand;\r
        MessageParserState state = New;\r
 \r
-       CASPAR_LOG(info) << message;\r
+       CASPAR_LOG(info) << u8(message);\r
 \r
        std::size_t tokensInMessage = TokenizeMessage(message, &tokens);\r
 \r
index 306e6b60ad5852d3037557f9a1c4ea31531ef548..bea7f160f29caef18798fcda500a130749df335f 100644 (file)
@@ -143,7 +143,7 @@ void MiscellaneousCommand::Execute()
 \r
        //TODO: Need to be checked for validity\r
        else if(state_ == 1)\r
-               flash::get_default_cg_producer(pCIIStrategy_->GetChannel())->add(layer_, filename_, false, TEXT(""), xmlData_);\r
+               flash::get_default_cg_producer(pCIIStrategy_->GetChannel())->add(layer_, u8(filename_), false, "", u8(xmlData_));\r
 }\r
 \r
 \r
index 537b72fbdc691282d2752e3cbc9ba050324dfa21..76f8fbf60566e12e22a3ca4389765e700d90fcdf 100644 (file)
@@ -43,7 +43,7 @@ using namespace core;
 const std::wstring CIIProtocolStrategy::MessageDelimiter = TEXT("\r\n");\r
 const TCHAR CIIProtocolStrategy::TokenDelimiter = TEXT('\\');\r
 \r
-CIIProtocolStrategy::CIIProtocolStrategy(const std::vector<safe_ptr<core::video_channel>>& channels) : pChannel_(channels.at(0)), executor_(L"CIIProtocolStrategy")\r
+CIIProtocolStrategy::CIIProtocolStrategy(const std::vector<safe_ptr<core::video_channel>>& channels) : pChannel_(channels.at(0)), executor_("CIIProtocolStrategy")\r
 {\r
 }\r
 \r
@@ -168,27 +168,27 @@ CIICommandPtr CIIProtocolStrategy::Create(const std::wstring& name)
 \r
 void CIIProtocolStrategy::WriteTemplateData(const std::wstring& templateName, const std::wstring& titleName, const std::wstring& xmlData) \r
 {\r
-       std::wstring fullTemplateFilename = env::template_folder();\r
+       std::wstring fullTemplateFilename = u16(env::template_folder());\r
        if(currentProfile_.size() > 0)\r
        {\r
                fullTemplateFilename += currentProfile_;\r
                fullTemplateFilename += TEXT("\\");\r
        }\r
        fullTemplateFilename += templateName;\r
-       fullTemplateFilename = flash::find_template(fullTemplateFilename);\r
+       fullTemplateFilename = u16(flash::find_template(u8(fullTemplateFilename)));\r
        if(fullTemplateFilename.empty())\r
        {\r
-               CASPAR_LOG(error) << "Failed to save instance of " << templateName << TEXT(" as ") << titleName << TEXT(", template ") << fullTemplateFilename << " not found";\r
+               CASPAR_LOG(error) << "Failed to save instance of " << u8(templateName) << " as " << u8(titleName) << ", template " << u8(fullTemplateFilename) << " not found";\r
                return;\r
        }\r
        \r
-       auto producer = flash::create_producer(this->GetChannel()->mixer(), boost::assign::list_of(env::template_folder()+TEXT("CG.fth")));\r
+       auto producer = flash::create_producer(this->GetChannel()->mixer(), boost::assign::list_of(env::template_folder()+"CG.fth"));\r
 \r
        std::wstringstream flashParam;\r
        flashParam << TEXT("<invoke name=\"Add\" returntype=\"xml\"><arguments><number>1</number><string>") << currentProfile_ << '/' <<  templateName << TEXT("</string><number>0</number><true/><string> </string><string><![CDATA[ ") << xmlData << TEXT(" ]]></string></arguments></invoke>");\r
-       producer->call(flashParam.str());\r
+       producer->call(u8(flashParam.str()));\r
 \r
-       CASPAR_LOG(info) << "Saved an instance of " << templateName << TEXT(" as ") << titleName ;\r
+       CASPAR_LOG(info) << "Saved an instance of " << u8(templateName) << " as " << u8(titleName);\r
 \r
        PutPreparedTemplate(titleName, safe_ptr<core::frame_producer>(std::move(producer)));\r
        \r
@@ -201,11 +201,11 @@ void CIIProtocolStrategy::DisplayTemplate(const std::wstring& titleName)
                pChannel_->stage()->load(0, GetPreparedTemplate(titleName));\r
                pChannel_->stage()->play(0);\r
 \r
-               CASPAR_LOG(info) << L"Displayed title " << titleName ;\r
+               CASPAR_LOG(info) << "Displayed title " << u8(titleName);\r
        }\r
        catch(caspar_exception&)\r
        {\r
-               CASPAR_LOG(error) << L"Failed to display title " << titleName;\r
+               CASPAR_LOG(error) << "Failed to display title " << u8(titleName);\r
        }\r
 }\r
 \r
@@ -215,7 +215,7 @@ void CIIProtocolStrategy::DisplayMediaFile(const std::wstring& filename)
        transition.type = transition::mix;\r
        transition.duration = 12;\r
 \r
-       auto pFP = create_producer(GetChannel()->mixer(), filename);\r
+       auto pFP = create_producer(GetChannel()->mixer(), u8(filename));\r
        auto pTransition = create_transition_producer(GetChannel()->get_video_format_desc().field_mode, pFP, transition);\r
 \r
        try\r
@@ -225,13 +225,13 @@ void CIIProtocolStrategy::DisplayMediaFile(const std::wstring& filename)
        catch(...)\r
        {\r
                CASPAR_LOG_CURRENT_EXCEPTION();\r
-               CASPAR_LOG(error) << L"Failed to display " << filename ;\r
+               CASPAR_LOG(error) << "Failed to display " << u8(filename);\r
                return;\r
        }\r
 \r
        pChannel_->stage()->play(0);\r
 \r
-       CASPAR_LOG(info) << L"Displayed " << filename;\r
+       CASPAR_LOG(info) << "Displayed " << u8(filename);\r
 }\r
 \r
 safe_ptr<core::frame_producer> CIIProtocolStrategy::GetPreparedTemplate(const std::wstring& titleName)\r
@@ -240,18 +240,18 @@ safe_ptr<core::frame_producer> CIIProtocolStrategy::GetPreparedTemplate(const st
 \r
        TitleList::iterator it = std::find(titles_.begin(), titles_.end(), titleName);\r
        if(it != titles_.end()) {\r
-               CASPAR_LOG(debug) << L"Found title with name " << it->titleName;\r
+               CASPAR_LOG(debug) << "Found title with name " << u8(it->titleName);\r
                result = (*it).pframe_producer;\r
        }\r
        else \r
-               CASPAR_LOG(error) << L"Could not find title with name " << titleName;\r
+               CASPAR_LOG(error) << "Could not find title with name " << u8(titleName);\r
 \r
        return result;\r
 }\r
 \r
 void CIIProtocolStrategy::PutPreparedTemplate(const std::wstring& titleName, safe_ptr<core::frame_producer>& pFP)\r
 {\r
-       CASPAR_LOG(debug) << L"Saved title with name " << titleName;\r
+       CASPAR_LOG(debug) << "Saved title with name " << u8(titleName);\r
 \r
        TitleList::iterator it = std::find(titles_.begin(), titles_.end(), titleName);\r
        if(it != titles_.end()) {\r
index 45117389399e5d35f63703a8d6ba1f1d3a26c24e..b00f4e8c697aa2a01b260830bf3311aece014b9a 100644 (file)
@@ -120,20 +120,20 @@ void CLKProtocolStrategy::Parse(const TCHAR* pData, int charCount, IO::ClientInf
                                pChannel_->stage()->clear(flash::cg_producer::DEFAULT_LAYER);\r
                                bClockLoaded_ = false;\r
                                \r
-                               CASPAR_LOG(info) << L"CLK: Recieved and executed reset-command";\r
+                               CASPAR_LOG(info) << "CLK: Recieved and executed reset-command";\r
                        }\r
                        else if(currentCommand_.command_ != CLKCommand::CLKInvalidCommand)\r
                        {\r
                                if(!bClockLoaded_) \r
                                {\r
-                                       flash::get_default_cg_producer(pChannel_)->add(0, TEXT("hawrysklocka/clock.ft"), true, TEXT(""), currentCommand_.GetData());\r
+                                       flash::get_default_cg_producer(pChannel_)->add(0, "hawrysklocka/clock.ft", true, "", u8(currentCommand_.GetData()));\r
                                        bClockLoaded_ = true;\r
                                }\r
                                else \r
-                                       flash::get_default_cg_producer(pChannel_)->update(0, currentCommand_.GetData());\r
+                                       flash::get_default_cg_producer(pChannel_)->update(0, u8(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
+                               CASPAR_LOG(debug) << "CLK: Clockdata sent: " << u8(currentCommand_.GetData());\r
+                               CASPAR_LOG(debug) << "CLK: Executed valid command: " << u8(currentCommandString_.str());\r
                        }\r
 \r
                        currentState_ = ExpectingNewCommand;\r
index e326f6e96ee951bca95fabc3990f76b4074faf9b..8ec600d5ac01dd96e7bb4de58723a87c9b8150dc 100644 (file)
@@ -159,7 +159,7 @@ void AsyncEventServer::Run(HANDLE stopEvent)
                                        if(networkEvents.iErrorCode[FD_ACCEPT_BIT] == 0)\r
                                                OnAccept(pSocketInfo);\r
                                        else {\r
-                                               CASPAR_LOG(debug) << "OnAccept (ErrorCode: " << networkEvents.iErrorCode[FD_ACCEPT_BIT] << TEXT(")");\r
+                                               CASPAR_LOG(debug) << "OnAccept (ErrorCode: " << networkEvents.iErrorCode[FD_ACCEPT_BIT] << ")";\r
                                                OnError(waitEvent, networkEvents.iErrorCode[FD_ACCEPT_BIT]);\r
                                        }\r
                                }\r
@@ -168,7 +168,7 @@ void AsyncEventServer::Run(HANDLE stopEvent)
                                        if(networkEvents.iErrorCode[FD_CLOSE_BIT] == 0)\r
                                                OnClose(pSocketInfo);\r
                                        else {\r
-                                               CASPAR_LOG(debug) << "OnClose (ErrorCode: " << networkEvents.iErrorCode[FD_CLOSE_BIT] << TEXT(")");\r
+                                               CASPAR_LOG(debug) << "OnClose (ErrorCode: " << networkEvents.iErrorCode[FD_CLOSE_BIT] << ")";\r
                                                OnError(waitEvent, networkEvents.iErrorCode[FD_CLOSE_BIT]);\r
                                        }\r
                                        continue;\r
@@ -178,7 +178,7 @@ void AsyncEventServer::Run(HANDLE stopEvent)
                                        if(networkEvents.iErrorCode[FD_READ_BIT] == 0)\r
                                                OnRead(pSocketInfo);\r
                                        else {\r
-                                               CASPAR_LOG(debug) << "OnRead (ErrorCode: " << networkEvents.iErrorCode[FD_READ_BIT] << TEXT(")");\r
+                                               CASPAR_LOG(debug) << "OnRead (ErrorCode: " << networkEvents.iErrorCode[FD_READ_BIT] << ")";\r
                                                OnError(waitEvent, networkEvents.iErrorCode[FD_READ_BIT]);\r
                                        }\r
                                }\r
@@ -187,7 +187,7 @@ void AsyncEventServer::Run(HANDLE stopEvent)
                                        if(networkEvents.iErrorCode[FD_WRITE_BIT] == 0)\r
                                                OnWrite(pSocketInfo);\r
                                        else {\r
-                                               CASPAR_LOG(debug) << "OnWrite (ErrorCode: " << networkEvents.iErrorCode[FD_WRITE_BIT] << TEXT(")");\r
+                                               CASPAR_LOG(debug) << "OnWrite (ErrorCode: " << networkEvents.iErrorCode[FD_WRITE_BIT] << ")";\r
                                                OnError(waitEvent, networkEvents.iErrorCode[FD_WRITE_BIT]);\r
                                        }\r
                                }\r
@@ -271,7 +271,7 @@ bool AsyncEventServer::OnAccept(SocketInfoPtr& pSI) {
 \r
        socketInfoCollection_.AddSocketInfo(pClientSocket);\r
 \r
-       CASPAR_LOG(info) << "Accepted connection from " << pClientSocket->host_.c_str();\r
+       CASPAR_LOG(info) << "Accepted connection from " << u8(pClientSocket->host_);\r
 \r
        return true;\r
 }\r
@@ -347,7 +347,7 @@ bool AsyncEventServer::OnRead(SocketInfoPtr& pSI) {
        recvResult = recv(pSI->socket_, pSI->recvBuffer_+pSI->recvLeftoverOffset_, maxRecvLength, 0);\r
        while(recvResult != SOCKET_ERROR) {\r
                if(recvResult == 0) {\r
-                       CASPAR_LOG(info) << "Client " << pSI->host_.c_str() << TEXT(" disconnected");\r
+                       CASPAR_LOG(info) << "Client " << u8(pSI->host_) << " disconnected";\r
 \r
                        socketInfoCollection_.RemoveSocketInfo(pSI);\r
                        return true;\r
@@ -357,7 +357,7 @@ bool AsyncEventServer::OnRead(SocketInfoPtr& pSI) {
                if(ConvertMultiByteToWideChar(pProtocolStrategy_->GetCodepage(), pSI->recvBuffer_, recvResult + pSI->recvLeftoverOffset_, pSI->wideRecvBuffer_, pSI->recvLeftoverOffset_))\r
                        pProtocolStrategy_->Parse(&pSI->wideRecvBuffer_[0], pSI->wideRecvBuffer_.size(), pSI);\r
                else                    \r
-                       CASPAR_LOG(error) << "Read from " << pSI->host_.c_str() << TEXT(" failed, could not convert command to UNICODE");\r
+                       CASPAR_LOG(error) << "Read from " << u8(pSI->host_) << " failed, could not convert command to UNICODE";\r
                        \r
                \r
 \r
@@ -408,7 +408,7 @@ void AsyncEventServer::DoSend(SocketInfo& socketInfo) {
                        //Read the next string in the queue and convert to UTF-8\r
                        if(!ConvertWideCharToMultiByte(pProtocolStrategy_->GetCodepage(), socketInfo.sendQueue_.front(), socketInfo.currentlySending_))\r
                        {\r
-                               CASPAR_LOG(error) << "Send to " << socketInfo.host_.c_str() << TEXT(" failed, could not convert response to UTF-8");\r
+                               CASPAR_LOG(error) << "Send to " << u8(socketInfo.host_) << " failed, could not convert response to UTF-8";\r
                        }\r
                        socketInfo.currentlySendingOffset_ = 0;\r
                }\r
@@ -419,7 +419,7 @@ void AsyncEventServer::DoSend(SocketInfo& socketInfo) {
                        if(sentBytes == SOCKET_ERROR) {\r
                                int errorCode = WSAGetLastError();\r
                                if(errorCode == WSAEWOULDBLOCK) {\r
-                                       CASPAR_LOG(debug) << "Send to " << socketInfo.host_.c_str() << TEXT(" would block, sending later");\r
+                                       CASPAR_LOG(debug) << "Send to " << u8(socketInfo.host_) << " would block, sending later";\r
                                        break;\r
                                }\r
                                else {\r
@@ -435,9 +435,9 @@ void AsyncEventServer::DoSend(SocketInfo& socketInfo) {
                        else {\r
                                if(sentBytes == bytesToSend) {\r
                                        if(sentBytes < 200)\r
-                                               CASPAR_LOG(info) << "Sent " << socketInfo.sendQueue_.front().c_str() << TEXT(" to ") << socketInfo.host_.c_str();\r
+                                               CASPAR_LOG(info) << "Sent " << u8(socketInfo.sendQueue_.front()) << " to " << u8(socketInfo.host_);\r
                                        else\r
-                                               CASPAR_LOG(info) << "Sent more than 200 bytes to " << socketInfo.host_.c_str();\r
+                                               CASPAR_LOG(info) << "Sent more than 200 bytes to " << u8(socketInfo.host_);\r
 \r
                                        socketInfo.currentlySending_.resize(0);\r
                                        socketInfo.currentlySendingOffset_ = 0;\r
@@ -445,7 +445,7 @@ void AsyncEventServer::DoSend(SocketInfo& socketInfo) {
                                }\r
                                else {\r
                                        socketInfo.currentlySendingOffset_ += sentBytes;\r
-                                       CASPAR_LOG(info) << "Sent partial message to " << socketInfo.host_.c_str();\r
+                                       CASPAR_LOG(info) << "Sent partial message to " << u8(socketInfo.host_);\r
                                }\r
                        }\r
                }\r
@@ -459,7 +459,7 @@ void AsyncEventServer::DoSend(SocketInfo& socketInfo) {
 // PARAMS: ...\r
 // COMMENT: Called when a client disconnects / is disconnected\r
 void AsyncEventServer::OnClose(SocketInfoPtr& pSI) {\r
-       CASPAR_LOG(info) << "Client " << pSI->host_.c_str() << TEXT(" was disconnected");\r
+       CASPAR_LOG(info) << "Client " << u8(pSI->host_) << " was disconnected";\r
 \r
        socketInfoCollection_.RemoveSocketInfo(pSI);\r
 }\r
@@ -472,7 +472,7 @@ void AsyncEventServer::OnError(HANDLE waitEvent, int errorCode) {
        if(errorCode == WSAENETDOWN || errorCode == WSAECONNABORTED || errorCode == WSAECONNRESET || errorCode == WSAESHUTDOWN || errorCode == WSAETIMEDOUT || errorCode == WSAENOTCONN || errorCode == WSAENETRESET) {\r
                SocketInfoPtr pSocketInfo;\r
                if(socketInfoCollection_.FindSocketInfo(waitEvent, pSocketInfo)) {\r
-                       CASPAR_LOG(info) << "Client " << pSocketInfo->host_.c_str() << TEXT(" was disconnected, Errorcode ") << errorCode;\r
+                       CASPAR_LOG(info) << "Client " << u8(pSocketInfo->host_) << " was disconnected, Errorcode " << errorCode;\r
                }\r
 \r
                socketInfoCollection_.RemoveSocketInfo(waitEvent);\r
@@ -495,7 +495,7 @@ void AsyncEventServer::LogSocketError(const TCHAR* pStr, int socketError) {
        if(socketError == 0)\r
                socketError = WSAGetLastError();\r
 \r
-       CASPAR_LOG(error) << "Failed to " << pStr << TEXT(" Errorcode: ") << socketError;\r
+       CASPAR_LOG(error) << "Failed to " << u8(pStr) << " Errorcode: " << socketError;\r
 }\r
 \r
 \r
index 70d705f8ad2c1c3103f9a115315326f276abd886..b129265bf5e8c335bf8ce94d65daafa219d0a969 100644 (file)
@@ -57,6 +57,7 @@
 #include <common/gl/gl_check.h>\r
 #include <common/os/windows/current_version.h>\r
 #include <common/os/windows/system_info.h>\r
+#include <common/utility/string.h>\r
 \r
 #include <tbb/task_scheduler_init.h>\r
 #include <tbb/task_scheduler_observer.h>\r
@@ -101,7 +102,7 @@ void setup_console_window()
        change_icon(::LoadIcon(GetModuleHandle(0), MAKEINTRESOURCE(101)));\r
 \r
        // Set console title.\r
-       std::wstringstream str;\r
+       std::stringstream str;\r
        str << "CasparCG Server " << caspar::env::version();\r
 #ifdef COMPILE_RELEASE\r
        str << " Release";\r
@@ -112,44 +113,44 @@ void setup_console_window()
 #elif  COMPILE_DEBUG\r
        str << " Debug";\r
 #endif\r
-       SetConsoleTitle(str.str().c_str());\r
+       SetConsoleTitle(caspar::u16(str.str()).c_str());\r
 }\r
 \r
 void print_info()\r
 {\r
-       CASPAR_LOG(info) << L"Copyright (c) 2010 Sveriges Television AB, www.casparcg.com, <info@casparcg.com>";\r
-       CASPAR_LOG(info) << L"Starting CasparCG Video and Graphics Playout Server " << caspar::env::version();\r
-       CASPAR_LOG(info) << L"on " << caspar::get_win_product_name() << L" " << caspar::get_win_sp_version();\r
+       CASPAR_LOG(info) << "Copyright (c) 2010 Sveriges Television AB, www.casparcg.com, <info@casparcg.com>";\r
+       CASPAR_LOG(info) << "Starting CasparCG Video and Graphics Playout Server " << caspar::env::version();\r
+       CASPAR_LOG(info) << "on " << caspar::get_win_product_name() << " " << caspar::get_win_sp_version();\r
        CASPAR_LOG(info) << caspar::get_cpu_info();\r
        CASPAR_LOG(info) << caspar::get_system_product_name();\r
        \r
-       CASPAR_LOG(info) << L"Decklink " << caspar::decklink::get_version();\r
+       CASPAR_LOG(info) << "Decklink " << caspar::decklink::get_version();\r
        BOOST_FOREACH(auto device, caspar::decklink::get_device_list())\r
-               CASPAR_LOG(info) << L" - " << device;   \r
+               CASPAR_LOG(info) << " - " << device;    \r
                \r
-       CASPAR_LOG(info) << L"Bluefish " << caspar::bluefish::get_version();\r
+       CASPAR_LOG(info) << "Bluefish " << caspar::bluefish::get_version();\r
        BOOST_FOREACH(auto device, caspar::bluefish::get_device_list())\r
-               CASPAR_LOG(info) << L" - " << device;   \r
+               CASPAR_LOG(info) << " - " << device;    \r
        \r
-       CASPAR_LOG(info) << L"Flash "                   << caspar::flash::get_version();\r
-       CASPAR_LOG(info) << L"FreeImage "               << caspar::image::get_version();\r
-       CASPAR_LOG(info) << L"FFMPEG-avcodec "  << caspar::ffmpeg::get_avcodec_version();\r
-       CASPAR_LOG(info) << L"FFMPEG-avformat " << caspar::ffmpeg::get_avformat_version();\r
-       CASPAR_LOG(info) << L"FFMPEG-avfilter " << caspar::ffmpeg::get_avfilter_version();\r
-       CASPAR_LOG(info) << L"FFMPEG-avutil "   << caspar::ffmpeg::get_avutil_version();\r
-       CASPAR_LOG(info) << L"FFMPEG-swscale "  << caspar::ffmpeg::get_swscale_version();\r
+       CASPAR_LOG(info) << "Flash "                    << caspar::flash::get_version();\r
+       CASPAR_LOG(info) << "FreeImage "                << caspar::image::get_version();\r
+       CASPAR_LOG(info) << "FFMPEG-avcodec "  << caspar::ffmpeg::get_avcodec_version();\r
+       CASPAR_LOG(info) << "FFMPEG-avformat " << caspar::ffmpeg::get_avformat_version();\r
+       CASPAR_LOG(info) << "FFMPEG-avfilter " << caspar::ffmpeg::get_avfilter_version();\r
+       CASPAR_LOG(info) << "FFMPEG-avutil "    << caspar::ffmpeg::get_avutil_version();\r
+       CASPAR_LOG(info) << "FFMPEG-swscale "  << caspar::ffmpeg::get_swscale_version();\r
 }\r
 \r
 LONG WINAPI UserUnhandledExceptionFilter(EXCEPTION_POINTERS* info)\r
 {\r
        try\r
        {\r
-               CASPAR_LOG(fatal) << L"#######################\n UNHANDLED EXCEPTION: \n" \r
-                       << L"Adress:" << info->ExceptionRecord->ExceptionAddress << L"\n"\r
-                       << L"Code:" << info->ExceptionRecord->ExceptionCode << L"\n"\r
-                       << L"Flag:" << info->ExceptionRecord->ExceptionFlags << L"\n"\r
-                       << L"Info:" << info->ExceptionRecord->ExceptionInformation << L"\n"\r
-                       << L"Continuing execution. \n#######################";\r
+               CASPAR_LOG(fatal) << "#######################\n UNHANDLED EXCEPTION: \n" \r
+                       << "Adress:" << info->ExceptionRecord->ExceptionAddress << "\n"\r
+                       << "Code:" << info->ExceptionRecord->ExceptionCode << "\n"\r
+                       << "Flag:" << info->ExceptionRecord->ExceptionFlags << "\n"\r
+                       << "Info:" << info->ExceptionRecord->ExceptionInformation << "\n"\r
+                       << "Continuing execution. \n#######################";\r
        }\r
        catch(...){}\r
 \r
@@ -162,7 +163,7 @@ int main(int argc, wchar_t* argv[])
        \r
        SetUnhandledExceptionFilter(UserUnhandledExceptionFilter);\r
 \r
-       std::wcout << L"Type \"q\" to close application." << std::endl;\r
+       std::wcout << "Type \"q\" to close application." << std::endl;\r
        \r
        // Set debug mode.\r
        #ifdef _DEBUG\r
@@ -178,7 +179,7 @@ int main(int argc, wchar_t* argv[])
        // Install structured exception handler.\r
        caspar::win32_exception::install_handler();\r
 \r
-       caspar::log::set_log_level(L"debug");\r
+       caspar::log::set_log_level("debug");\r
                        \r
        // Increase time precision. This will increase accuracy of function like Sleep(1) from 10 ms to 1 ms.\r
        struct inc_prec\r
@@ -203,16 +204,16 @@ int main(int argc, wchar_t* argv[])
        try \r
        {\r
                // Configure environment properties from configuration.\r
-               caspar::env::configure(L"casparcg.config");\r
+               caspar::env::configure("casparcg.config");\r
                                \r
        #ifdef _DEBUG\r
-               if(caspar::env::properties().get(L"configuration.debugging.remote", false))\r
+               if(caspar::env::properties().get("configuration.debugging.remote", false))\r
                        MessageBox(nullptr, TEXT("Now is the time to connect for remote debugging..."), TEXT("Debug"), MB_OK | MB_TOPMOST);\r
        #endif   \r
 \r
                // Start logging to file.\r
                caspar::log::add_file_sink(caspar::env::log_folder());                  \r
-               std::wcout << L"Logging [info] or higher severity to " << caspar::env::log_folder() << std::endl << std::endl;\r
+               std::cout << "Logging [info] or higher severity to " << caspar::env::log_folder() << std::endl << std::endl;\r
                \r
                // Setup console window.\r
                setup_console_window();\r
@@ -220,10 +221,10 @@ int main(int argc, wchar_t* argv[])
                // Print environment information.\r
                print_info();\r
                        \r
-               std::wstringstream str;\r
-               boost::property_tree::xml_writer_settings<wchar_t> w(' ', 3);\r
+               std::stringstream str;\r
+               boost::property_tree::xml_writer_settings<char> w(' ', 3);\r
                boost::property_tree::write_xml(str, caspar::env::properties(), w);\r
-               CASPAR_LOG(info) << L"casparcg.config:\n-----------------------------------------\n" << str.str().c_str() << L"-----------------------------------------";\r
+               CASPAR_LOG(info) << "casparcg.config:\n-----------------------------------------\n" << str.str().c_str() << "-----------------------------------------";\r
                                \r
                {\r
                        // Create server object which initializes channels, protocols and controllers.\r
@@ -240,14 +241,14 @@ int main(int argc, wchar_t* argv[])
                        {\r
                                std::getline(std::wcin, wcmd); // TODO: It's blocking...\r
                                \r
-                               boost::to_upper(wcmd);\r
+                               caspar::to_upper(wcmd);\r
 \r
                                if(wcmd == L"EXIT" || wcmd == L"Q" || wcmd == L"QUIT" || wcmd == L"BYE")\r
                                        break;\r
                                \r
                                // This is just dummy code for testing.\r
                                if(wcmd.substr(0, 1) == L"1")\r
-                                       wcmd = L"LOADBG 1-1 " + wcmd.substr(1, wcmd.length()-1) + L" SLIDE 100 LOOP \r\nPLAY 1-1";\r
+                                       wcmd = L"LOADBG 1-1 L" + wcmd.substr(1, wcmd.length()-1) + L" SLIDE 100 LOOP \r\nPLAY 1-1";\r
                                else if(wcmd.substr(0, 1) == L"2")\r
                                        wcmd = L"MIXER 1-0 VIDEO IS_KEY 1";\r
                                else if(wcmd.substr(0, 1) == L"3")\r
@@ -257,12 +258,12 @@ int main(int argc, wchar_t* argv[])
                                else if(wcmd.substr(0, 1) == L"5")\r
                                {\r
                                        auto file = wcmd.substr(2, wcmd.length()-1);\r
-                                       wcmd = L"PLAY 1-1 " + file + L" LOOP\r\n" \r
-                                                       L"PLAY 1-2 " + file + L" LOOP\r\n" \r
-                                                       L"PLAY 1-3 " + file + L" LOOP\r\n"\r
-                                                       L"PLAY 2-1 " + file + L" LOOP\r\n" \r
-                                                       L"PLAY 2-2 " + file + L" LOOP\r\n" \r
-                                                       L"PLAY 2-3 " + file + L" LOOP\r\n";\r
+                                       wcmd = L"PLAY 1-1 L" + file + L" LOOP\r\n" \r
+                                                  L"PLAY 1-2 L" + file + L" LOOP\r\n" \r
+                                                  L"PLAY 1-3 L" + file + L" LOOP\r\n"\r
+                                                  L"PLAY 2-1 L" + file + L" LOOP\r\n" \r
+                                                  L"PLAY 2-2 L" + file + L" LOOP\r\n" \r
+                                                  L"PLAY 2-3 L" + file + L" LOOP\r\n";\r
                                }\r
                                else if(wcmd.substr(0, 1) == L"X")\r
                                {\r
@@ -287,10 +288,10 @@ int main(int argc, wchar_t* argv[])
                                                n++;\r
                                        }\r
 \r
-                                       wcmd = L"MIXER 1 GRID " + boost::lexical_cast<std::wstring>(n);\r
+                                       wcmd = L"MIXER 1 GRID L" + boost::lexical_cast<std::wstring>(n);\r
 \r
                                        for(int i = 1; i <= num; ++i)\r
-                                               wcmd += L"\r\nPLAY 1-" + boost::lexical_cast<std::wstring>(i) + L" " + file + L" LOOP";// + L" SLIDE 100 LOOP";\r
+                                               wcmd += L"\r\nPLAY 1-" + boost::lexical_cast<std::wstring>(i) + L" L" + file + L" LOOP";// + L" SLIDE 100 LOOP";\r
                                }\r
 \r
                                wcmd += L"\r\n";\r
@@ -304,18 +305,18 @@ int main(int argc, wchar_t* argv[])
        catch(boost::property_tree::file_parser_error&)\r
        {\r
                CASPAR_LOG_CURRENT_EXCEPTION();\r
-               CASPAR_LOG(fatal) << L"Unhandled configuration error in main thread. Please check the configuration file (casparcg.config) for errors.";\r
+               CASPAR_LOG(fatal) << "Unhandled configuration error in main thread. Please check the configuration file (casparcg.config) for errors.";\r
                system("pause");        \r
        }\r
        catch(caspar::gl::ogl_exception&)\r
        {\r
                CASPAR_LOG_CURRENT_EXCEPTION();\r
-               CASPAR_LOG(fatal) << L"Unhandled OpenGL Error in main thread. Please try to update graphics drivers for OpenGL 3.0+ Support.";\r
+               CASPAR_LOG(fatal) << "Unhandled OpenGL Error in main thread. Please try to update graphics drivers for OpenGL 3.0+ Support.";\r
        }\r
        catch(...)\r
        {\r
                CASPAR_LOG_CURRENT_EXCEPTION();\r
-               CASPAR_LOG(fatal) << L"Unhandled exception in main thread. Please report this error on the CasparCG forums (www.casparcg.com/forum).";\r
+               CASPAR_LOG(fatal) << "Unhandled exception in main thread. Please report this error on the CasparCG forums (www.casparcg.com/forum).";\r
        }       \r
        \r
        return 0;\r
index f1419cc91b1fbe5a8011cd65381918fd987ba6dc..a4852b7a783023df86d4dc972433219179e076f7 100644 (file)
@@ -72,31 +72,31 @@ struct server::implementation : boost::noncopyable
                : ogl_(ogl_device::create())\r
        {                       \r
                ffmpeg::init();\r
-               CASPAR_LOG(info) << L"Initialized ffmpeg module.";\r
+               CASPAR_LOG(info) << "Initialized ffmpeg module.";\r
                                                          \r
                bluefish::init();         \r
-               CASPAR_LOG(info) << L"Initialized bluefish module.";\r
+               CASPAR_LOG(info) << "Initialized bluefish module.";\r
                                                          \r
                decklink::init();         \r
-               CASPAR_LOG(info) << L"Initialized decklink module.";\r
+               CASPAR_LOG(info) << "Initialized decklink module.";\r
                                                                                                                  \r
                oal::init();              \r
-               CASPAR_LOG(info) << L"Initialized oal module.";\r
+               CASPAR_LOG(info) << "Initialized oal module.";\r
                                                          \r
                ogl::init();              \r
-               CASPAR_LOG(info) << L"Initialized ogl module.";\r
+               CASPAR_LOG(info) << "Initialized ogl module.";\r
 \r
                image::init();            \r
-               CASPAR_LOG(info) << L"Initialized image module.";\r
+               CASPAR_LOG(info) << "Initialized image module.";\r
 \r
                flash::init();            \r
-               CASPAR_LOG(info) << L"Initialized flash module.";\r
+               CASPAR_LOG(info) << "Initialized flash module.";\r
 \r
                setup_channels(env::properties());\r
-               CASPAR_LOG(info) << L"Initialized channels.";\r
+               CASPAR_LOG(info) << "Initialized channels.";\r
 \r
                setup_controllers(env::properties());\r
-               CASPAR_LOG(info) << L"Initialized controllers.";\r
+               CASPAR_LOG(info) << "Initialized controllers.";\r
        }\r
 \r
        ~implementation()\r
@@ -107,34 +107,34 @@ struct server::implementation : boost::noncopyable
                channels_.clear();\r
        }\r
                                \r
-       void setup_channels(const boost::property_tree::wptree& pt)\r
+       void setup_channels(const boost::property_tree::ptree& pt)\r
        {   \r
-               using boost::property_tree::wptree;\r
-               BOOST_FOREACH(auto& xml_channel, pt.get_child(L"configuration.channels"))\r
+               using boost::property_tree::ptree;\r
+               BOOST_FOREACH(auto& xml_channel, pt.get_child("configuration.channels"))\r
                {               \r
-                       auto format_desc = video_format_desc::get(widen(xml_channel.second.get(L"video-mode", L"PAL")));                \r
+                       auto format_desc = video_format_desc::get(xml_channel.second.get("video-mode", "PAL"));         \r
                        if(format_desc.format == video_format::invalid)\r
                                BOOST_THROW_EXCEPTION(caspar_exception() << msg_info("Invalid video-mode."));\r
                        \r
                        channels_.push_back(make_safe<video_channel>(channels_.size()+1, format_desc, ogl_));\r
                        \r
-                       BOOST_FOREACH(auto& xml_consumer, xml_channel.second.get_child(L"consumers"))\r
+                       BOOST_FOREACH(auto& xml_consumer, xml_channel.second.get_child("consumers"))\r
                        {\r
                                try\r
                                {\r
                                        auto name = xml_consumer.first;\r
-                                       if(name == L"screen")\r
+                                       if(name == "screen")\r
                                                channels_.back()->output()->add(ogl::create_consumer(xml_consumer.second));                                     \r
-                                       else if(name == L"bluefish")                                    \r
+                                       else if(name == "bluefish")                                     \r
                                                channels_.back()->output()->add(bluefish::create_consumer(xml_consumer.second));                                        \r
-                                       else if(name == L"decklink")                                    \r
+                                       else if(name == "decklink")                                     \r
                                                channels_.back()->output()->add(decklink::create_consumer(xml_consumer.second));                                \r
-                                       else if(name == L"file")                                        \r
+                                       else if(name == "file")                                 \r
                                                channels_.back()->output()->add(ffmpeg::create_consumer(xml_consumer.second));                                          \r
-                                       else if(name == L"system-audio")\r
+                                       else if(name == "system-audio")\r
                                                channels_.back()->output()->add(oal::create_consumer());                \r
-                                       else if(name != L"<xmlcomment>")\r
-                                               CASPAR_LOG(warning) << "Invalid consumer: " << widen(name);     \r
+                                       else if(name != "<xmlcomment>")\r
+                                               CASPAR_LOG(warning) << "Invalid consumer: " << name;    \r
                                }\r
                                catch(...)\r
                                {\r
@@ -144,25 +144,25 @@ struct server::implementation : boost::noncopyable
                }\r
        }\r
                \r
-       void setup_controllers(const boost::property_tree::wptree& pt)\r
+       void setup_controllers(const boost::property_tree::ptree& pt)\r
        {               \r
-               using boost::property_tree::wptree;\r
-               BOOST_FOREACH(auto& xml_controller, pt.get_child(L"configuration.controllers"))\r
+               using boost::property_tree::ptree;\r
+               BOOST_FOREACH(auto& xml_controller, pt.get_child("configuration.controllers"))\r
                {\r
                        try\r
                        {\r
                                auto name = xml_controller.first;\r
-                               auto protocol = xml_controller.second.get<std::wstring>(L"protocol");   \r
+                               auto protocol = xml_controller.second.get<std::string>("protocol");     \r
 \r
-                               if(name == L"tcp")\r
+                               if(name == "tcp")\r
                                {                                       \r
-                                       unsigned int port = xml_controller.second.get(L"port", 5250);\r
+                                       unsigned int port = xml_controller.second.get("port", 5250);\r
                                        auto asyncbootstrapper = make_safe<IO::AsyncEventServer>(create_protocol(protocol), port);\r
                                        asyncbootstrapper->Start();\r
                                        async_servers_.push_back(asyncbootstrapper);\r
                                }\r
                                else\r
-                                       CASPAR_LOG(warning) << "Invalid controller: " << widen(name);   \r
+                                       CASPAR_LOG(warning) << "Invalid controller: " << u8(name);      \r
                        }\r
                        catch(...)\r
                        {\r
@@ -171,16 +171,16 @@ struct server::implementation : boost::noncopyable
                }\r
        }\r
 \r
-       safe_ptr<IO::IProtocolStrategy> create_protocol(const std::wstring& name) const\r
+       safe_ptr<IO::IProtocolStrategy> create_protocol(const std::string& name) const\r
        {\r
-               if(boost::iequals(name, L"AMCP"))\r
+               if(iequals(name, "AMCP"))\r
                        return make_safe<amcp::AMCPProtocolStrategy>(channels_);\r
-               else if(boost::iequals(name, L"CII"))\r
+               else if(iequals(name, "CII"))\r
                        return make_safe<cii::CIIProtocolStrategy>(channels_);\r
-               else if(boost::iequals(name, L"CLOCK"))\r
+               else if(iequals(name, "CLOCK"))\r
                        return make_safe<CLK::CLKProtocolStrategy>(channels_);\r
                \r
-               BOOST_THROW_EXCEPTION(caspar_exception() << arg_name_info("name") << arg_value_info(narrow(name)) << msg_info("Invalid protocol"));\r
+               BOOST_THROW_EXCEPTION(caspar_exception() << arg_name_info("name") << arg_value_info((name)) << msg_info("Invalid protocol"));\r
        }\r
 };\r
 \r