]> git.sesse.net Git - casparcg/commitdiff
* Upgraded to Visual Studio 2013
authorHelge Norberg <helge.norberg@svt.se>
Thu, 12 Feb 2015 15:52:55 +0000 (16:52 +0100)
committerHelge Norberg <helge.norberg@svt.se>
Thu, 12 Feb 2015 15:52:55 +0000 (16:52 +0100)
* Notable changes needed because of boost upgrade:
  - custom async implementation removed in favor of std::async. (boost::async still does not have support for deferred launch policy).
  - std::future instead of boost::future throughout the code because of above change.
  - std::future requires default constructibility, so for example caspar::array has been affected. spl::shared_ptr has been changed to std::shared_ptr in cases where required.
  - boost.log changes adopted from 2.0.7.
* Fixed bugs where some OpenGL resources was not destructed on ogl thread.
* Fixed audio cadence issues in ffmpeg producer.

89 files changed:
accelerator/accelerator.vcxproj
accelerator/cpu/image/image_mixer.cpp
accelerator/cpu/image/image_mixer.h
accelerator/ogl/image/image_kernel.cpp
accelerator/ogl/image/image_mixer.cpp
accelerator/ogl/image/image_mixer.h
accelerator/ogl/image/image_shader.cpp
accelerator/ogl/image/image_shader.h
accelerator/ogl/util/device.cpp
accelerator/ogl/util/device.h
casparcg.sln
common/array.h
common/blocking_bounded_queue_adapter.h
common/blocking_priority_queue.h
common/common.vcxproj
common/diagnostics/graph.cpp
common/diagnostics/graph.h
common/env.cpp
common/except.h
common/executor.h
common/filesystem_monitor.h
common/future.h
common/future_fwd.h
common/log.cpp
common/log.h
common/polling_filesystem_monitor.cpp
common/semaphore.h
core/consumer/frame_consumer.cpp
core/consumer/frame_consumer.h
core/consumer/output.cpp
core/consumer/output.h
core/consumer/port.cpp
core/consumer/port.h
core/core.vcxproj
core/frame/frame.cpp
core/frame/frame.h
core/mixer/image/image_mixer.h
core/mixer/mixer.cpp
core/mixer/mixer.h
core/producer/frame_producer.cpp
core/producer/frame_producer.h
core/producer/scene/scene_producer.cpp
core/producer/scene/scene_producer.h
core/producer/scene/xml_scene_producer.cpp
core/producer/separated/separated_producer.cpp
core/producer/stage.cpp
core/producer/stage.h
core/producer/text/text_producer.cpp
core/producer/text/text_producer.h
core/producer/transition/transition_producer.cpp
core/thumbnail_generator.cpp
core/video_format.cpp
modules/bluefish/bluefish.vcxproj
modules/bluefish/consumer/bluefish_consumer.cpp
modules/decklink/consumer/decklink_consumer.cpp
modules/decklink/decklink.vcxproj
modules/ffmpeg/consumer/ffmpeg_consumer.cpp
modules/ffmpeg/ffmpeg.vcxproj
modules/ffmpeg/producer/ffmpeg_producer.cpp
modules/ffmpeg/producer/muxer/frame_muxer.cpp
modules/flash/flash.vcxproj
modules/flash/producer/cg_proxy.cpp
modules/flash/producer/flash_producer.cpp
modules/image/consumer/image_consumer.cpp
modules/image/image.vcxproj
modules/image/producer/image_producer.cpp
modules/image/util/image_algorithms.cpp
modules/oal/consumer/oal_consumer.cpp
modules/oal/oal.vcxproj
modules/psd/psd.vcxproj
modules/psd/psd_scene_producer.cpp
modules/reroute/reroute.vcxproj
modules/screen/consumer/screen_consumer.cpp
modules/screen/screen.vcxproj
protocol/amcp/AMCPCommandsImpl.cpp
protocol/amcp/AMCPCommandsImpl.h
protocol/amcp/AMCPProtocolStrategy.cpp
protocol/amcp/AMCPProtocolStrategy.h
protocol/clk/clk_commands.cpp
protocol/protocol.vcxproj
protocol/util/AsyncEventServer.cpp
shell/main.cpp
shell/server.cpp
shell/server.h
shell/shell.vcxproj
test/psd-test/psd-test.cpp
test/psd-test/psd-test.vcxproj
unit-test/base64_test.cpp
unit-test/unit-test.vcxproj

index 91414aa516dc3466b10196cdfa117f460e533c53..f0122661672f926032cd0f787deca4194811a7fe 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <ItemGroup Label="ProjectConfigurations">\r
     <ProjectConfiguration Include="Debug|x64">\r
       <Configuration>Debug</Configuration>\r
     <ConfigurationType>StaticLibrary</ConfigurationType>\r
     <CharacterSet>Unicode</CharacterSet>\r
     <UseDebugLibraries>true</UseDebugLibraries>\r
+    <PlatformToolset>v120</PlatformToolset>\r
   </PropertyGroup>\r
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">\r
     <ConfigurationType>StaticLibrary</ConfigurationType>\r
     <UseDebugLibraries>false</UseDebugLibraries>\r
     <CharacterSet>Unicode</CharacterSet>\r
     <WholeProgramOptimization>true</WholeProgramOptimization>\r
+    <PlatformToolset>v120</PlatformToolset>\r
   </PropertyGroup>\r
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
   <ImportGroup Label="ExtensionSettings">\r
@@ -70,7 +72,7 @@
       <BrowseInformation>true</BrowseInformation>\r
       <WarningLevel>Level4</WarningLevel>\r
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
-      <PreprocessorDefinitions>TBB_USE_CAPTURED_EXCEPTION=0;TBB_USE_ASSERT=1;TBB_USE_DEBUG;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions>SFML_STATIC;BOOST_THREAD_VERSION=4;TBB_USE_CAPTURED_EXCEPTION=0;TBB_USE_ASSERT=1;TBB_USE_DEBUG;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
       <TreatWarningAsError>true</TreatWarningAsError>\r
       <MultiProcessorCompilation>true</MultiProcessorCompilation>\r
       <FloatingPointModel>Fast</FloatingPointModel>\r
       <AdditionalIncludeDirectories>../;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
       <ExceptionHandling>Async</ExceptionHandling>\r
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\r
-      <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>\r
+      <EnableEnhancedInstructionSet>NotSet</EnableEnhancedInstructionSet>\r
       <RuntimeTypeInfo>true</RuntimeTypeInfo>\r
       <PrecompiledHeader>Use</PrecompiledHeader>\r
       <WarningLevel>Level4</WarningLevel>\r
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
       <MultiProcessorCompilation>true</MultiProcessorCompilation>\r
-      <PreprocessorDefinitions>TBB_USE_CAPTURED_EXCEPTION=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions>SFML_STATIC;BOOST_THREAD_VERSION=4;TBB_USE_CAPTURED_EXCEPTION=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
       <WholeProgramOptimization>false</WholeProgramOptimization>\r
       <TreatWarningAsError>true</TreatWarningAsError>\r
       <OmitFramePointers>true</OmitFramePointers>\r
index ec31d4e29f1ab8e477dc7252b5bcd474f98970d3..298ac77af14856305cc480ac6fdbeed1f5b177e0 100644 (file)
@@ -155,7 +155,7 @@ class image_renderer
        tbb::concurrent_unordered_map<int64_t, tbb::concurrent_bounded_queue<std::shared_ptr<SwsContext>>>      sws_devices_;
        tbb::concurrent_bounded_queue<spl::shared_ptr<buffer>>                                                                                          temp_buffers_;
 public:        
-       boost::unique_future<array<const std::uint8_t>> operator()(std::vector<item> items, const core::video_format_desc& format_desc)
+       std::future<array<const std::uint8_t>> operator()(std::vector<item> items, const core::video_format_desc& format_desc)
        {       
                convert(items, format_desc.width, format_desc.height);          
                                
@@ -185,10 +185,7 @@ public:
 
                temp_buffers_.clear();
                
-               return async(launch::deferred, [=]
-               {
-                       return array<const std::uint8_t>(result->data(), format_desc.size, true, result);
-               });     
+               return make_ready_future(array<const std::uint8_t>(result->data(), format_desc.size, true, result));
        }
 
 private:
@@ -357,7 +354,7 @@ public:
        {               
        }
        
-       boost::unique_future<array<const std::uint8_t>> render(const core::video_format_desc& format_desc)
+       std::future<array<const std::uint8_t>> render(const core::video_format_desc& format_desc)
        {
                return renderer_(std::move(items_), format_desc);
        }
@@ -379,7 +376,7 @@ image_mixer::~image_mixer(){}
 void image_mixer::push(const core::frame_transform& transform){impl_->push(transform);}
 void image_mixer::visit(const core::const_frame& frame){impl_->visit(frame);}
 void image_mixer::pop(){impl_->pop();}
-boost::unique_future<array<const std::uint8_t>> image_mixer::operator()(const core::video_format_desc& format_desc){return impl_->render(format_desc);}
+std::future<array<const std::uint8_t>> image_mixer::operator()(const core::video_format_desc& format_desc){return impl_->render(format_desc);}
 void image_mixer::begin_layer(core::blend_mode blend_mode){impl_->begin_layer(blend_mode);}
 void image_mixer::end_layer(){impl_->end_layer();}
 core::mutable_frame image_mixer::create_frame(const void* tag, const core::pixel_format_desc& desc) {return impl_->create_frame(tag, desc);}
index b61f88a29f60c5db757166af494eed4586378d26..bb3e649700d3cba88bef78985b7f9288b13dcbe3 100644 (file)
@@ -42,7 +42,7 @@ public:
        virtual void visit(const core::const_frame& frame);
        virtual void pop();
                
-       boost::unique_future<array<const std::uint8_t>> operator()(const core::video_format_desc& format_desc) override;
+       std::future<array<const std::uint8_t>> operator()(const core::video_format_desc& format_desc) override;
                
        core::mutable_frame create_frame(const void* tag, const core::pixel_format_desc& desc) override;
 
index 46d16be8e6029f729d58861a1331c022b55dcb1e..6cd866de24c5dd8b202419f1a2bb3ef7f402352b 100644 (file)
@@ -62,7 +62,7 @@ struct image_kernel::impl
                                                        
        impl(const spl::shared_ptr<device>& ogl, bool blend_modes_wanted)
                : ogl_(ogl)
-               , shader_(ogl_->invoke([&]{return get_image_shader(blend_modes_, blend_modes_wanted);}))
+               , shader_(ogl_->invoke([&]{return get_image_shader(ogl, blend_modes_, blend_modes_wanted); }))
        {
        }
 
@@ -105,8 +105,8 @@ struct image_kernel::impl
                shader_->set("local_key",               texture_id::local_key);
                shader_->set("layer_key",               texture_id::layer_key);
                shader_->set("is_hd",                   params.pix_desc.planes.at(0).height > 700 ? 1 : 0);
-               shader_->set("has_local_key",   params.local_key);
-               shader_->set("has_layer_key",   params.layer_key);
+               shader_->set("has_local_key",   static_cast<bool>(params.local_key));
+               shader_->set("has_layer_key",   static_cast<bool>(params.layer_key));
                shader_->set("pixel_format",    params.pix_desc.format.value());        
                shader_->set("opacity",                 params.transform.is_key ? 1.0 : params.transform.opacity);      
                                
index 66e7d899ed5152cd2812b775e526226b95316f7a..48505198fff012c3fbd2df1c22c86913a7251ddd 100644 (file)
@@ -53,7 +53,7 @@ using namespace boost::assign;
 
 namespace caspar { namespace accelerator { namespace ogl {
                
-typedef boost::shared_future<spl::shared_ptr<texture>> future_texture;
+typedef std::shared_future<std::shared_ptr<texture>> future_texture;
 
 struct item
 {
@@ -96,15 +96,12 @@ public:
        {
        }
        
-       boost::unique_future<array<const std::uint8_t>> operator()(std::vector<layer> layers, const core::video_format_desc& format_desc)
+       std::future<array<const std::uint8_t>> operator()(std::vector<layer> layers, const core::video_format_desc& format_desc)
        {       
                if(layers.empty())
                { // Bypass GPU with empty frame.
                        auto buffer = spl::make_shared<const std::vector<uint8_t, tbb::cache_aligned_allocator<uint8_t>>>(format_desc.size, 0);
-                       return async(launch::deferred, [=]
-                       {
-                               return array<const std::uint8_t>(buffer->data(), format_desc.size, true, buffer);
-                       });
+                       return make_ready_future(array<const std::uint8_t>(buffer->data(), format_desc.size, true, buffer));
                }               
 
                if(format_desc.field_mode != core::field_mode::progressive)
@@ -126,18 +123,18 @@ public:
                        }
                }
 
-               return flatten(ogl_->begin_invoke([=]() mutable -> boost::shared_future<array<const std::uint8_t>>
+               return flatten(ogl_->begin_invoke([=]() mutable -> std::shared_future<array<const std::uint8_t>>
                {
                        auto target_texture = ogl_->create_texture(format_desc.width, format_desc.height, 4);
 
-                       if(format_desc.field_mode != core::field_mode::progressive)
+                       if (format_desc.field_mode != core::field_mode::progressive)
                        {
-                               draw(target_texture, layers,                    format_desc, core::field_mode::upper);
+                               draw(target_texture, layers, format_desc, core::field_mode::upper);
                                draw(target_texture, std::move(layers), format_desc, core::field_mode::lower);
                        }
-                       else                    
+                       else
                                draw(target_texture, std::move(layers), format_desc, core::field_mode::progressive);
-                                                               
+
                        return ogl_->copy_async(target_texture);
                }));
        }
@@ -231,7 +228,7 @@ private:
                draw_params.geometry    = item.geometry;
 
                BOOST_FOREACH(auto& future_texture, item.textures)
-                       draw_params.textures.push_back(future_texture.get());
+                       draw_params.textures.push_back(spl::make_shared_ptr(future_texture.get()));
 
                if(item.transform.is_key)
                {
@@ -344,7 +341,7 @@ public:
        {               
        }
        
-       boost::unique_future<array<const std::uint8_t>> render(const core::video_format_desc& format_desc)
+       std::future<array<const std::uint8_t>> render(const core::video_format_desc& format_desc)
        {
                return renderer_(std::move(layers_), format_desc);
        }
@@ -364,7 +361,7 @@ image_mixer::~image_mixer(){}
 void image_mixer::push(const core::frame_transform& transform){impl_->push(transform);}
 void image_mixer::visit(const core::const_frame& frame){impl_->visit(frame);}
 void image_mixer::pop(){impl_->pop();}
-boost::unique_future<array<const std::uint8_t>> image_mixer::operator()(const core::video_format_desc& format_desc){return impl_->render(format_desc);}
+std::future<array<const std::uint8_t>> image_mixer::operator()(const core::video_format_desc& format_desc){return impl_->render(format_desc);}
 void image_mixer::begin_layer(core::blend_mode blend_mode){impl_->begin_layer(blend_mode);}
 void image_mixer::end_layer(){impl_->end_layer();}
 core::mutable_frame image_mixer::create_frame(const void* tag, const core::pixel_format_desc& desc) {return impl_->create_frame(tag, desc);}
index 0d11b1ac9e94d50604e8b5175f0facc9c2741fdb..9728ba9d70fe8c8d764082afa14265570f3fec03 100644 (file)
@@ -54,7 +54,7 @@ public:
 
        // Methods
                        
-       boost::unique_future<array<const std::uint8_t>> operator()(const core::video_format_desc& format_desc) override;                
+       std::future<array<const std::uint8_t>> operator()(const core::video_format_desc& format_desc) override;         
        core::mutable_frame create_frame(const void* tag, const core::pixel_format_desc& desc) override;
 
        // core::image_mixer
index 92e87ce1f410f854d56891edc25f20e71f652862..56bee09c0ad7d184e2b43c2a5b1af241f20f008a 100644 (file)
@@ -271,8 +271,8 @@ std::string get_fragment(bool blend_modes)
        "}                                                                                                                                                                      \n";
 }
 
-spl::shared_ptr<shader> get_image_shader(
-               bool& blend_modes, bool blend_modes_wanted)
+std::shared_ptr<shader> get_image_shader(
+               const spl::shared_ptr<device>& ogl, bool& blend_modes, bool blend_modes_wanted)
 {
        tbb::mutex::scoped_lock lock(g_shader_mutex);
        auto existing_shader = g_shader.lock();
@@ -280,13 +280,28 @@ spl::shared_ptr<shader> get_image_shader(
        if(existing_shader)
        {
                blend_modes = g_blend_modes;
-               return spl::make_shared_ptr(existing_shader);
+               return existing_shader;
        }
+
+       // The deleter is alive until the weak pointer is destroyed, so we have
+       // to weakly reference ogl, to not keep it alive until atexit
+       std::weak_ptr<device> weak_ogl = ogl;
+
+       auto deleter = [weak_ogl](shader* p)
+       {
+               auto ogl = weak_ogl.lock();
+
+               if (ogl)
+                       ogl->invoke([=]
+                       {
+                               delete p;
+                       });
+       };
                
        try
        {                               
                g_blend_modes  = glTextureBarrierNV ? blend_modes_wanted : false;
-               existing_shader.reset(new shader(get_vertex(), get_fragment(g_blend_modes)));
+               existing_shader.reset(new shader(get_vertex(), get_fragment(g_blend_modes)), deleter);
        }
        catch(...)
        {
@@ -294,7 +309,7 @@ spl::shared_ptr<shader> get_image_shader(
                CASPAR_LOG(warning) << "Failed to compile shader. Trying to compile without blend-modes.";
                                
                g_blend_modes = false;
-               existing_shader.reset(new shader(get_vertex(), get_fragment(g_blend_modes)));
+               existing_shader.reset(new shader(get_vertex(), get_fragment(g_blend_modes)), deleter);
        }
                                                
        //if(!g_blend_modes)
@@ -303,9 +318,10 @@ spl::shared_ptr<shader> get_image_shader(
        //      CASPAR_LOG(info) << L"[shader] Blend-modes are disabled.";
        //}
 
+
        blend_modes = g_blend_modes;
        g_shader = existing_shader;
-       return spl::make_shared_ptr(existing_shader);
+       return existing_shader;
 }
 
 }}}
index b6d08d0ff20c4f2f83760551fb16795d01fb412a..a09f62ea65bdbbdcd347959581f36f9ffe61bb2c 100644 (file)
@@ -42,8 +42,8 @@ struct texture_id
        };
 };
 
-spl::shared_ptr<shader> get_image_shader(
-               bool& blend_modes, bool blend_modes_wanted);
+std::shared_ptr<shader> get_image_shader(
+               const spl::shared_ptr<device>& ogl, bool& blend_modes, bool blend_modes_wanted);
 
 
 }}}
\ No newline at end of file
index 4dc5db8b0d79e0cf89f27d09e511a962c93ab0f0..6e0c2a7a52b70df45338e1df6a556c4c7d5dbcc9 100644 (file)
@@ -81,7 +81,7 @@ struct device::impl : public std::enable_shared_from_this<impl>
                executor_.invoke([=]
                {
                        device_.reset(new sf::Context());
-                       device_->SetActive(true);               
+                       device_->setActive(true);               
                                                
                        if (glewInit() != GLEW_OK)
                                CASPAR_THROW_EXCEPTION(gl::ogl_exception() << msg_info("Failed to initialize GLEW."));
@@ -100,8 +100,14 @@ struct device::impl : public std::enable_shared_from_this<impl>
        {
                executor_.invoke([=]
                {
-                       BOOST_FOREACH(auto& pool, device_pools_)
+                       texture_cache_.clear();
+
+                       for (auto& pool : host_pools_)
+                               pool.clear();
+
+                       for (auto& pool : device_pools_)
                                pool.clear();
+
                        glDeleteFramebuffers(1, &fbo_);
 
                        device_.reset();
@@ -159,7 +165,7 @@ struct device::impl : public std::enable_shared_from_this<impl>
 
                        buf = executor_.invoke([&]
                        {
-                               return spl::make_shared<buffer>(size, usage);
+                               return std::make_shared<buffer>(size, usage);
                        }, task_priority::high_priority);
                        
                        if(timer.elapsed() > 0.02)
@@ -201,11 +207,11 @@ struct device::impl : public std::enable_shared_from_this<impl>
        }
 
        // TODO: Since the returned texture is cached it SHOULD NOT be modified.
-       boost::unique_future<spl::shared_ptr<texture>> copy_async(const array<const std::uint8_t>& source, int width, int height, int stride)
+       std::future<std::shared_ptr<texture>> copy_async(const array<const std::uint8_t>& source, int width, int height, int stride)
        {
                std::shared_ptr<buffer> buf = copy_to_buf(source);
                                
-               return executor_.begin_invoke([=]() -> spl::shared_ptr<texture>
+               return executor_.begin_invoke([=]() -> std::shared_ptr<texture>
                {
                        tbb::concurrent_hash_map<buffer*, std::shared_ptr<texture>>::const_accessor a;
                        if(texture_cache_.find(a, buf.get()))
@@ -220,11 +226,11 @@ struct device::impl : public std::enable_shared_from_this<impl>
                }, task_priority::high_priority);
        }
        
-       boost::unique_future<spl::shared_ptr<texture>> copy_async(const array<std::uint8_t>& source, int width, int height, int stride)
+       std::future<std::shared_ptr<texture>> copy_async(const array<std::uint8_t>& source, int width, int height, int stride)
        {
                std::shared_ptr<buffer> buf = copy_to_buf(source);
 
-               return executor_.begin_invoke([=]() -> spl::shared_ptr<texture>
+               return executor_.begin_invoke([=]() -> std::shared_ptr<texture>
                {
                        auto texture = create_texture(width, height, stride, false);
                        texture->copy_from(*buf);       
@@ -233,7 +239,7 @@ struct device::impl : public std::enable_shared_from_this<impl>
                }, task_priority::high_priority);
        }
 
-       boost::unique_future<array<const std::uint8_t>> copy_async(const spl::shared_ptr<texture>& source)
+       std::future<array<const std::uint8_t>> copy_async(const spl::shared_ptr<texture>& source)
        {
                if(!executor_.is_current())
                        CASPAR_THROW_EXCEPTION(invalid_operation() << msg_info("Operation only valid in an OpenGL Context."));
@@ -242,11 +248,12 @@ struct device::impl : public std::enable_shared_from_this<impl>
                source->copy_to(*buffer);       
 
                auto self = shared_from_this();
-               return async(launch::deferred, [self, buffer]() mutable -> array<const std::uint8_t>
+               auto cmd = [self, buffer]() mutable -> array<const std::uint8_t>
                {
                        self->executor_.invoke(std::bind(&buffer::map, std::ref(buffer))); // Defer blocking "map" call until data is needed.
                        return array<const std::uint8_t>(buffer->data(), buffer->size(), true, buffer);
-               });
+               };
+               return std::async(std::launch::deferred, std::move(cmd));
        }
 };
 
@@ -254,12 +261,12 @@ device::device()
        : executor_(L"OpenGL Rendering Context")
        , impl_(new impl(executor_)){}
 device::~device(){}
-spl::shared_ptr<texture>                                                       device::create_texture(int width, int height, int stride){return impl_->create_texture(width, height, stride, true);}
-array<std::uint8_t>                                                                    device::create_array(int size){return impl_->create_array(size);}
-boost::unique_future<spl::shared_ptr<texture>>         device::copy_async(const array<const std::uint8_t>& source, int width, int height, int stride){return impl_->copy_async(source, width, height, stride);}
-boost::unique_future<spl::shared_ptr<texture>>         device::copy_async(const array<std::uint8_t>& source, int width, int height, int stride){return impl_->copy_async(source, width, height, stride);}
-boost::unique_future<array<const std::uint8_t>>                device::copy_async(const spl::shared_ptr<texture>& source){return impl_->copy_async(source);}
-std::wstring                                                                           device::version() const{return impl_->version();}
+spl::shared_ptr<texture>                                       device::create_texture(int width, int height, int stride){return impl_->create_texture(width, height, stride, true);}
+array<std::uint8_t>                                                    device::create_array(int size){return impl_->create_array(size);}
+std::future<std::shared_ptr<texture>>          device::copy_async(const array<const std::uint8_t>& source, int width, int height, int stride){return impl_->copy_async(source, width, height, stride);}
+std::future<std::shared_ptr<texture>>          device::copy_async(const array<std::uint8_t>& source, int width, int height, int stride){return impl_->copy_async(source, width, height, stride);}
+std::future<array<const std::uint8_t>>         device::copy_async(const spl::shared_ptr<texture>& source){return impl_->copy_async(source);}
+std::wstring                                                           device::version() const{return impl_->version();}
 
 
 }}}
index b837f39aa9273b17e279f8234979752c80763ab0..b97f45be3b2eda15d81f5cf288304b1167b7a582 100644 (file)
@@ -51,13 +51,13 @@ public:
        array<std::uint8_t>              create_array(int size);
                
        // NOTE: Since the returned texture is cached it SHOULD NOT be modified.
-       boost::unique_future<spl::shared_ptr<texture>>  copy_async(const array<const std::uint8_t>& source, int width, int height, int stride);
+       std::future<std::shared_ptr<texture>>   copy_async(const array<const std::uint8_t>& source, int width, int height, int stride);
 
-       boost::unique_future<spl::shared_ptr<texture>>  copy_async(const array<std::uint8_t>& source, int width, int height, int stride);
-       boost::unique_future<array<const std::uint8_t>> copy_async(const spl::shared_ptr<texture>& source);
+       std::future<std::shared_ptr<texture>>   copy_async(const array<std::uint8_t>& source, int width, int height, int stride);
+       std::future<array<const std::uint8_t>>  copy_async(const spl::shared_ptr<texture>& source);
                        
        template<typename Func>
-       auto begin_invoke(Func&& func, task_priority priority = task_priority::normal_priority) -> boost::unique_future<decltype(func())> // noexcept
+       auto begin_invoke(Func&& func, task_priority priority = task_priority::normal_priority) -> std::future<decltype(func())> // noexcept
        {                       
                return executor_.begin_invoke(std::forward<Func>(func), priority);
        }
index ca4df35625077535478223fd3ce663e3be17fd81..5b20f56af239b2e93e02f900e045d4ea58b945d7 100644 (file)
@@ -1,6 +1,8 @@
 \r
-Microsoft Visual Studio Solution File, Format Version 11.00\r
-# Visual Studio 2010\r
+Microsoft Visual Studio Solution File, Format Version 12.00\r
+# Visual Studio 2013\r
+VisualStudioVersion = 12.0.31101.0\r
+MinimumVisualStudioVersion = 10.0.40219.1\r
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "core", "core\core.vcxproj", "{79388C20-6499-4BF6-B8B9-D8C33D7D4DDD}"\r
 EndProject\r
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shell", "shell\shell.vcxproj", "{8C26C94F-8092-4769-8D84-DEA479721C5B}"\r
index 356d502df472cebd0f34af91cb6740b88fb4f110..cd9ad300950dc3b62128c5c6db70caf2f148f923 100644 (file)
@@ -86,6 +86,7 @@ public:
        // Static Members
 
        // Constructors
+       array() = default; // Needed by std::future
 
        template<typename T>
        explicit array(const std::uint8_t* ptr, std::size_t size, bool cacheable, T&& storage)
index a5b59ff67840976a26b21bf7a3cb5633a8712b79..e229f58d5e57b0bf43e56648239212d9aa74f325 100644 (file)
@@ -140,7 +140,7 @@ public:
         */
        void set_capacity(size_type capacity)
        {
-               boost::mutex::scoped_lock lock (capacity_mutex_);
+               boost::unique_lock<boost::mutex> lock (capacity_mutex_);
 
                if (capacity_ < capacity)
                {
@@ -164,7 +164,7 @@ public:
         */
        size_type capacity() const
        {
-               boost::mutex::scoped_lock lock (capacity_mutex_);
+               boost::unique_lock<boost::mutex> lock (capacity_mutex_);
 
                return capacity_;
        }
index efa6a711fc5f574261222ea6c091a24d694f9c1d..154a133559a895a84f2ebb2f733cabd602b53db3 100644 (file)
@@ -192,7 +192,7 @@ public:
         */
        void set_capacity(size_type capacity)
        {
-               boost::mutex::scoped_lock lock (capacity_mutex_);
+               boost::unique_lock<boost::mutex> lock(capacity_mutex_);
 
                if (capacity_ < capacity)
                {
@@ -214,7 +214,7 @@ public:
         */
        size_type capacity() const
        {
-               boost::mutex::scoped_lock lock (capacity_mutex_);
+               boost::unique_lock<boost::mutex> lock (capacity_mutex_);
 
                return capacity_;
        }
index ddef5762f25ccf1c0d184770624b601f2092fb67..f61987f7b843b9a4d3827f8586554d3744046521 100644 (file)
@@ -1,18 +1,10 @@
 <?xml version="1.0" encoding="utf-8"?>\r
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <ItemGroup Label="ProjectConfigurations">\r
     <ProjectConfiguration Include="Debug|x64">\r
       <Configuration>Debug</Configuration>\r
       <Platform>x64</Platform>\r
     </ProjectConfiguration>\r
-    <ProjectConfiguration Include="Develop|x64">\r
-      <Configuration>Develop</Configuration>\r
-      <Platform>x64</Platform>\r
-    </ProjectConfiguration>\r
-    <ProjectConfiguration Include="Profile|x64">\r
-      <Configuration>Profile</Configuration>\r
-      <Platform>x64</Platform>\r
-    </ProjectConfiguration>\r
     <ProjectConfiguration Include="Release|x64">\r
       <Configuration>Release</Configuration>\r
       <Platform>x64</Platform>\r
     <ConfigurationType>StaticLibrary</ConfigurationType>\r
     <UseDebugLibraries>true</UseDebugLibraries>\r
     <CharacterSet>Unicode</CharacterSet>\r
+    <PlatformToolset>v120</PlatformToolset>\r
   </PropertyGroup>\r
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">\r
     <ConfigurationType>StaticLibrary</ConfigurationType>\r
     <UseDebugLibraries>false</UseDebugLibraries>\r
     <WholeProgramOptimization>true</WholeProgramOptimization>\r
     <CharacterSet>Unicode</CharacterSet>\r
+    <PlatformToolset>v120</PlatformToolset>\r
   </PropertyGroup>\r
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
   <ImportGroup Label="ExtensionSettings">\r
     <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectName)</TargetName>\r
     <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectName)</TargetName>\r
   </PropertyGroup>\r
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Develop|x64'">\r
-    <IncludePath>$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSdkDir)include;$(FrameworkSDKDir)\include;;..\..\dependencies64\ffmpeg\include\;..\dependencies64\asmlib\</IncludePath>\r
-  </PropertyGroup>\r
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Profile|x64'">\r
-    <IncludePath>$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSdkDir)include;$(FrameworkSDKDir)\include;;..\..\dependencies64\ffmpeg\include\;..\dependencies64\asmlib\</IncludePath>\r
-  </PropertyGroup>\r
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">\r
     <ClCompile>\r
       <PrecompiledHeader>Use</PrecompiledHeader>\r
       <WarningLevel>Level4</WarningLevel>\r
       <Optimization>Disabled</Optimization>\r
-      <PreprocessorDefinitions>TBB_USE_CAPTURED_EXCEPTION=0;TBB_USE_ASSERT=1;TBB_USE_DEBUG;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions>SFML_STATIC;BOOST_THREAD_VERSION=4;TBB_USE_CAPTURED_EXCEPTION=0;TBB_USE_ASSERT=1;TBB_USE_DEBUG;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
       <TreatWarningAsError>true</TreatWarningAsError>\r
       <SmallerTypeCheck>true</SmallerTypeCheck>\r
       <MultiProcessorCompilation>true</MultiProcessorCompilation>\r
@@ -97,9 +85,9 @@
       <FunctionLevelLinking>\r
       </FunctionLevelLinking>\r
       <IntrinsicFunctions>true</IntrinsicFunctions>\r
-      <PreprocessorDefinitions>TBB_USE_CAPTURED_EXCEPTION=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions>SFML_STATIC;BOOST_THREAD_VERSION=4;TBB_USE_CAPTURED_EXCEPTION=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
       <ExceptionHandling>Async</ExceptionHandling>\r
-      <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>\r
+      <EnableEnhancedInstructionSet>NotSet</EnableEnhancedInstructionSet>\r
       <MultiProcessorCompilation>true</MultiProcessorCompilation>\r
       <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>\r
       <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>\r
       </Command>\r
     </PostBuildEvent>\r
   </ItemDefinitionGroup>\r
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Develop|x64'">\r
-    <PostBuildEvent>\r
-      <Command>"SubWCRev.exe" "$(SolutionDir)." "$(SolutionDir)\version.tmpl" "$(SolutionDir)\version.h"</Command>\r
-    </PostBuildEvent>\r
-    <PreBuildEvent>\r
-      <Command> "$(SolutionDir).\gitrev.bat"</Command>\r
-    </PreBuildEvent>\r
-    <ClCompile>\r
-      <ForcedIncludeFiles>compiler/vs/disable_silly_warnings.h</ForcedIncludeFiles>\r
-    </ClCompile>\r
-  </ItemDefinitionGroup>\r
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Profile|x64'">\r
-    <PostBuildEvent>\r
-      <Command>"SubWCRev.exe" "$(SolutionDir)." "$(SolutionDir)\version.tmpl" "$(SolutionDir)\version.h"</Command>\r
-    </PostBuildEvent>\r
-    <PreBuildEvent>\r
-      <Command> "$(SolutionDir).\gitrev.bat"</Command>\r
-    </PreBuildEvent>\r
-    <ClCompile>\r
-      <ForcedIncludeFiles>compiler/vs/disable_silly_warnings.h</ForcedIncludeFiles>\r
-    </ClCompile>\r
-  </ItemDefinitionGroup>\r
   <ItemGroup>\r
     <ClInclude Include="array.h" />\r
     <ClInclude Include="assert.h" />\r
   <ItemGroup>\r
     <ClCompile Include="base64.cpp">\r
       <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Use</PrecompiledHeader>\r
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Develop|x64'">Use</PrecompiledHeader>\r
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Profile|x64'">Use</PrecompiledHeader>\r
       <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Use</PrecompiledHeader>\r
     </ClCompile>\r
     <ClCompile Include="compiler\vs\stack_walker.cpp">\r
       <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NotUsing</PrecompiledHeader>\r
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Develop|x64'">NotUsing</PrecompiledHeader>\r
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Profile|x64'">NotUsing</PrecompiledHeader>\r
       <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NotUsing</PrecompiledHeader>\r
       <ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Release|x64'">../../compiler/vs/disable_silly_warnings.h</ForcedIncludeFiles>\r
       <ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">../../compiler/vs/disable_silly_warnings.h</ForcedIncludeFiles>\r
-      <ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Develop|x64'">../../compiler/vs/disable_silly_warnings.h</ForcedIncludeFiles>\r
-      <ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Profile|x64'">../../compiler/vs/disable_silly_warnings.h</ForcedIncludeFiles>\r
     </ClCompile>\r
     <ClCompile Include="diagnostics\graph.cpp">\r
       <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">../StdAfx.h</PrecompiledHeaderFile>\r
       <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|x64'">../StdAfx.h</PrecompiledHeaderFile>\r
       <ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">../compiler/vs/disable_silly_warnings.h</ForcedIncludeFiles>\r
-      <ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Develop|x64'">../compiler/vs/disable_silly_warnings.h</ForcedIncludeFiles>\r
-      <ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Profile|x64'">../compiler/vs/disable_silly_warnings.h</ForcedIncludeFiles>\r
       <ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Release|x64'">../compiler/vs/disable_silly_warnings.h</ForcedIncludeFiles>\r
     </ClCompile>\r
     <ClCompile Include="env.cpp">\r
       <ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Release|x64'">compiler/vs/disable_silly_warnings.h</ForcedIncludeFiles>\r
       <ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">compiler/vs/disable_silly_warnings.h</ForcedIncludeFiles>\r
-      <ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Develop|x64'">compiler/vs/disable_silly_warnings.h</ForcedIncludeFiles>\r
-      <ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Profile|x64'">compiler/vs/disable_silly_warnings.h</ForcedIncludeFiles>\r
     </ClCompile>\r
     <ClCompile Include="except.cpp">\r
       <ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Release|x64'">compiler/vs/disable_silly_warnings.h</ForcedIncludeFiles>\r
       <ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">compiler/vs/disable_silly_warnings.h</ForcedIncludeFiles>\r
-      <ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Develop|x64'">compiler/vs/disable_silly_warnings.h</ForcedIncludeFiles>\r
-      <ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Profile|x64'">compiler/vs/disable_silly_warnings.h</ForcedIncludeFiles>\r
     </ClCompile>\r
     <ClCompile Include="gl\gl_check.cpp">\r
       <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">../StdAfx.h</PrecompiledHeaderFile>\r
       <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|x64'">../StdAfx.h</PrecompiledHeaderFile>\r
       <ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">../compiler/vs/disable_silly_warnings.h</ForcedIncludeFiles>\r
-      <ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Develop|x64'">../compiler/vs/disable_silly_warnings.h</ForcedIncludeFiles>\r
-      <ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Profile|x64'">../compiler/vs/disable_silly_warnings.h</ForcedIncludeFiles>\r
       <ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Release|x64'">../compiler/vs/disable_silly_warnings.h</ForcedIncludeFiles>\r
     </ClCompile>\r
     <ClCompile Include="log.cpp">\r
       <ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Release|x64'">compiler/vs/disable_silly_warnings.h</ForcedIncludeFiles>\r
       <ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">compiler/vs/disable_silly_warnings.h</ForcedIncludeFiles>\r
-      <ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Develop|x64'">compiler/vs/disable_silly_warnings.h</ForcedIncludeFiles>\r
-      <ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Profile|x64'">compiler/vs/disable_silly_warnings.h</ForcedIncludeFiles>\r
     </ClCompile>\r
     <ClCompile Include="page_locked_allocator.cpp">\r
       <ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Release|x64'">compiler/vs/disable_silly_warnings.h</ForcedIncludeFiles>\r
       <ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">compiler/vs/disable_silly_warnings.h</ForcedIncludeFiles>\r
-      <ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Develop|x64'">compiler/vs/disable_silly_warnings.h</ForcedIncludeFiles>\r
-      <ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Profile|x64'">compiler/vs/disable_silly_warnings.h</ForcedIncludeFiles>\r
     </ClCompile>\r
     <ClCompile Include="polling_filesystem_monitor.cpp" />\r
     <ClCompile Include="prec_timer.cpp">\r
       <ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Release|x64'">compiler/vs/disable_silly_warnings.h</ForcedIncludeFiles>\r
       <ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">compiler/vs/disable_silly_warnings.h</ForcedIncludeFiles>\r
-      <ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Develop|x64'">compiler/vs/disable_silly_warnings.h</ForcedIncludeFiles>\r
-      <ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Profile|x64'">compiler/vs/disable_silly_warnings.h</ForcedIncludeFiles>\r
     </ClCompile>\r
     <ClCompile Include="stdafx.cpp">\r
       <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>\r
       <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>\r
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Profile|x64'">Create</PrecompiledHeader>\r
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Develop|x64'">Create</PrecompiledHeader>\r
     </ClCompile>\r
     <ClCompile Include="tweener.cpp">\r
       <ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Release|x64'">compiler/vs/disable_silly_warnings.h</ForcedIncludeFiles>\r
       <ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">compiler/vs/disable_silly_warnings.h</ForcedIncludeFiles>\r
-      <ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Develop|x64'">compiler/vs/disable_silly_warnings.h</ForcedIncludeFiles>\r
-      <ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Profile|x64'">compiler/vs/disable_silly_warnings.h</ForcedIncludeFiles>\r
     </ClCompile>\r
     <ClCompile Include="utf.cpp">\r
       <ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Release|x64'">compiler/vs/disable_silly_warnings.h</ForcedIncludeFiles>\r
       <ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">compiler/vs/disable_silly_warnings.h</ForcedIncludeFiles>\r
-      <ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Develop|x64'">compiler/vs/disable_silly_warnings.h</ForcedIncludeFiles>\r
-      <ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Profile|x64'">compiler/vs/disable_silly_warnings.h</ForcedIncludeFiles>\r
     </ClCompile>\r
   </ItemGroup>\r
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
index 17cccf50bc75c76210cad4ba24472b6232d5365f..b7241d4293b5d3b6f76ec134adb006f8335e5b66 100644 (file)
 #include <tbb/atomic.h>
 #include <tbb/spin_mutex.h>
 
+#include <GL/glew.h>
+
 #include <array>
 #include <numeric>
 #include <tuple>
+#include <memory>
 
 namespace caspar { namespace diagnostics {
                
@@ -65,11 +68,29 @@ std::tuple<float, float, float, float> color(int code)
        return std::make_tuple(r, g, b, a);
 }
 
-struct drawable : public sf::Drawable
+sf::Font& get_default_font()
+{
+       static sf::Font DEFAULT_FONT = []()
+       {
+               sf::Font font;
+               if (!font.loadFromFile("arial.ttf"))
+                       BOOST_THROW_EXCEPTION(caspar_exception() << msg_info("arial.ttf not found"));
+               return font;
+       }();
+
+       return DEFAULT_FONT;
+}
+
+struct drawable : public sf::Drawable, public sf::Transformable
 {
        virtual ~drawable(){}
-       virtual void render(sf::RenderTarget& target) = 0;
-       virtual void Render(sf::RenderTarget& target) const { const_cast<drawable*>(this)->render(target);}
+       virtual void render(sf::RenderTarget& target, sf::RenderStates states) = 0;
+       virtual void draw(sf::RenderTarget& target, sf::RenderStates states) const override
+       {
+               states.transform *= getTransform();
+               glLoadMatrixf(states.transform.getMatrix());
+               const_cast<drawable*>(this)->render(target, states);
+       }
 };
 
 class context : public drawable
@@ -86,20 +107,24 @@ public:
                if(!drawable)
                        return;
 
-               get_instance().executor_.begin_invoke([=]
+               get_instance()->executor_.begin_invoke([=]
                {
-                       get_instance().do_register_drawable(drawable);
+                       get_instance()->do_register_drawable(drawable);
                }, task_priority::high_priority);
        }
 
        static void show(bool value)
        {
-               get_instance().executor_.begin_invoke([=]
+               get_instance()->executor_.begin_invoke([=]
                {       
-                       get_instance().do_show(value);
+                       get_instance()->do_show(value);
                }, task_priority::high_priority);
        }
-                               
+       
+       static void shutdown()
+       {
+               get_instance().reset();
+       }
 private:
        context() : executor_(L"diagnostics")
        {
@@ -116,8 +141,8 @@ private:
                        if(!window_)
                        {
                                window_.reset(new sf::RenderWindow(sf::VideoMode(750, 750), "CasparCG Diagnostics"));
-                               window_->SetPosition(0, 0);
-                               window_->SetActive();
+                               window_->setPosition(sf::Vector2i(0, 0));
+                               window_->setActive();
                                glEnable(GL_BLEND);
                                glEnable(GL_LINE_SMOOTH);
                                glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
@@ -135,22 +160,23 @@ private:
                        return;
 
                sf::Event e;
-               while(window_->GetEvent(e))
+               while(window_->pollEvent(e))
                {
-                       if(e.Type == sf::Event::Closed)
+                       if(e.type == sf::Event::Closed)
                        {
                                window_.reset();
                                return;
                        }
                }               
-               glClear(GL_COLOR_BUFFER_BIT);
-               window_->Draw(*this);
-               window_->Display();
+               //glClear(GL_COLOR_BUFFER_BIT);
+               window_->clear();
+               window_->draw(*this);
+               window_->display();
                boost::this_thread::sleep(boost::posix_time::milliseconds(10));
                executor_.begin_invoke([this]{tick();});
        }
 
-       void render(sf::RenderTarget& target)
+       void render(sf::RenderTarget& target, sf::RenderStates states)
        {
                auto count = std::max<size_t>(8, drawables_.size());
                float target_dy = 1.0f/static_cast<float>(count);
@@ -162,15 +188,15 @@ private:
                        auto drawable = it->lock();
                        if(drawable)
                        {
-                               drawable->SetScale(static_cast<float>(window_->GetWidth()), static_cast<float>(target_dy*window_->GetHeight()));
-                               float target_y = std::max(last_y, static_cast<float>(n * window_->GetHeight())*target_dy);
-                               drawable->SetPosition(0.0f, target_y);                  
-                               target.Draw(*drawable);                         
+                               drawable->setScale(static_cast<float>(window_->getSize().x), static_cast<float>(target_dy*window_->getSize().y));
+                               float target_y = std::max(last_y, static_cast<float>(n * window_->getSize().y)*target_dy);
+                               drawable->setPosition(0.0f, target_y);                  
+                               target.draw(*drawable, states);
                                ++it;           
                        }
                        else    
                                it = drawables_.erase(it);                      
-               }               
+               }
        }       
        
        void do_register_drawable(const std::shared_ptr<drawable>& drawable)
@@ -186,9 +212,9 @@ private:
                }
        }
        
-       static context& get_instance()
+       static std::unique_ptr<context>& get_instance()
        {
-               static context impl;
+               static auto impl = std::unique_ptr<context>(new context);
                return impl;
        }
 };
@@ -231,7 +257,7 @@ public:
                return color_;
        }
                
-       void render(sf::RenderTarget&)
+       void render(sf::RenderTarget& target, sf::RenderStates states)
        {
                float dx = 1.0f/static_cast<float>(line_data_.capacity());
                float x = static_cast<float>(line_data_.capacity()-line_data_.size())*dx;
@@ -308,7 +334,7 @@ struct graph::impl : public drawable
        }
                
 private:
-       void render(sf::RenderTarget& target)
+       void render(sf::RenderTarget& target, sf::RenderStates states)
        {
                const size_t text_size = 15;
                const size_t text_margin = 2;
@@ -323,38 +349,53 @@ private:
                        auto_reset = auto_reset_;
                }
 
-               sf::String text(text_str.c_str(), sf::Font::GetDefaultFont(), text_size);
-               text.SetStyle(sf::String::Italic);
-               text.Move(text_margin, text_margin);
+               //sf::Text test("Test", get_default_font());
+               //target.draw(test, states);
+
+               sf::Text text(text_str.c_str(), get_default_font(), text_size);
+               text.setStyle(sf::Text::Italic);
+               text.move(text_margin, text_margin);
                
-               glPushMatrix();
-                       glScaled(1.0f/GetScale().x, 1.0f/GetScale().y, 1.0f);
-                       target.Draw(text);
+               //glPushMatrix();
+                       //glScaled(1.0f/getScale().x, 1.0f/getScale().y, 1.0f);
+                       target.draw(text, states);
                        float x_offset = text_margin;
                        for(auto it = lines_.begin(); it != lines_.end(); ++it)
-                       {                                               
-                               sf::String line_text(it->first, sf::Font::GetDefaultFont(), text_size);
-                               line_text.SetPosition(x_offset, text_margin+text_offset/2);
+                       {
+                               sf::Text line_text(it->first, get_default_font(), text_size);
+                               line_text.setPosition(x_offset, text_margin+text_offset/2);
                                auto c = it->second.get_color();
-                               line_text.SetColor(sf::Color((c >> 24) & 255, (c >> 16) & 255, (c >> 8) & 255, (c >> 0) & 255));
-                               target.Draw(line_text);
-                               x_offset = line_text.GetRect().Right + text_margin*2;
+                               line_text.setColor(sf::Color((c >> 24) & 255, (c >> 16) & 255, (c >> 8) & 255, (c >> 0) & 255));
+                               target.draw(line_text, states);
+                               x_offset += (line_text.getLocalBounds().width/* - line_text.getLocalBounds().left*/) + text_margin * 2;
                        }
 
                        glDisable(GL_TEXTURE_2D);
-               glPopMatrix();
+               //glPopMatrix();
 
-               glBegin(GL_QUADS);
+               static auto rect = []()
+               {
+                       sf::RectangleShape r(sf::Vector2f(1.0f, 0.99f));
+                       r.setFillColor(sf::Color(255, 255, 255, 51));
+                       r.setOutlineThickness(0.00f);
+                       return r;
+               }();
+               target.draw(rect, states);
+               /*glBegin(GL_QUADS);
                        glColor4f(1.0f, 1.0f, 1.0f, 0.2f);      
                        glVertex2f(1.0f, 0.99f);
                        glVertex2f(0.0f, 0.99f);
                        glVertex2f(0.0f, 0.01f);        
                        glVertex2f(1.0f, 0.01f);        
-               glEnd();
-
-               glPushMatrix();
-                       glTranslated(0.0f, text_offset/GetScale().y, 1.0f);
-                       glScaled(1.0f, 1.0-text_offset/GetScale().y, 1.0f);
+               glEnd();*/
+
+               states.transform
+                       .translate(0, text_offset)
+                       .scale(1.0f, text_offset / getScale().y);
+               //glLoadMatrixf(states.transform.getMatrix());
+               //glPushMatrix();
+                       //glTranslated(0.0f, text_offset/getScale().y, 1.0f);
+                       //glScaled(1.0f, 1.0-text_offset/getScale().y, 1.0f);
                
                        glEnable(GL_LINE_STIPPLE);
                        glLineStipple(3, 0xAAAA);
@@ -378,12 +419,12 @@ private:
 
                        for(auto it = lines_.begin(); it != lines_.end(); ++it)         
                        {
-                               target.Draw(it->second);
+                               target.draw(it->second, states);
                                if(auto_reset)
                                        it->second.set_value(0.0f);
                        }
                
-               glPopMatrix();
+               //glPopMatrix();
        }
 
        impl(impl&);
@@ -409,6 +450,11 @@ void show_graphs(bool value)
        context::show(value);
 }
 
+void shutdown()
+{
+       context::shutdown();
+}
+
 //namespace v2
 //{    
 //     
index 3558c4b6d112f40559e5938a6b2e5e3cb080a2b1..b23e2fff4ac2e7422f8f6352bbbf5aa363c73168 100644 (file)
@@ -50,5 +50,6 @@ private:
 
 void register_graph(const spl::shared_ptr<graph>& graph);
 void show_graphs(bool value);
+void shutdown();
 
 }}
\ No newline at end of file
index 8e07f287b4e48cf782d7ac65c5a02f6cc0c7e9e6..48a11b8fef36f0848e309725551d022556f8d117 100644 (file)
@@ -57,7 +57,7 @@ void configure(const std::wstring& filename)
 {
        try
        {
-               auto initialPath = boost::filesystem3::initial_path().wstring();
+               auto initialPath = boost::filesystem::initial_path().wstring();
        
                std::wifstream file(initialPath + L"\\" + filename);
                boost::property_tree::read_xml(file, pt, boost::property_tree::xml_parser::trim_whitespace | boost::property_tree::xml_parser::no_comments);
@@ -65,7 +65,7 @@ void configure(const std::wstring& filename)
                auto paths      = pt.get_child(L"configuration.paths");
                media           = paths.get(L"media-path", initialPath + L"\\media\\");
                log                     = paths.get(L"log-path", initialPath + L"\\log\\");
-               ftemplate       = boost::filesystem3::complete(paths.get(L"template-path", initialPath + L"\\template\\")).wstring();           
+               ftemplate       = boost::filesystem::complete(paths.get(L"template-path", initialPath + L"\\template\\")).wstring();            
                data            = paths.get(L"data-path", initialPath + L"\\data\\");
                font            = paths.get(L"font-path", initialPath + L"\\fonts\\");
                thumbnails      = paths.get(L"thumbnails-path", initialPath + L"\\data\\");
index d964360e2457798c3f17bde9c08adbfd1acdaa9d..0b7333f8ea6840087d29151678f14c3e57a00111 100644 (file)
@@ -133,22 +133,3 @@ private:
 
 }
 
-namespace std
-{
-
-inline bool operator!=(const std::exception_ptr& lhs, const std::exception_ptr& rhs)
-{
-       return !(lhs == rhs);
-}
-
-inline bool operator!=(const std::exception_ptr& lhs, std::nullptr_t)
-{
-       return !(lhs == nullptr);
-}
-
-inline bool operator!=(std::nullptr_t, const std::exception_ptr& rhs)
-{
-       return !(nullptr == rhs);
-}
-
-}
\ No newline at end of file
index 2e9f0bbccbd0d6f6ec447df9dabb803085ef6ce1..369e902675cf35d6ca92a8d04cad5429d3d54126 100644 (file)
@@ -26,7 +26,7 @@
 #include "log.h"
 #include "blocking_bounded_queue_adapter.h"
 #include "blocking_priority_queue.h"
-
+#include "future.h"
 
 #include <tbb/atomic.h>
 #include <tbb/concurrent_priority_queue.h>
@@ -36,6 +36,7 @@
 #include <boost/assign/list_of.hpp>
 
 #include <functional>
+#include <future>
 
 namespace caspar {
                
@@ -98,7 +99,7 @@ public:
        }
 
        template<typename Func>
-       auto begin_invoke(Func&& func, task_priority priority = task_priority::normal_priority) -> boost::unique_future<decltype(func())> // noexcept
+       auto begin_invoke(Func&& func, task_priority priority = task_priority::normal_priority) -> std::future<decltype(func())> // noexcept
        {       
                if(!is_running_)
                        CASPAR_THROW_EXCEPTION(invalid_operation() << msg_info("executor not running.") << source_info(name_));
@@ -185,13 +186,13 @@ private:
        template<typename Func>
        auto internal_begin_invoke(
                Func&& func,
-               task_priority priority = task_priority::normal_priority) -> boost::unique_future<decltype(func())> // noexcept
+               task_priority priority = task_priority::normal_priority) -> std::future<decltype(func())> // noexcept
        {                                       
                typedef typename std::remove_reference<Func>::type      function_type;
                typedef decltype(func())                                                        result_type;
-               typedef boost::packaged_task<result_type>                       task_type;
+               typedef std::packaged_task<result_type()>                       task_type;
                                                                
-               std::unique_ptr<task_type> task;
+               std::shared_ptr<task_type> task;
 
                // Use pointers since the boost thread library doesn't fully support move semantics.
 
@@ -209,28 +210,15 @@ private:
                        delete raw_func2;
                        throw;
                }
-               
-               task->set_wait_callback(std::function<void(task_type&)>([=](task_type& my_task) // The std::function wrapper is required in order to add ::result_type to functor class.
-               {
-                       try
-                       {
-                               if(is_current())  // Avoids potential deadlock.
-                                       my_task();
-                       }
-                       catch(boost::task_already_started&){}
-               }));
                                
-               auto future = task->get_future();
-
-               auto raw_task = task.release();
-               auto function = [raw_task]
+               auto future = task->get_future().share();
+               auto function = [task]
                {
-                       std::unique_ptr<task_type> task(raw_task);
                        try
                        {
                                (*task)();
                        }
-                       catch(boost::task_already_started&){}
+                       catch(std::future_error&){}
                };
 
                if (!execution_queue_.try_push(priority, function))
@@ -239,7 +227,15 @@ private:
                        execution_queue_.push(priority, function);
                }
 
-               return std::move(future);               
+               return std::async(std::launch::deferred, [=]() mutable -> result_type
+               {
+                       if (!is_ready(future) && is_current()) // Avoids potential deadlock.
+                       {
+                               function();
+                       }
+
+                       return future.get();
+               });
        }
 
        void run() // noexcept
index c69b4f3f639520380e77aa97605a31f248cbb345..4ba435e88715362342404096f3a3c8f450bc3427 100644 (file)
@@ -26,9 +26,9 @@
 
 #include <boost/filesystem.hpp>
 #include <boost/noncopyable.hpp>
-#include <boost/thread/future.hpp>
 
 #include "memory.h"
+#include "future_fwd.h"
 
 namespace caspar {
 
@@ -46,7 +46,7 @@ public:
         * @return a future made available when the initially available files have been
         *         processed.
         */
-       virtual boost::unique_future<void> initial_files_processed() = 0;
+       virtual std::future<void> initial_files_processed() = 0;
 
        /**
         * Reemmit the already known files as MODIFIED events.
index 1a07026b3785afb0eb9602ba4c7feb7ea7bb9d2e..12c0bfc603dacd78d2810fad32721b4b6622a6ef 100644 (file)
 #pragma once
 
-#include "enum_class.h"
-
-#include <boost/thread/future.hpp>
-#include <boost/thread/thread.hpp>
-#include <boost/shared_ptr.hpp>
+#include <boost/thread/mutex.hpp>
+#include <boost/function.hpp>
+#include <boost/optional.hpp>
 
 #include <functional>
+#include <future>
 
 namespace caspar {
-       
-struct launch_policy_def
-{
-       enum type
-       {
-               async = 1,
-               deferred = 2
-       };
-};
-typedef caspar::enum_class<launch_policy_def> launch;
-
-namespace detail {
-       
-template<typename R>
-struct future_object_helper
-{      
-       template<typename T, typename F>
-       static void nonlocking_invoke(T& future_object, F& f)
-       {                               
-        try
-        {
-                       future_object.mark_finished_with_result_internal(f());
-        }
-        catch(...)
-        {
-                       future_object.mark_exceptional_finish_internal(boost::current_exception());
-        }
-       }
-
-       template<typename T, typename F>
-       static void locking_invoke(T& future_object, F& f)
-       {                               
-        try
-        {
-                       future_object.mark_finished_with_result(f());
-        }
-        catch(...)
-        {
-                       future_object.mark_exceptional_finish();
-        }
-       }
-};
-
-template<>
-struct future_object_helper<void>
-{      
-       template<typename T, typename F>
-       static void nonlocking_invoke(T& future_object, F& f)
-       {                               
-        try
-        {
-                       f();
-                       future_object.mark_finished_with_result_internal();
-        }
-        catch(...)
-        {
-                       future_object.mark_exceptional_finish_internal(boost::current_exception());
-        }
-       }
-
-       template<typename T, typename F>
-       static void locking_invoke(T& future_object, F& f)
-       {                               
-        try
-        {
-                       f();
-                       future_object.mark_finished_with_result();
-        }
-        catch(...)
-        {
-                       future_object.mark_exceptional_finish();
-        }
-       }
-};
-
-template<typename R, typename F>
-struct deferred_future_object : public boost::detail::future_object<R>
-{      
-       F f;
-       bool done;
-
-       template<typename F2>
-       deferred_future_object(F2&& f)
-               : f(std::forward<F2>(f))
-               , done(false)
-       {
-               set_wait_callback(std::mem_fn(&detail::deferred_future_object<R, F>::operator()), this);
-       }
-
-       ~deferred_future_object()
-       {
-       }
-               
-       void operator()()
-       {               
-               boost::lock_guard<boost::mutex> lock2(mutex);
-
-               if(done)
-                       return;
-
-               future_object_helper<R>::nonlocking_invoke(*this, f);
-
-               done = true;
-       }
-};
-
-template<typename R, typename F>
-struct async_future_object : public boost::detail::future_object<R>
-{      
-       F f;
-       boost::thread thread;
-
-       template<typename F2>
-       async_future_object(F2&& f)
-               : f(std::forward<F2>(f))
-               , thread([this]{run();})
-       {
-       }
-
-       ~async_future_object()
-       {
-               thread.join();
-       }
-
-       void run()
-       {
-               future_object_helper<R>::locking_invoke(*this, f);
-       }
-};
-
-}
-       
-template<typename F>
-auto async(launch policy, F&& f) -> boost::unique_future<decltype(f())>
-{              
-       typedef decltype(f())                                                           result_type;    
-       typedef boost::detail::future_object<result_type>       future_object_type;
-
-       boost::shared_ptr<future_object_type> future_object;
-
-       // HACK: This solution is a hack to avoid modifying boost code.
-
-       if((policy & launch::async) != 0)
-               future_object.reset(new detail::async_future_object<result_type, F>(std::forward<F>(f)), [](future_object_type* p){delete reinterpret_cast<detail::async_future_object<result_type, F>*>(p);});
-       else if((policy & launch::deferred) != 0)
-               future_object.reset(new detail::deferred_future_object<result_type, F>(std::forward<F>(f)), [](future_object_type* p){delete reinterpret_cast<detail::deferred_future_object<result_type, F>*>(p);});
-       else
-               throw std::invalid_argument("policy");
-       
-       boost::unique_future<result_type> future;
-
-       static_assert(sizeof(future) == sizeof(future_object), "");
-
-       reinterpret_cast<boost::shared_ptr<future_object_type>&>(future) = std::move(future_object); // Get around the "private" encapsulation.
-       return std::move(future);
-}
-       
-template<typename F>
-auto async(F&& f) -> boost::unique_future<decltype(f())>
-{      
-       return async(launch::async | launch::deferred, std::forward<F>(f));
-}
-
-template<typename T>
-auto make_shared(boost::unique_future<T>&& f) -> boost::shared_future<T>
-{      
-       return boost::shared_future<T>(std::move(f));
-}
 
 template<typename T>
-auto flatten(boost::unique_future<T>&& f) -> boost::unique_future<decltype(f.get().get())>
+auto flatten(std::future<T>&& f) -> std::future<typename std::decay<decltype(f.get().get())>::type>
 {
-       auto shared_f = make_shared(std::move(f));
-       return async(launch::deferred, [=]() mutable
+       auto shared_f = f.share();
+       return std::async(std::launch::deferred, [=]() mutable -> typename std::decay<decltype(f.get().get())>::type
        {
                return shared_f.get().get();
        });
 }
 
+template<typename F>
+bool is_ready(const F& future)
+{
+       return future.wait_for(std::chrono::seconds(0)) == std::future_status::ready;
+}
+
 /**
  * A utility that helps the producer side of a future when the task is not
  * able to complete immediately but there are known retry points in the code.
@@ -209,11 +46,11 @@ public:
         */
        void set_task(const func_type& func)
        {
-               boost::mutex::scoped_lock lock(mutex_);
+               boost::unique_lock<boost::mutex> lock(mutex_);
 
                func_ = func;
                done_ = false;
-               promise_ = boost::promise<R>();
+               promise_ = std::promise<R>();
        }
 
        /**
@@ -222,9 +59,9 @@ public:
         *
         * @return the future.
         */
-       boost::unique_future<R> get_future()
+       std::future<R> get_future()
        {
-               boost::mutex::scoped_lock lock(mutex_);
+               boost::unique_lock<boost::mutex> lock(mutex_);
 
                return promise_.get_future();
        }
@@ -237,7 +74,7 @@ public:
         */
        bool try_completion()
        {
-               boost::mutex::scoped_lock lock(mutex_);
+               boost::unique_lock<boost::mutex> lock(mutex_);
 
                return try_completion_internal();
        }
@@ -253,7 +90,7 @@ public:
        template <class E>
        void try_or_fail(const E& exception)
        {
-               boost::mutex::scoped_lock lock(mutex_);
+               boost::unique_lock<boost::mutex> lock(mutex_);
 
                if (!try_completion_internal())
                {
@@ -264,7 +101,7 @@ public:
                        catch (...)
                        {
                                CASPAR_LOG_CURRENT_EXCEPTION();
-                               promise_.set_exception(boost::current_exception());
+                               promise_.set_exception(std::current_exception());
                                done_ = true;
                        }
                }
@@ -287,7 +124,7 @@ private:
                catch (...)
                {
                        CASPAR_LOG_CURRENT_EXCEPTION();
-                       promise_.set_exception(boost::current_exception());
+                       promise_.set_exception(std::current_exception());
                        done_ = true;
 
                        return true;
@@ -304,7 +141,7 @@ private:
 private:
        boost::mutex mutex_;
        func_type func_;
-       boost::promise<R> promise_;
+       std::promise<R> promise_;
        bool done_;
 };
 
@@ -319,13 +156,22 @@ private:
  * @return The future with the result set.
  */
 template<class R>
-boost::unique_future<R> wrap_as_future(R&& value)
+std::future<R> make_ready_future(R&& value)
 {
-       boost::promise<R> p;
+       std::promise<R> p;
 
        p.set_value(value);
 
        return p.get_future();
 }
 
+static std::future<void> make_ready_future()
+{
+       std::promise<void> p;
+
+       p.set_value();
+
+       return p.get_future();
+}
+
 }
\ No newline at end of file
index 487914762e79f45265c4caeef2d737ed5fc88fb9..8c8eac054ed2cfc8929afac2795bcac486bc6f4d 100644 (file)
@@ -2,5 +2,6 @@
 
 #include "forward.h"
 
-FORWARD1(boost, template<typename> class unique_future);
-FORWARD1(boost, template<typename> class shared_future);
+FORWARD1(std, template<typename> class future);
+FORWARD1(std, template<typename> class shared_future);
+FORWARD1(std, template<typename> class promise);
index afbed41a845b0f4e7c0f384269c84f40960e7c8d..5301df6e95a85f0183852fd7abdf38d115886c88 100644 (file)
 
 #include "stdafx.h"
 
-#if defined(_MSC_VER)
-#pragma warning (disable : 4100) // 'identifier' : unreferenced formal parameter
-#pragma warning (disable : 4512) // 'class' : assignment operator could not be generated
-#endif
-
 #include "log.h"
 
 #include "except.h"
 #include <string>
 #include <ostream>
 
-#include <boost/bind.hpp>
 #include <boost/shared_ptr.hpp>
 #include <boost/make_shared.hpp>
 #include <boost/filesystem/convenience.hpp>
 #include <boost/date_time/posix_time/posix_time.hpp>
 #include <boost/algorithm/string.hpp>
+#include <boost/foreach.hpp>
 
-#include <boost/log/core/core.hpp>
-
-#include <boost/log/formatters/stream.hpp>
-#include <boost/log/formatters/attr.hpp>
-#include <boost/log/formatters/date_time.hpp>
-#include <boost/log/formatters/message.hpp>
-
-#include <boost/log/filters/attr.hpp>
-
-#include <boost/log/sinks/text_file_backend.hpp>
-
-#include <boost/log/detail/universal_path.hpp>
+#include <boost/log/core.hpp>
+#include <boost/log/trivial.hpp>
+#include <boost/log/expressions.hpp>
 
 #include <boost/log/sinks/text_file_backend.hpp>
 #include <boost/log/sinks/text_ostream_backend.hpp>
 #include <boost/log/sinks/sync_frontend.hpp>
 #include <boost/log/sinks/async_frontend.hpp>
 #include <boost/log/core/record.hpp>
-#include <boost/log/utility/attribute_value_extractor.hpp>
+#include <boost/log/attributes/attribute_value.hpp>
+#include <boost/log/attributes/current_thread_id.hpp>
+#include <boost/log/utility/setup/common_attributes.hpp>
 
-#include <boost/log/utility/init/common_attributes.hpp>
-#include <boost/log/utility/empty_deleter.hpp>
+#include <boost/core/null_deleter.hpp>
 #include <boost/lambda/lambda.hpp>
+#include <boost/bind.hpp>
+#include <boost/lexical_cast.hpp>
 
+#include <tbb/atomic.h>
 #include <tbb/enumerable_thread_specific.h>
 
 namespace caspar { namespace log {
 
 using namespace boost;
 
-void append_timestamp(std::wostream& stream)
+template<typename Stream>
+void append_timestamp(Stream& stream)
 {
        auto timestamp = boost::posix_time::microsec_clock::local_time();
        auto date = timestamp.date();
@@ -96,35 +87,51 @@ void append_timestamp(std::wostream& stream)
        stream << buffer.str();
 }
 
-void my_formatter(bool print_all_characters, std::wostream& strm, boost::log::basic_record<wchar_t> const& rec)
+class column_writer
 {
-    namespace lambda = boost::lambda;
-       
-       #pragma warning(disable : 4996)
-       
-       append_timestamp(strm);
-               
-    boost::log::attributes::current_thread_id::held_type thread_id;
-    if(boost::log::extract<boost::log::attributes::current_thread_id::held_type>(L"ThreadID", rec.attribute_values(), lambda::var(thread_id) = lambda::_1))
-        strm << L"[" << thread_id << L"] ";
-       
-    severity_level severity;
-    if(boost::log::extract<severity_level>(boost::log::sources::aux::severity_attribute_name<wchar_t>::get(), rec.attribute_values(), lambda::var(severity) = lambda::_1))
+       tbb::atomic<int> column_width_;
+public:
+       column_writer(int initial_width = 0)
+       {
+               column_width_ = initial_width;
+       }
+
+       template<typename Stream, typename Val>
+       void write(Stream& out, const Val& value)
        {
-               std::stringstream ss;
-               ss << severity;
-        strm << L"[" << severity << L"] ";
-               for(int n = 0; n < 7-static_cast<int>(ss.str().size()); ++n)
-                       strm << L" ";
+               std::string to_string = boost::lexical_cast<std::string>(value);
+               int length = static_cast<int>(to_string.size());
+               int read_width;
+
+               while ((read_width = column_width_) < length && column_width_.compare_and_swap(length, read_width) != read_width);
+               read_width = column_width_;
+
+               out << L"[" << to_string << L"] ";
+
+               for (int n = 0; n < read_width - length; ++n)
+                       out << L" ";
        }
+};
+
+template<typename Stream>
+void my_formatter(bool print_all_characters, const boost::log::record_view& rec, Stream& strm)
+{
+       static column_writer thread_id_column;
+       static column_writer severity_column(7);
+       namespace expr = boost::log::expressions;
+
+       append_timestamp(strm);
+
+       thread_id_column.write(strm, boost::log::extract<boost::log::attributes::current_thread_id::value_type>("ThreadID", rec).get().native_id());
+       severity_column.write(strm, boost::log::extract<boost::log::trivial::severity_level>("Severity", rec));
 
        if (print_all_characters)
        {
-               strm << rec.message();
+               strm << rec[expr::message];
        }
        else
        {
-           strm << replace_nonprintable_copy(rec.message(), L'?');
+               strm << replace_nonprintable_copy(rec[expr::message].get<std::wstring>(), L'?');
        }
 }
 
@@ -132,28 +139,19 @@ namespace internal{
        
 void init()
 {      
-       boost::log::add_common_attributes<wchar_t>();
-       typedef boost::log::aux::add_common_attributes_constants<wchar_t> traits_t;
-
-       typedef boost::log::sinks::synchronous_sink<boost::log::sinks::wtext_file_backend> file_sink_type;
-
+       boost::log::add_common_attributes();
        typedef boost::log::sinks::asynchronous_sink<boost::log::sinks::wtext_ostream_backend> stream_sink_type;
 
        auto stream_backend = boost::make_shared<boost::log::sinks::wtext_ostream_backend>();
-       stream_backend->add_stream(boost::shared_ptr<std::wostream>(&std::wcout, boost::log::empty_deleter()));
+       stream_backend->add_stream(boost::shared_ptr<std::wostream>(&std::wcout, boost::null_deleter()));
        stream_backend->auto_flush(true);
 
        auto stream_sink = boost::make_shared<stream_sink_type>(stream_backend);
-       
-//#ifdef NDEBUG
-//     stream_sink->set_filter(boost::log::filters::attr<severity_level>(boost::log::sources::aux::severity_attribute_name<wchar_t>::get()) >= debug);
-//#else
-//     stream_sink->set_filter(boost::log::filters::attr<severity_level>(boost::log::sources::aux::severity_attribute_name<wchar_t>::get()) >= debug);
-//#endif
 
-       stream_sink->locked_backend()->set_formatter(boost::bind(my_formatter, false, _1, _2));
+       bool print_all_characters = false;
+       stream_sink->set_formatter(boost::bind(&my_formatter<boost::log::wformatting_ostream>, print_all_characters, _1, _2));
 
-       boost::log::wcore::get()->add_sink(stream_sink);
+       boost::log::core::get()->add_sink(stream_sink);
 }
 
 std::wstring get_call_stack()
@@ -203,53 +201,46 @@ std::wstring get_call_stack()
 }
 
 void add_file_sink(const std::wstring& folder)
-{      
-       boost::log::add_common_attributes<wchar_t>();
-       typedef boost::log::aux::add_common_attributes_constants<wchar_t> traits_t;
-
-       typedef boost::log::sinks::synchronous_sink<boost::log::sinks::wtext_file_backend> file_sink_type;
+{
+       typedef boost::log::sinks::synchronous_sink<boost::log::sinks::text_file_backend> file_sink_type;
 
        try
        {
-               if(!boost::filesystem::is_directory(folder))
-                       CASPAR_THROW_EXCEPTION(directory_not_found());
+               if (!boost::filesystem::is_directory(folder))
+                       BOOST_THROW_EXCEPTION(directory_not_found());
 
                auto file_sink = boost::make_shared<file_sink_type>(
                        boost::log::keywords::file_name = (folder + L"caspar_%Y-%m-%d.log"),
                        boost::log::keywords::time_based_rotation = boost::log::sinks::file::rotation_at_time_point(0, 0, 0),
                        boost::log::keywords::auto_flush = true,
                        boost::log::keywords::open_mode = std::ios::app
-               );
-               
-               file_sink->locked_backend()->set_formatter(boost::bind(my_formatter, true, _1, _2));
-
-//#ifdef NDEBUG
-//             file_sink->set_filter(boost::log::filters::attr<severity_level>(boost::log::sources::aux::severity_attribute_name<wchar_t>::get()) >= debug);
-//#else
-//             file_sink->set_filter(boost::log::filters::attr<severity_level>(boost::log::sources::aux::severity_attribute_name<wchar_t>::get()) >= debug);
-//#endif
-               boost::log::wcore::get()->add_sink(file_sink);
+                       );
+
+               bool print_all_characters = true;
+
+               file_sink->set_formatter(boost::bind(&my_formatter<boost::log::formatting_ostream>, print_all_characters, _1, _2));
+               boost::log::core::get()->add_sink(file_sink);
        }
-       catch(...)
+       catch (...)
        {
                std::wcerr << L"Failed to Setup File Logging Sink" << std::endl << std::endl;
        }
 }
 
 void set_log_level(const std::wstring& lvl)
-{      
-       if(boost::iequals(lvl, L"trace"))
-               boost::log::wcore::get()->set_filter(boost::log::filters::attr<severity_level>(boost::log::sources::aux::severity_attribute_name<wchar_t>::get()) >= trace);
-       else if(boost::iequals(lvl, L"debug"))
-               boost::log::wcore::get()->set_filter(boost::log::filters::attr<severity_level>(boost::log::sources::aux::severity_attribute_name<wchar_t>::get()) >= debug);
-       else if(boost::iequals(lvl, L"info"))
-               boost::log::wcore::get()->set_filter(boost::log::filters::attr<severity_level>(boost::log::sources::aux::severity_attribute_name<wchar_t>::get()) >= info);
-       else if(boost::iequals(lvl, L"warning"))
-               boost::log::wcore::get()->set_filter(boost::log::filters::attr<severity_level>(boost::log::sources::aux::severity_attribute_name<wchar_t>::get()) >= warning);
-       else if(boost::iequals(lvl, L"error"))
-               boost::log::wcore::get()->set_filter(boost::log::filters::attr<severity_level>(boost::log::sources::aux::severity_attribute_name<wchar_t>::get()) >= error);
-       else if(boost::iequals(lvl, L"fatal"))
-               boost::log::wcore::get()->set_filter(boost::log::filters::attr<severity_level>(boost::log::sources::aux::severity_attribute_name<wchar_t>::get()) >= fatal);
+{
+       if (boost::iequals(lvl, L"trace"))
+               boost::log::core::get()->set_filter(boost::log::trivial::severity >= boost::log::trivial::trace);
+       else if (boost::iequals(lvl, L"debug"))
+               boost::log::core::get()->set_filter(boost::log::trivial::severity >= boost::log::trivial::debug);
+       else if (boost::iequals(lvl, L"info"))
+               boost::log::core::get()->set_filter(boost::log::trivial::severity >= boost::log::trivial::info);
+       else if (boost::iequals(lvl, L"warning"))
+               boost::log::core::get()->set_filter(boost::log::trivial::severity >= boost::log::trivial::warning);
+       else if (boost::iequals(lvl, L"error"))
+               boost::log::core::get()->set_filter(boost::log::trivial::severity >= boost::log::trivial::error);
+       else if (boost::iequals(lvl, L"fatal"))
+               boost::log::core::get()->set_filter(boost::log::trivial::severity >= boost::log::trivial::fatal);
 }
 
 }}
\ No newline at end of file
index 94a67671edf78f7196378710d03f382ac0c9ff8e..57495cad6e84c3ca3335805cdfe9cee78f5eb065 100644 (file)
 
 #pragma once
 
-#if defined(_MSC_VER)
-#pragma warning (push)
-#pragma warning (disable : 4100)
-#pragma warning (disable : 4127) // conditional expression is constant
-#pragma warning (disable : 4512)
-#pragma warning (disable : 4714) // marked as __forceinline not inlined
-#pragma warning (disable : 4996) // _CRT_SECURE_NO_WARNINGS
-#endif
-
-#include <boost/log/detail/prologue.hpp>
-#include <boost/log/keywords/severity.hpp>
+#include <boost/log/trivial.hpp>
 #include <boost/log/sources/global_logger_storage.hpp>
-#include <boost/log/sources/severity_logger.hpp>
-#include <boost/log/sources/record_ostream.hpp>
 
 #include <string>
 #include <locale>
@@ -68,17 +56,7 @@ inline std::basic_string<T> replace_nonprintable_copy(std::basic_string<T, std::
 
 void add_file_sink(const std::wstring& folder);
 
-enum severity_level
-{
-       trace,
-       debug,
-       info,
-       warning,
-       error,
-       fatal
-};
-
-template< typename CharT, typename TraitsT >
+/*template< typename CharT, typename TraitsT >
 inline std::basic_ostream< CharT, TraitsT >& operator<< (
        std::basic_ostream< CharT, TraitsT >& strm, severity_level lvl)
 {
@@ -98,19 +76,18 @@ inline std::basic_ostream< CharT, TraitsT >& operator<< (
                strm << static_cast<int>(lvl);
 
        return strm;
-}
+}*/
 
-typedef boost::log::sources::wseverity_logger_mt<severity_level> caspar_logger;
+typedef boost::log::sources::wseverity_logger_mt<boost::log::trivial::severity_level> caspar_logger;
 
-BOOST_LOG_DECLARE_GLOBAL_LOGGER_INIT(logger, caspar_logger)
+BOOST_LOG_INLINE_GLOBAL_LOGGER_INIT(logger, caspar_logger)
 {
        internal::init();
-       return caspar_logger(boost::log::keywords::severity = trace);
+       return caspar_logger(boost::log::trivial::trace);
 }
 
 #define CASPAR_LOG(lvl)\
-       BOOST_LOG_STREAM_WITH_PARAMS(::caspar::log::get_logger(),\
-               (::boost::log::keywords::severity = ::caspar::log::lvl))
+       BOOST_LOG_SEV(::caspar::log::logger::get(), ::boost::log::trivial::lvl)
 
 #define CASPAR_LOG_CALL_STACK()        try{\
                CASPAR_LOG(info) << L"callstack:\n" << caspar::log::internal::get_call_stack();\
@@ -126,6 +103,3 @@ void set_log_level(const std::wstring& lvl);
 
 }}
 
-#if defined(_MSC_VER)
-#pragma warning (pop)
-#endif
\ No newline at end of file
index 9737d6672818aa953022540bbd393734b6b82082..dfad7135b2749f1f8c6b721cb70fc061d76f1c98 100644 (file)
@@ -130,7 +130,7 @@ public:
 
                std::set<wpath> initial_files;
 
-               for (boost::filesystem3::wrecursive_directory_iterator iter(folder_); iter != boost::filesystem3::wrecursive_directory_iterator(); ++iter)
+               for (boost::filesystem::wrecursive_directory_iterator iter(folder_); iter != boost::filesystem::wrecursive_directory_iterator(); ++iter)
                {
                        if (should_abort())
                                return;
@@ -215,7 +215,7 @@ class polling_filesystem_monitor : public filesystem_monitor
        boost::thread scanning_thread_;
        tbb::atomic<bool> running_;
        int scan_interval_millis_;
-       boost::promise<void> initial_scan_completion_;
+       std::promise<void> initial_scan_completion_;
        tbb::concurrent_queue<boost::filesystem::wpath> to_reemmit_;
        tbb::atomic<bool> reemmit_all_;
 public:
@@ -241,7 +241,7 @@ public:
                scanning_thread_.join();
        }
 
-       virtual boost::unique_future<void> initial_files_processed()
+       virtual std::future<void> initial_files_processed()
        {
                return initial_scan_completion_.get_future();
        }
index c50394f852e488feefb1c4629a918314218c988b..1d94f015c836c74cb0439596bcdd17de3fd19293 100644 (file)
@@ -25,7 +25,7 @@
 
 #include <boost/noncopyable.hpp>
 #include <boost/thread/mutex.hpp>
-#include <boost/thread/condition.hpp>
+#include <boost/thread/condition_variable.hpp>
 
 namespace caspar {
 
@@ -45,7 +45,7 @@ class semaphore : boost::noncopyable
 {
        mutable boost::mutex mutex_;
        unsigned int permits_;
-       boost::condition_variable permits_available_;
+       boost::condition_variable_any permits_available_;
 public:
        /**
         * Constructor.
@@ -62,7 +62,7 @@ public:
         */
        void release()
        {
-               boost::mutex::scoped_lock lock(mutex_);
+               boost::unique_lock<boost::mutex> lock(mutex_);
 
                ++permits_;
 
@@ -76,7 +76,7 @@ public:
         */
        void release(unsigned int permits)
        {
-               boost::mutex::scoped_lock lock(mutex_);
+               boost::unique_lock<boost::mutex> lock(mutex_);
 
                permits_ += permits;
 
@@ -89,7 +89,7 @@ public:
         */
        void acquire()
        {
-               boost::mutex::scoped_lock lock(mutex_);
+               boost::unique_lock<boost::mutex> lock(mutex_);
 
                while (permits_ == 0u)
                {
@@ -107,7 +107,7 @@ public:
         */
        void acquire(unsigned int permits)
        {
-               boost::mutex::scoped_lock lock(mutex_);
+               boost::unique_lock<boost::mutex> lock(mutex_);
                auto num_acquired = 0u;
 
                while (true)
@@ -134,7 +134,7 @@ public:
         */
        bool try_acquire()
        {
-               boost::mutex::scoped_lock lock(mutex_);
+               boost::unique_lock<boost::mutex> lock(mutex_);
 
                if (permits_ == 0u)
                        return false;
@@ -152,7 +152,7 @@ public:
         */
        unsigned int permits() const
        {
-               boost::mutex::scoped_lock lock(mutex_);
+               boost::unique_lock<boost::mutex> lock(mutex_);
 
                return permits_;
        }
index f0c474b472141147484a1b96423c9f61ff2dc846..1524b813a9d576179877376ca4c5531dbb8e3d1a 100644 (file)
@@ -31,6 +31,8 @@
 
 #include <boost/thread.hpp>
 
+#include <future>
+
 namespace caspar { namespace core {
                
 std::vector<const consumer_factory_t> g_factories;
@@ -77,7 +79,7 @@ public:
                }).detach(); 
        }
        
-       boost::unique_future<bool> send(const_frame frame) override                                                                                     {return consumer_->send(std::move(frame));}
+       std::future<bool> send(const_frame frame) override                                                                                                      {return consumer_->send(std::move(frame));}
        virtual void initialize(const struct video_format_desc& format_desc, int channel_index) override        {return consumer_->initialize(format_desc, channel_index);}
        std::wstring print() const override                                                                                                                                     {return consumer_->print();}    
        std::wstring name() const override                                                                                                                                      {return consumer_->name();}
@@ -106,15 +108,15 @@ public:
                CASPAR_LOG(info) << str << L" Uninitialized.";
        }
        
-       boost::unique_future<bool> send(const_frame frame) override                                                                     {return consumer_->send(std::move(frame));}
+       std::future<bool> send(const_frame frame) override                                                                                                      {return consumer_->send(std::move(frame));}
        virtual void initialize(const struct video_format_desc& format_desc, int channel_index) override        {return consumer_->initialize(format_desc, channel_index);}
-       std::wstring print() const override                                                                                                                     {return consumer_->print();}
-       std::wstring name() const override                                                                                                                      {return consumer_->name();}
-       boost::property_tree::wptree info() const override                                                                                      {return consumer_->info();}
-       bool has_synchronization_clock() const override                                                                                         {return consumer_->has_synchronization_clock();}
-       int buffer_depth() const override                                                                                                                       {return consumer_->buffer_depth();}
-       int index() const override                                                                                                                                      {return consumer_->index();}
-       monitor::subject& monitor_output() override                                                                                                     {return consumer_->monitor_output();}                                                                           
+       std::wstring print() const override                                                                                                                                     {return consumer_->print();}
+       std::wstring name() const override                                                                                                                                      {return consumer_->name();}
+       boost::property_tree::wptree info() const override                                                                                                      {return consumer_->info();}
+       bool has_synchronization_clock() const override                                                                                                         {return consumer_->has_synchronization_clock();}
+       int buffer_depth() const override                                                                                                                                       {return consumer_->buffer_depth();}
+       int index() const override                                                                                                                                                      {return consumer_->index();}
+       monitor::subject& monitor_output() override                                                                                                                     {return consumer_->monitor_output();}                                                                           
 };
 
 class recover_consumer_proxy : public frame_consumer
@@ -128,7 +130,7 @@ public:
        {
        }
        
-       virtual boost::unique_future<bool> send(const_frame frame)                                      
+       virtual std::future<bool> send(const_frame frame)                                       
        {
                try
                {
@@ -146,7 +148,7 @@ public:
                        {
                                CASPAR_LOG_CURRENT_EXCEPTION();
                                CASPAR_LOG(error) << print() << " Failed to recover consumer.";
-                               return wrap_as_future(false);
+                               return make_ready_future(false);
                        }
                }
        }
@@ -188,12 +190,12 @@ public:
                consumer_->initialize(format_desc, channel_index);
        }
 
-       boost::unique_future<bool> send(const_frame frame) override
+       std::future<bool> send(const_frame frame) override
        {               
                if(audio_cadence_.size() == 1)
                        return consumer_->send(frame);
 
-               boost::unique_future<bool> result = wrap_as_future(true);
+               std::future<bool> result = make_ready_future(true);
                
                if(boost::range::equal(sync_buffer_, audio_cadence_) && audio_cadence_.front() * format_desc_.audio_channels == static_cast<int>(frame.audio_data().size())) 
                {       
@@ -252,7 +254,7 @@ const spl::shared_ptr<frame_consumer>& frame_consumer::empty()
        class empty_frame_consumer : public frame_consumer
        {
        public:
-               boost::unique_future<bool> send(const_frame) override {return wrap_as_future(false);}
+               std::future<bool> send(const_frame) override { return make_ready_future(false); }
                void initialize(const video_format_desc&, int) override{}
                std::wstring print() const override {return L"empty";}
                std::wstring name() const override {return L"empty";}
index 6d4fae17a3eaa01e7e2176aaad09329edeaa7cfa..cbd36480a3e9ad793f09851692f5cdacfb405838 100644 (file)
@@ -24,9 +24,9 @@
 #include "../monitor/monitor.h"
 
 #include <common/memory.h>
+#include <common/future_fwd.h>
 
 #include <boost/property_tree/ptree_fwd.hpp>
-#include <boost/thread/future.hpp>
 
 #include <functional>
 #include <string>
@@ -52,7 +52,7 @@ public:
        
        // Methods
 
-       virtual boost::unique_future<bool>              send(class const_frame frame) = 0;
+       virtual std::future<bool>                               send(class const_frame frame) = 0;
        virtual void                                                    initialize(const struct video_format_desc& format_desc, int channel_index) = 0;
        
        // monitor::observable
index a97e9918fb279f17523e69d51c14736a33150759..f1a578590062bd3d24e71ea7632be34ecbdd6aa1 100644 (file)
@@ -177,7 +177,7 @@ public:
                        if(!frames_.full())
                                return;
 
-                       std::map<int, boost::unique_future<bool>> send_results;
+                       std::map<int, std::future<bool>> send_results;
 
                        // Start invocations
                        for (auto it = ports_.begin(); it != ports_.end();)
@@ -231,7 +231,7 @@ public:
                return L"output[" + boost::lexical_cast<std::wstring>(channel_index_) + L"]";
        }
 
-       boost::unique_future<boost::property_tree::wptree> info()
+       std::future<boost::property_tree::wptree> info()
        {
                return std::move(executor_.begin_invoke([&]() -> boost::property_tree::wptree
                {                       
@@ -251,7 +251,7 @@ void output::add(int index, const spl::shared_ptr<frame_consumer>& consumer){imp
 void output::add(const spl::shared_ptr<frame_consumer>& consumer){impl_->add(consumer);}
 void output::remove(int index){impl_->remove(index);}
 void output::remove(const spl::shared_ptr<frame_consumer>& consumer){impl_->remove(consumer);}
-boost::unique_future<boost::property_tree::wptree> output::info() const{return impl_->info();}
+std::future<boost::property_tree::wptree> output::info() const{return impl_->info();}
 void output::operator()(const_frame frame, const video_format_desc& format_desc){(*impl_)(std::move(frame), format_desc);}
 monitor::subject& output::monitor_output() {return *impl_->monitor_subject_;}
 }}
\ No newline at end of file
index 00e88c1c0f3f1e1cc69654ce2eefb211c415e9d7..072c783c0fb26a8aebd6708c9e568bab44b8cb16 100644 (file)
@@ -59,7 +59,7 @@ public:
 
        // Properties
 
-       boost::unique_future<boost::property_tree::wptree> info() const;
+       std::future<boost::property_tree::wptree> info() const;
 
 private:
        struct impl;
index c168c846573c2f8e0ad51f96ea73ad13e61b82ff..07f51e1704608387c3a6b1c1765c5e5daf5dce55 100644 (file)
@@ -6,6 +6,8 @@
 #include "../frame/frame.h"
 #include <boost/lexical_cast.hpp>
 
+#include <future>
+
 namespace caspar { namespace core {
 
 struct port::impl
@@ -30,7 +32,7 @@ public:
                consumer_->initialize(format_desc, channel_index_);
        }
                
-       boost::unique_future<bool> send(const_frame frame)
+       std::future<bool> send(const_frame frame)
        {
                *monitor_subject_ << monitor::message("/type") % consumer_->name();
                return consumer_->send(std::move(frame));
@@ -65,7 +67,7 @@ port::port(int index, int channel_index, spl::shared_ptr<frame_consumer> consume
 port::port(port&& other) : impl_(std::move(other.impl_)){}
 port::~port(){}
 port& port::operator=(port&& other){impl_ = std::move(other.impl_); return *this;}
-boost::unique_future<bool> port::send(const_frame frame){return impl_->send(std::move(frame));}        
+std::future<bool> port::send(const_frame frame){return impl_->send(std::move(frame));} 
 monitor::subject& port::monitor_output() {return *impl_->monitor_subject_;}
 void port::video_format_desc(const struct video_format_desc& format_desc){impl_->video_format_desc(format_desc);}
 int port::buffer_depth() const{return impl_->buffer_depth();}
index f47b5377833315e0f733d4b758084c053bb6c02b..5251b2f8d9dd1b6c6b5b4bace6829c2970fccdb9 100644 (file)
@@ -3,9 +3,9 @@
 #include "../monitor/monitor.h"
 
 #include <common/memory.h>
+#include <common/future_fwd.h>
 
 #include <boost/property_tree/ptree_fwd.hpp>
-#include <boost/thread/future.hpp>
 
 namespace caspar { namespace core {
 
@@ -27,7 +27,7 @@ public:
 
        port& operator=(port&& other);
 
-       boost::unique_future<bool> send(class const_frame frame);       
+       std::future<bool> send(class const_frame frame);        
 
        monitor::subject& monitor_output();
 
index d6aebfa60a0d4b33dff8473e2e69f7a589a47f99..d730165f139a527a6c1969fe9d1c2f4c57298cc0 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <ItemGroup Label="ProjectConfigurations">\r
     <ProjectConfiguration Include="Debug|x64">\r
       <Configuration>Debug</Configuration>\r
     <ConfigurationType>StaticLibrary</ConfigurationType>\r
     <CharacterSet>Unicode</CharacterSet>\r
     <UseDebugLibraries>true</UseDebugLibraries>\r
+    <PlatformToolset>v120</PlatformToolset>\r
   </PropertyGroup>\r
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">\r
     <ConfigurationType>StaticLibrary</ConfigurationType>\r
     <UseDebugLibraries>false</UseDebugLibraries>\r
     <CharacterSet>Unicode</CharacterSet>\r
     <WholeProgramOptimization>true</WholeProgramOptimization>\r
+    <PlatformToolset>v120</PlatformToolset>\r
   </PropertyGroup>\r
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
   <ImportGroup Label="ExtensionSettings">\r
       <BrowseInformation>true</BrowseInformation>\r
       <WarningLevel>Level4</WarningLevel>\r
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
-      <PreprocessorDefinitions>TBB_USE_CAPTURED_EXCEPTION=0;TBB_USE_ASSERT=1;TBB_USE_DEBUG;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions>SFML_STATIC;BOOST_THREAD_VERSION=4;TBB_USE_CAPTURED_EXCEPTION=0;TBB_USE_ASSERT=1;TBB_USE_DEBUG;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
       <TreatWarningAsError>true</TreatWarningAsError>\r
       <MultiProcessorCompilation>true</MultiProcessorCompilation>\r
       <FloatingPointModel>Fast</FloatingPointModel>\r
       <ForcedIncludeFiles>common/compiler/vs/disable_silly_warnings.h</ForcedIncludeFiles>\r
+      <AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>\r
     </ClCompile>\r
     <PostBuildEvent>\r
       <Command>\r
       <AdditionalIncludeDirectories>../;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
       <ExceptionHandling>Async</ExceptionHandling>\r
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\r
-      <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>\r
+      <EnableEnhancedInstructionSet>NotSet</EnableEnhancedInstructionSet>\r
       <RuntimeTypeInfo>true</RuntimeTypeInfo>\r
       <PrecompiledHeader>Use</PrecompiledHeader>\r
       <WarningLevel>Level4</WarningLevel>\r
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
       <MultiProcessorCompilation>true</MultiProcessorCompilation>\r
-      <PreprocessorDefinitions>TBB_USE_CAPTURED_EXCEPTION=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions>SFML_STATIC;BOOST_THREAD_VERSION=4;TBB_USE_CAPTURED_EXCEPTION=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
       <WholeProgramOptimization>false</WholeProgramOptimization>\r
       <TreatWarningAsError>true</TreatWarningAsError>\r
       <OmitFramePointers>true</OmitFramePointers>\r
index ba7cdbcdc4afc4c2ead0b3eaab05a79581b8bb3b..0e25ed237133aa2be3970bb5895d9c7c20e6839a 100644 (file)
@@ -25,6 +25,7 @@
 
 #include <common/except.h>
 #include <common/array.h>
+#include <common/future.h>
 
 #include <core/frame/frame_visitor.h>
 #include <core/frame/pixel_format.h>
@@ -87,7 +88,7 @@ const const_frame& const_frame::empty()
 
 struct const_frame::impl : boost::noncopyable
 {                      
-       mutable std::vector<boost::shared_future<array<const std::uint8_t>>>    future_buffers_;
+       mutable std::vector<std::shared_future<array<const std::uint8_t>>>      future_buffers_;
        int                                                                                     id_;
        core::audio_buffer                                                      audio_data_;
        const core::pixel_format_desc                           desc_;
@@ -102,7 +103,7 @@ struct const_frame::impl : boost::noncopyable
        {
        }
        
-       impl(boost::shared_future<array<const std::uint8_t>> image, audio_buffer audio_buffer, const void* tag, const core::pixel_format_desc& desc) 
+       impl(std::shared_future<array<const std::uint8_t>> image, audio_buffer audio_buffer, const void* tag, const core::pixel_format_desc& desc) 
                : audio_data_(std::move(audio_buffer))
                , desc_(desc)
                , tag_(tag)
@@ -124,9 +125,7 @@ struct const_frame::impl : boost::noncopyable
        {
                for(std::size_t n = 0; n < desc_.planes.size(); ++n)
                {
-                       boost::promise<array<const std::uint8_t>> p;
-                       p.set_value(std::move(other.image_data(n)));
-                       future_buffers_.push_back(p.get_future());
+                       future_buffers_.push_back(make_ready_future<array<const std::uint8_t>>(std::move(other.image_data(n))).share());
                }
        }
 
@@ -152,7 +151,7 @@ struct const_frame::impl : boost::noncopyable
 };
        
 const_frame::const_frame(const void* tag) : impl_(new impl(tag)){}
-const_frame::const_frame(boost::shared_future<array<const std::uint8_t>> image, audio_buffer audio_buffer, const void* tag, const core::pixel_format_desc& desc) 
+const_frame::const_frame(std::shared_future<array<const std::uint8_t>> image, audio_buffer audio_buffer, const void* tag, const core::pixel_format_desc& desc) 
        : impl_(new impl(std::move(image), std::move(audio_buffer), tag, desc)){}
 const_frame::const_frame(mutable_frame&& other) : impl_(new impl(std::move(other))){}
 const_frame::~const_frame(){}
index 803f0f586213249b059f61452a329d3567114777..e6ade205ef05b33a9581f787fb0851fea585bd23 100644 (file)
@@ -8,6 +8,7 @@
 #include <common/memory.h>
 #include <common/forward.h>
 #include <common/array.h>
+#include <common/future_fwd.h>
 
 #include <boost/range.hpp>
 #include <boost/any.hpp>
@@ -82,7 +83,7 @@ public:
        // Constructors
 
        explicit const_frame(const void* tag = nullptr);
-       explicit const_frame(boost::shared_future<array<const std::uint8_t>> image, 
+       explicit const_frame(std::shared_future<array<const std::uint8_t>> image, 
                                                audio_buffer audio_buffer, 
                                                const void* tag, 
                                                const struct pixel_format_desc& desc);
index a3abd429e1c00073021bc7a92b410388e83667f6..53a5bbd19d3734e74efb2239dc2a045b465556a9 100644 (file)
@@ -64,7 +64,7 @@ public:
        virtual void begin_layer(blend_mode blend_mode) = 0;
        virtual void end_layer() = 0;
                
-       virtual boost::unique_future<array<const std::uint8_t>> operator()(const struct video_format_desc& format_desc) = 0;
+       virtual std::future<array<const std::uint8_t>> operator()(const struct video_format_desc& format_desc) = 0;
 
        virtual class mutable_frame create_frame(const void* tag, const struct pixel_format_desc& desc) = 0;
 
index bc88fc16e0ca842d04f5d6842267a58861cd4b19..8d5c1f6225ee281eee0c18e595b3204a592ea749 100644 (file)
@@ -33,6 +33,7 @@
 #include <common/diagnostics/graph.h>
 #include <common/except.h>
 #include <common/gl/gl_check.h>
+#include <common/future.h>
 
 #include <core/frame/draw_frame.h>
 #include <core/frame/frame_factory.h>
@@ -147,11 +148,9 @@ public:
                }, task_priority::high_priority);
        }
 
-       boost::unique_future<boost::property_tree::wptree> info() const
+       std::future<boost::property_tree::wptree> info() const
        {
-               boost::promise<boost::property_tree::wptree> info;
-               info.set_value(boost::property_tree::wptree());
-               return info.get_future();
+               return make_ready_future(boost::property_tree::wptree());
        }
 };
        
@@ -161,7 +160,7 @@ void mixer::set_blend_mode(int index, blend_mode value){impl_->set_blend_mode(in
 void mixer::clear_blend_mode(int index) { impl_->clear_blend_mode(index); }
 void mixer::clear_blend_modes() { impl_->clear_blend_modes(); }
 void mixer::set_master_volume(float volume) { impl_->set_master_volume(volume); }
-boost::unique_future<boost::property_tree::wptree> mixer::info() const{return impl_->info();}
+std::future<boost::property_tree::wptree> mixer::info() const{return impl_->info();}
 const_frame mixer::operator()(std::map<int, draw_frame> frames, const struct video_format_desc& format_desc){return (*impl_)(std::move(frames), format_desc);}
 mutable_frame mixer::create_frame(const void* tag, const core::pixel_format_desc& desc) {return impl_->image_mixer_->create_frame(tag, desc);}
 }}
\ No newline at end of file
index 2fcdbc6f3e194d8bc1bccd367e0f644d75fe3d71..6b1147a3c0c619d515d98d6b10604e01bfa62cdc 100644 (file)
@@ -66,7 +66,7 @@ public:
 
        // Properties
 
-       boost::unique_future<boost::property_tree::wptree> info() const;
+       std::future<boost::property_tree::wptree> info() const;
 
 private:
        struct impl;
index 472dfeed917a964bba6d29d4681e0c1fd71f1fda..c966733cc4dec35af4d09df605ce883d8c16e7dc 100644 (file)
@@ -129,7 +129,7 @@ draw_frame frame_producer_base::create_thumbnail_frame()
        return impl_->create_thumbnail_frame();
 }
 
-boost::unique_future<std::wstring> frame_producer_base::call(const std::vector<std::wstring>&) 
+std::future<std::wstring> frame_producer_base::call(const std::vector<std::wstring>&) 
 {
        CASPAR_THROW_EXCEPTION(not_supported());
 }
@@ -170,7 +170,7 @@ const spl::shared_ptr<frame_producer>& frame_producer::empty()
                monitor::subject& monitor_output() override {static monitor::subject monitor_subject(""); return monitor_subject;}                                                                              
                std::wstring name() const override {return L"empty";}
                uint32_t frame_number() const override {return 0;}
-               boost::unique_future<std::wstring> call(const std::vector<std::wstring>& params) override{CASPAR_THROW_EXCEPTION(not_supported());}
+               std::future<std::wstring> call(const std::vector<std::wstring>& params) override{CASPAR_THROW_EXCEPTION(not_supported());}
                variable& get_variable(const std::wstring& name) override { CASPAR_THROW_EXCEPTION(not_supported()); }
                const std::vector<std::wstring>& get_variables() const override { static std::vector<std::wstring> empty; return empty; }
                draw_frame last_frame() {return draw_frame::empty();}
@@ -242,7 +242,7 @@ public:
        std::wstring                                                                            name() const override                                                                                                                   {return producer_->name();}
        uint32_t                                                                                        frame_number() const override                                                                                                   {return producer_->frame_number();}
        boost::property_tree::wptree                                            info() const override                                                                                                                   {return producer_->info();}
-       boost::unique_future<std::wstring>                                      call(const std::vector<std::wstring>& params) override                                                  {return producer_->call(params);}
+       std::future<std::wstring>                                                       call(const std::vector<std::wstring>& params) override                                                  {return producer_->call(params);}
        variable&                                                                                       get_variable(const std::wstring& name) override                                                                 {return producer_->get_variable(name);}
        const std::vector<std::wstring>&                                        get_variables() const override                                                                                                  {return producer_->get_variables();}
        void                                                                                            leading_producer(const spl::shared_ptr<frame_producer>& producer) override              {return producer_->leading_producer(producer);}
index 9af8b44e182d28e841a5a983dfbc918951d79fc0..f07852feb5d8cabdd9a896d53fcdd4dbac17d967 100644 (file)
@@ -74,7 +74,7 @@ public:
        // Methods      
 
        virtual class draw_frame                                        receive() = 0;
-       virtual boost::unique_future<std::wstring>      call(const std::vector<std::wstring>& params) = 0;
+       virtual std::future<std::wstring>                       call(const std::vector<std::wstring>& params) = 0;
        virtual variable&                                                       get_variable(const std::wstring& name) = 0;
        virtual const std::vector<std::wstring>&        get_variables() const = 0;
        
@@ -109,7 +109,7 @@ public:
 
        // Methods      
 
-       virtual boost::unique_future<std::wstring>      call(const std::vector<std::wstring>& params) override;
+       virtual std::future<std::wstring>                       call(const std::vector<std::wstring>& params) override;
        virtual variable&                                                       get_variable(const std::wstring& name) override;
        virtual const std::vector<std::wstring>&        get_variables() const override;
        
index 68565df8d58dbc85c42ae3877b8757e9d52642a9..51c89a0ecd7bdd32af8b10484ed70ecb5cf4db67 100644 (file)
@@ -218,7 +218,7 @@ struct scene_producer::impl
 
        bool collides(double x, double y) const
        {
-               return collission_detect(x, y);
+               return static_cast<bool>((collission_detect(x, y)));
        }
 
        boost::optional<interaction_target> collission_detect(double x, double y) const
@@ -244,7 +244,7 @@ struct scene_producer::impl
                return boost::optional<interaction_target>();
        }
 
-       boost::unique_future<std::wstring> call(const std::vector<std::wstring>& params) 
+       std::future<std::wstring> call(const std::vector<std::wstring>& params) 
        {
                for (int i = 0; i + 1 < params.size(); i += 2)
                {
@@ -254,7 +254,7 @@ struct scene_producer::impl
                                found->second->from_string(params[i + 1]);
                }
 
-               return wrap_as_future(std::wstring(L""));
+               return make_ready_future(std::wstring(L""));
        }
 
        std::wstring print() const
@@ -338,7 +338,7 @@ boost::property_tree::wptree scene_producer::info() const
        return impl_->info();
 }
 
-boost::unique_future<std::wstring> scene_producer::call(const std::vector<std::wstring>& params) 
+std::future<std::wstring> scene_producer::call(const std::vector<std::wstring>& params) 
 {
        return impl_->call(params);
 }
@@ -386,7 +386,7 @@ spl::shared_ptr<core::frame_producer> create_dummy_scene_producer(const spl::sha
        auto text_area = text_producer::create(frame_factory, 0, 0, L"a", text_info, 1280, 720, false);
 
        auto text_width = text_area->pixel_constraints().width;
-       binding<double> padding(1);
+       binding<double> padding(1.0);
        binding<double> panel_width = padding + text_width + padding;
        binding<double> panel_height = padding + text_area->pixel_constraints().height + padding;
 
@@ -445,7 +445,7 @@ spl::shared_ptr<core::frame_producer> create_dummy_scene_producer(const spl::sha
                        .transformed([](double v) { return std::floor(v); }); // snap to pixels instead of subpixels
                        */
        tweener tween(L"easeoutbounce");
-       binding<double> panel_x(0);
+       binding<double> panel_x(0.0);
 
        scene->add_keyframe(panel_x, -panel_width, 0);
        scene->add_keyframe(panel_x, 300.0, 50, L"easeinoutsine");
index a34836bbef2aa777390d6b7aec8cefcd68becd2a..7e9ba810b5af1e03b01caffa9890332cd668b46f 100644 (file)
@@ -92,7 +92,7 @@ public:
        bool collides(double x, double y) const override;
        std::wstring print() const override;
        std::wstring name() const override;
-       boost::unique_future<std::wstring>      call(const std::vector<std::wstring>& params) override;
+       std::future<std::wstring>       call(const std::vector<std::wstring>& params) override;
        boost::property_tree::wptree info() const override;
        monitor::subject& monitor_output();
 
index e68f434ff26934a99f2290664d221bc28c5ce36f..e6861c4fd5797d16e20af27ebfcd9b19f2967263 100644 (file)
@@ -31,6 +31,8 @@
 #include <common/env.h>
 #include <core/producer/frame_producer.h>
 
+#include <future>
+
 #include "scene_producer.h"
 
 namespace caspar { namespace core { namespace scene {
index 6138901b034164d77aed763885074bc7fe8480f9..2a0607368fda8146be57aa1780c5aaddca691259 100644 (file)
@@ -29,6 +29,8 @@
 
 #include <tbb/parallel_invoke.h>
 
+#include <future>
+
 namespace caspar { namespace core {    
 
 class separated_producer : public frame_producer_base
@@ -118,7 +120,7 @@ public:
                return L"separated[fill:" + fill_producer_->print() + L"|key[" + key_producer_->print() + L"]]";
        }       
 
-       boost::unique_future<std::wstring> call(const std::vector<std::wstring>& params) override
+       std::future<std::wstring> call(const std::vector<std::wstring>& params) override
        {
                key_producer_->call(params);
                return fill_producer_->call(params);
index 876d2b5534c7938812a4a1b6a3656cae0686ea72..f0bb0a47f8934e7d7756709458a42f17b8add290 100644 (file)
@@ -45,6 +45,7 @@
 #include <functional>
 #include <map>
 #include <vector>
+#include <future>
 
 namespace caspar { namespace core {
        
@@ -89,7 +90,10 @@ public:
                                aggregator_.translate_and_send();
 
                                // WORKAROUND: Compiler doesn't seem to like lambda.
-                               tbb::parallel_for_each(indices.begin(), indices.end(), std::bind(&stage::impl::draw, this, std::placeholders::_1, std::ref(format_desc), std::ref(frames)));
+                               tbb::parallel_for_each(indices.begin(), indices.end(), [&](int index)
+                               {
+                                       draw(index, format_desc, frames);
+                               });
                        }
                        catch(...)
                        {
@@ -139,7 +143,7 @@ public:
                return it->second;
        }
                
-       boost::unique_future<void> apply_transforms(const std::vector<std::tuple<int, stage::transform_func_t, unsigned int, tweener>>& transforms)
+       std::future<void> apply_transforms(const std::vector<std::tuple<int, stage::transform_func_t, unsigned int, tweener>>& transforms)
        {
                return executor_.begin_invoke([=]
                {
@@ -152,7 +156,7 @@ public:
                }, task_priority::high_priority);
        }
                                                
-       boost::unique_future<void> apply_transform(int index, const stage::transform_func_t& transform, unsigned int mix_duration, const tweener& tween)
+       std::future<void> apply_transform(int index, const stage::transform_func_t& transform, unsigned int mix_duration, const tweener& tween)
        {
                return executor_.begin_invoke([=]
                {
@@ -162,7 +166,7 @@ public:
                }, task_priority::high_priority);
        }
 
-       boost::unique_future<void> clear_transforms(int index)
+       std::future<void> clear_transforms(int index)
        {
                return executor_.begin_invoke([=]
                {
@@ -170,7 +174,7 @@ public:
                }, task_priority::high_priority);
        }
 
-       boost::unique_future<void> clear_transforms()
+       std::future<void> clear_transforms()
        {
                return executor_.begin_invoke([=]
                {
@@ -178,7 +182,7 @@ public:
                }, task_priority::high_priority);
        }
                
-       boost::unique_future<void> load(int index, const spl::shared_ptr<frame_producer>& producer, bool preview, const boost::optional<int32_t>& auto_play_delta)
+       std::future<void> load(int index, const spl::shared_ptr<frame_producer>& producer, bool preview, const boost::optional<int32_t>& auto_play_delta)
        {
                return executor_.begin_invoke([=]
                {
@@ -186,7 +190,7 @@ public:
                }, task_priority::high_priority);
        }
 
-       boost::unique_future<void> pause(int index)
+       std::future<void> pause(int index)
        {               
                return executor_.begin_invoke([=]
                {
@@ -194,7 +198,7 @@ public:
                }, task_priority::high_priority);
        }
 
-       boost::unique_future<void> play(int index)
+       std::future<void> play(int index)
        {               
                return executor_.begin_invoke([=]
                {
@@ -202,7 +206,7 @@ public:
                }, task_priority::high_priority);
        }
 
-       boost::unique_future<void> stop(int index)
+       std::future<void> stop(int index)
        {               
                return executor_.begin_invoke([=]
                {
@@ -210,7 +214,7 @@ public:
                }, task_priority::high_priority);
        }
 
-       boost::unique_future<void> clear(int index)
+       std::future<void> clear(int index)
        {
                return executor_.begin_invoke([=]
                {
@@ -218,7 +222,7 @@ public:
                }, task_priority::high_priority);
        }
                
-       boost::unique_future<void> clear()
+       std::future<void> clear()
        {
                return executor_.begin_invoke([=]
                {
@@ -226,12 +230,14 @@ public:
                }, task_priority::high_priority);
        }       
                
-       boost::unique_future<void> swap_layers(stage& other)
+       std::future<void> swap_layers(stage& other)
        {
                auto other_impl = other.impl_;
 
-               if(other_impl.get() == this)
-                       return async(launch::deferred, []{});
+               if (other_impl.get() == this)
+               {
+                       return make_ready_future();
+               }
                
                auto func = [=]
                {
@@ -259,7 +265,7 @@ public:
                }, task_priority::high_priority);
        }
 
-       boost::unique_future<void> swap_layer(int index, int other_index)
+       std::future<void> swap_layer(int index, int other_index)
        {
                return executor_.begin_invoke([=]
                {
@@ -267,7 +273,7 @@ public:
                }, task_priority::high_priority);
        }
 
-       boost::unique_future<void> swap_layer(int index, int other_index, stage& other)
+       std::future<void> swap_layer(int index, int other_index, stage& other)
        {
                auto other_impl = other.impl_;
 
@@ -296,23 +302,23 @@ public:
                }
        }
                
-       boost::unique_future<spl::shared_ptr<frame_producer>> foreground(int index)
+       std::future<std::shared_ptr<frame_producer>> foreground(int index)
        {
-               return executor_.begin_invoke([=]
+               return executor_.begin_invoke([=]() -> std::shared_ptr<frame_producer>
                {
                        return get_layer(index).foreground();
                }, task_priority::high_priority);
        }
        
-       boost::unique_future<spl::shared_ptr<frame_producer>> background(int index)
+       std::future<std::shared_ptr<frame_producer>> background(int index)
        {
-               return executor_.begin_invoke([=]
+               return executor_.begin_invoke([=]() -> std::shared_ptr<frame_producer>
                {
                        return get_layer(index).background();
                }, task_priority::high_priority);
        }
 
-       boost::unique_future<boost::property_tree::wptree> info()
+       std::future<boost::property_tree::wptree> info()
        {
                return executor_.begin_invoke([this]() -> boost::property_tree::wptree
                {
@@ -324,7 +330,7 @@ public:
                }, task_priority::high_priority);
        }
 
-       boost::unique_future<boost::property_tree::wptree> info(int index)
+       std::future<boost::property_tree::wptree> info(int index)
        {
                return executor_.begin_invoke([=]
                {
@@ -332,11 +338,11 @@ public:
                }, task_priority::high_priority);
        }               
        
-       boost::unique_future<std::wstring> call(int index, const std::vector<std::wstring>& params)
+       std::future<std::wstring> call(int index, const std::vector<std::wstring>& params)
        {
                return flatten(executor_.begin_invoke([=]
                {
-                       return make_shared(get_layer(index).foreground()->call(params));
+                       return get_layer(index).foreground()->call(params).share();
                }, task_priority::high_priority));
        }
 
@@ -370,24 +376,24 @@ public:
 };
 
 stage::stage(spl::shared_ptr<diagnostics::graph> graph) : impl_(new impl(std::move(graph))){}
-boost::unique_future<std::wstring> stage::call(int index, const std::vector<std::wstring>& params){return impl_->call(index, params);}
-boost::unique_future<void> stage::apply_transforms(const std::vector<stage::transform_tuple_t>& transforms){return impl_->apply_transforms(transforms);}
-boost::unique_future<void> stage::apply_transform(int index, const std::function<core::frame_transform(core::frame_transform)>& transform, unsigned int mix_duration, const tweener& tween){return impl_->apply_transform(index, transform, mix_duration, tween);}
-boost::unique_future<void> stage::clear_transforms(int index){return impl_->clear_transforms(index);}
-boost::unique_future<void> stage::clear_transforms(){return impl_->clear_transforms();}
-boost::unique_future<void> stage::load(int index, const spl::shared_ptr<frame_producer>& producer, bool preview, const boost::optional<int32_t>& auto_play_delta){return impl_->load(index, producer, preview, auto_play_delta);}
-boost::unique_future<void> stage::pause(int index){return impl_->pause(index);}
-boost::unique_future<void> stage::play(int index){return impl_->play(index);}
-boost::unique_future<void> stage::stop(int index){return impl_->stop(index);}
-boost::unique_future<void> stage::clear(int index){return impl_->clear(index);}
-boost::unique_future<void> stage::clear(){return impl_->clear();}
-boost::unique_future<void> stage::swap_layers(stage& other){return impl_->swap_layers(other);}
-boost::unique_future<void> stage::swap_layer(int index, int other_index){return impl_->swap_layer(index, other_index);}
-boost::unique_future<void> stage::swap_layer(int index, int other_index, stage& other){return impl_->swap_layer(index, other_index, other);}
-boost::unique_future<spl::shared_ptr<frame_producer>> stage::foreground(int index) {return impl_->foreground(index);}
-boost::unique_future<spl::shared_ptr<frame_producer>> stage::background(int index) {return impl_->background(index);}
-boost::unique_future<boost::property_tree::wptree> stage::info() const{return impl_->info();}
-boost::unique_future<boost::property_tree::wptree> stage::info(int index) const{return impl_->info(index);}
+std::future<std::wstring> stage::call(int index, const std::vector<std::wstring>& params){return impl_->call(index, params);}
+std::future<void> stage::apply_transforms(const std::vector<stage::transform_tuple_t>& transforms){ return impl_->apply_transforms(transforms); }
+std::future<void> stage::apply_transform(int index, const std::function<core::frame_transform(core::frame_transform)>& transform, unsigned int mix_duration, const tweener& tween){ return impl_->apply_transform(index, transform, mix_duration, tween); }
+std::future<void> stage::clear_transforms(int index){ return impl_->clear_transforms(index); }
+std::future<void> stage::clear_transforms(){ return impl_->clear_transforms(); }
+std::future<void> stage::load(int index, const spl::shared_ptr<frame_producer>& producer, bool preview, const boost::optional<int32_t>& auto_play_delta){ return impl_->load(index, producer, preview, auto_play_delta); }
+std::future<void> stage::pause(int index){ return impl_->pause(index); }
+std::future<void> stage::play(int index){ return impl_->play(index); }
+std::future<void> stage::stop(int index){ return impl_->stop(index); }
+std::future<void> stage::clear(int index){ return impl_->clear(index); }
+std::future<void> stage::clear(){ return impl_->clear(); }
+std::future<void> stage::swap_layers(stage& other){ return impl_->swap_layers(other); }
+std::future<void> stage::swap_layer(int index, int other_index){ return impl_->swap_layer(index, other_index); }
+std::future<void> stage::swap_layer(int index, int other_index, stage& other){ return impl_->swap_layer(index, other_index, other); }
+std::future<std::shared_ptr<frame_producer>> stage::foreground(int index) { return impl_->foreground(index); }
+std::future<std::shared_ptr<frame_producer>> stage::background(int index) { return impl_->background(index); }
+std::future<boost::property_tree::wptree> stage::info() const{ return impl_->info(); }
+std::future<boost::property_tree::wptree> stage::info(int index) const{ return impl_->info(index); }
 std::map<int, class draw_frame> stage::operator()(const video_format_desc& format_desc){return (*impl_)(format_desc);}
 monitor::subject& stage::monitor_output(){return *impl_->monitor_subject_;}
 //void stage::subscribe(const frame_observable::observer_ptr& o) {impl_->frames_subject_.subscribe(o);}
index 25a68a61675517520178c0fdeccf4487403cfbd6..997c6b8d5781f015fd9010ccbc14fdf5d43df429 100644 (file)
@@ -64,20 +64,20 @@ public:
 
        std::map<int, class draw_frame> operator()(const struct video_format_desc& format_desc);
 
-       boost::unique_future<void>                      apply_transforms(const std::vector<transform_tuple_t>& transforms);
-       boost::unique_future<void>                      apply_transform(int index, const transform_func_t& transform, unsigned int mix_duration = 0, const tweener& tween = L"linear");
-       boost::unique_future<void>                      clear_transforms(int index);
-       boost::unique_future<void>                      clear_transforms();                             
-       boost::unique_future<void>                      load(int index, const spl::shared_ptr<class frame_producer>& producer, bool preview = false, const boost::optional<int32_t>& auto_play_delta = nullptr);
-       boost::unique_future<void>                      pause(int index);
-       boost::unique_future<void>                      play(int index);
-       boost::unique_future<void>                      stop(int index);
-       boost::unique_future<std::wstring>      call(int index, const std::vector<std::wstring>& params);
-       boost::unique_future<void>                      clear(int index);
-       boost::unique_future<void>                      clear();        
-       boost::unique_future<void>                      swap_layers(stage& other);
-       boost::unique_future<void>                      swap_layer(int index, int other_index);
-       boost::unique_future<void>                      swap_layer(int index, int other_index, stage& other);   
+       std::future<void>                       apply_transforms(const std::vector<transform_tuple_t>& transforms);
+       std::future<void>                       apply_transform(int index, const transform_func_t& transform, unsigned int mix_duration = 0, const tweener& tween = L"linear");
+       std::future<void>                       clear_transforms(int index);
+       std::future<void>                       clear_transforms();
+       std::future<void>                       load(int index, const spl::shared_ptr<class frame_producer>& producer, bool preview = false, const boost::optional<int32_t>& auto_play_delta = nullptr);
+       std::future<void>                       pause(int index);
+       std::future<void>                       play(int index);
+       std::future<void>                       stop(int index);
+       std::future<std::wstring>       call(int index, const std::vector<std::wstring>& params);
+       std::future<void>                       clear(int index);
+       std::future<void>                       clear();
+       std::future<void>                       swap_layers(stage& other);
+       std::future<void>                       swap_layer(int index, int other_index);
+       std::future<void>                       swap_layer(int index, int other_index, stage& other);
 
        monitor::subject& monitor_output();     
 
@@ -91,11 +91,11 @@ public:
 
        // Properties
 
-       boost::unique_future<spl::shared_ptr<class frame_producer>>     foreground(int index);
-       boost::unique_future<spl::shared_ptr<class frame_producer>>     background(int index);
+       std::future<std::shared_ptr<class frame_producer>>      foreground(int index);
+       std::future<std::shared_ptr<class frame_producer>>      background(int index);
 
-       boost::unique_future<boost::property_tree::wptree>                      info() const;
-       boost::unique_future<boost::property_tree::wptree>                      info(int index) const;
+       std::future<boost::property_tree::wptree>                       info() const;
+       std::future<boost::property_tree::wptree>                       info(int index) const;
 
 private:
        struct impl;
index bbb798d2e78154a03e666d97de339902ba8a02ed..0df96ed02a797c8b426826c6827fd2fd201376f3 100644 (file)
@@ -70,7 +70,7 @@ public:
 namespace caspar { namespace core {
        namespace text {
 
-               using namespace boost::filesystem3;
+               using namespace boost::filesystem;
 
                std::map<std::wstring, std::wstring> fonts;
 
@@ -217,12 +217,12 @@ public:
                return frame_;
        }
 
-       boost::unique_future<std::wstring> call(const std::vector<std::wstring>& param)
+       std::future<std::wstring> call(const std::vector<std::wstring>& param)
        {
                std::wstring result;
                text_.value().set(param.empty() ? L"" : param[0]);
 
-               return async(launch::deferred, [=]{return result;});
+               return make_ready_future(std::move(result));
        }
 
        variable& get_variable(const std::wstring& name)
@@ -300,7 +300,7 @@ text_producer::text_producer(const spl::shared_ptr<frame_factory>& frame_factory
 {}
 
 draw_frame text_producer::receive_impl() { return impl_->receive_impl(); }
-boost::unique_future<std::wstring> text_producer::call(const std::vector<std::wstring>& param) { return impl_->call(param); }
+std::future<std::wstring> text_producer::call(const std::vector<std::wstring>& param) { return impl_->call(param); }
 variable& text_producer::get_variable(const std::wstring& name) { return impl_->get_variable(name); }
 const std::vector<std::wstring>& text_producer::get_variables() const { return impl_->get_variables(); }
 text::string_metrics text_producer::measure_string(const std::wstring& str) { return impl_->measure_string(str); }
index f666f4ba73f1ba0f0509c0ffffc2dc2d46170029..731afca3853340a06237627796d6bbff24fc2844 100644 (file)
@@ -46,7 +46,7 @@ public:
        static spl::shared_ptr<text_producer> create(const spl::shared_ptr<class frame_factory>& frame_factory, int x, int y, const std::wstring& str, text::text_info& text_info, long parent_width, long parent_height, bool standalone = false);
        
        draw_frame receive_impl() override;
-       boost::unique_future<std::wstring> call(const std::vector<std::wstring>& param) override;
+       std::future<std::wstring> call(const std::vector<std::wstring>& param) override;
        variable& get_variable(const std::wstring& name) override;
        const std::vector<std::wstring>& get_variables() const override;
 
index c2f73306d02a181c46726c29f66a19b5156541d2..ff179245d5cb9916ba8cd2a46273b94989e3f150 100644 (file)
@@ -30,6 +30,8 @@
 
 #include <tbb/parallel_invoke.h>
 
+#include <future>
+
 namespace caspar { namespace core {    
 
 class transition_producer : public frame_producer_base
@@ -143,7 +145,7 @@ public:
                return dest_producer_->info();
        }
        
-       boost::unique_future<std::wstring> call(const std::vector<std::wstring>& params) override
+       std::future<std::wstring> call(const std::vector<std::wstring>& params) override
        {
                return dest_producer_->call(params);
        }
index de05a90e1609a723da6265b16a22b3f6b440dba1..014080132a579006477dfba22aa538d5a1581261 100644 (file)
@@ -26,6 +26,7 @@
 #include <iostream>
 #include <iterator>
 #include <set>
+#include <future>
 
 #include <boost/thread.hpp>
 #include <boost/range/algorithm/transform.hpp>
@@ -159,7 +160,7 @@ public:
                                                relative_without_extensions.end()),
                                boost::bind(&get_relative_without_extension, _1, media_path_));
 
-               for (boost::filesystem3::wrecursive_directory_iterator iter(thumbnails_path_); iter != boost::filesystem3::wrecursive_directory_iterator(); ++iter)
+               for (boost::filesystem::wrecursive_directory_iterator iter(thumbnails_path_); iter != boost::filesystem::wrecursive_directory_iterator(); ++iter)
                {
                        auto& path = iter->path();
 
@@ -181,7 +182,7 @@ public:
                auto base_file = media_path_ / media_file;
                auto folder = base_file.parent_path();
 
-               for (boost::filesystem3::directory_iterator iter(folder); iter != boost::filesystem3::directory_iterator(); ++iter)
+               for (boost::filesystem::directory_iterator iter(folder); iter != boost::filesystem::directory_iterator(); ++iter)
                {
                        auto stem = iter->path().stem();
 
@@ -252,7 +253,7 @@ public:
        {
                auto media_file = get_relative_without_extension(file, media_path_);
                auto png_file = thumbnails_path_ / (media_file + L".png");
-               boost::promise<void> thumbnail_ready;
+               std::promise<void> thumbnail_ready;
 
                {
                        auto producer = frame_producer::empty();
index ce1ca34c8086e2b6330ae928e7e78cfbe5159818..23e1420a98563ca83978a0220754258ddf32f96f 100644 (file)
 namespace caspar { namespace core {
        
 const std::vector<video_format_desc> format_descs = boost::assign::list_of
-       (video_format_desc(video_format::pal,                    720,  576, 1024, 576,  field_mode::upper,                         25,     1, L"PAL",           boost::assign::list_of<int>(1920)                                            ))
-       (video_format_desc(video_format::ntsc,                   720,  486,  720, 540,  field_mode::lower,                      30000,  1001, L"NTSC",          boost::assign::list_of<int>(1602)    (1601)    (1602)    (1601)    (1602)    ))
-       (video_format_desc(video_format::x576p2500,              720,  576, 1024, 576,  field_mode::progressive,           25,     1, L"576p2500",      boost::assign::list_of<int>(1920)                                            ))
-       (video_format_desc(video_format::x720p2398,             1280,  720, 1280, 720,  field_mode::progressive,        24000,  1001, L"720p2398",      boost::assign::list_of<int>(2002)                                            ))
-       (video_format_desc(video_format::x720p2400,             1280,  720, 1280, 720,  field_mode::progressive,           24,     1, L"720p2400",      boost::assign::list_of<int>(2000)                                            ))
-       (video_format_desc(video_format::x720p2500,             1280,  720, 1280, 720,  field_mode::progressive,           25,     1, L"720p2500",      boost::assign::list_of<int>(1920)                                            ))
-       (video_format_desc(video_format::x720p5000,             1280,  720, 1280, 720,  field_mode::progressive,           50,     1, L"720p5000",      boost::assign::list_of<int>(960)                                             ))
-       (video_format_desc(video_format::x720p2997,             1280,  720, 1280, 720,  field_mode::progressive,        30000,  1001, L"720p2997",      boost::assign::list_of<int>(1602)    (1601)    (1602)    (1601)    (1602)    ))
-       (video_format_desc(video_format::x720p5994,             1280,  720, 1280, 720,  field_mode::progressive,        60000,  1001, L"720p5994",      boost::assign::list_of<int>(801)(801)(800)(801)(801)(801)(800)(801)(801)(801)))
-       (video_format_desc(video_format::x720p3000,             1280,  720, 1280, 720,  field_mode::progressive,           30,     1, L"720p3000",      boost::assign::list_of<int>(1600)                                            ))
-       (video_format_desc(video_format::x720p6000,             1280,  720, 1280, 720,  field_mode::progressive,           60,     1, L"720p6000",      boost::assign::list_of<int>(800)                                             ))
-       (video_format_desc(video_format::x1080p2398,    1920, 1080, 1920, 1080, field_mode::progressive,        24000,  1001, L"1080p2398",     boost::assign::list_of<int>(2002)                                            ))
-       (video_format_desc(video_format::x1080p2400,    1920, 1080, 1920, 1080, field_mode::progressive,           24,     1, L"1080p2400",     boost::assign::list_of<int>(2000)                                            ))
-       (video_format_desc(video_format::x1080i5000,    1920, 1080, 1920, 1080, field_mode::upper,                         25,     1, L"1080i5000",     boost::assign::list_of<int>(1920)                                            ))
-       (video_format_desc(video_format::x1080i5994,    1920, 1080, 1920, 1080, field_mode::upper,                      30000,  1001, L"1080i5994",     boost::assign::list_of<int>(1602)    (1601)    (1602)    (1601)    (1602)    ))
-       (video_format_desc(video_format::x1080i6000,    1920, 1080, 1920, 1080, field_mode::upper,                         30,     1, L"1080i6000",     boost::assign::list_of<int>(1600)                                            ))
-       (video_format_desc(video_format::x1080p2500,    1920, 1080, 1920, 1080, field_mode::progressive,           25,     1, L"1080p2500",     boost::assign::list_of<int>(1920)                                            ))
-       (video_format_desc(video_format::x1080p2997,    1920, 1080, 1920, 1080, field_mode::progressive,        30000,  1001, L"1080p2997",     boost::assign::list_of<int>(1602)    (1601)    (1602)    (1601)    (1602)    ))
-       (video_format_desc(video_format::x1080p3000,    1920, 1080, 1920, 1080, field_mode::progressive,           30,     1, L"1080p3000",     boost::assign::list_of<int>(1600)                                            ))
-       (video_format_desc(video_format::x1080p5000,    1920, 1080, 1920, 1080, field_mode::progressive,           50,     1, L"1080p5000",     boost::assign::list_of<int>(960)                                             ))
-       (video_format_desc(video_format::x1080p5994,    1920, 1080, 1920, 1080, field_mode::progressive,        60000,  1001, L"1080p5994",     boost::assign::list_of<int>(801)(801)(800)(801)(801)(801)(800)(801)(801)(801)))
-       (video_format_desc(video_format::x1080p6000,    1920, 1080, 1920, 1080, field_mode::progressive,           60,     1, L"1080p6000",     boost::assign::list_of<int>(800)                                             ))
-       (video_format_desc(video_format::x2k2398,               2048, 1556, 2048, 1556, field_mode::progressive,    24000,  1001, L"2k2398",    boost::assign::list_of<int>(2002)                                                                    ))
-       (video_format_desc(video_format::x2k2400,               2048, 1556, 2048, 1556, field_mode::progressive,           24,     1, L"2k2400",        boost::assign::list_of<int>(2000)                                                                    ))
-       (video_format_desc(video_format::x2k2500,               2048, 1556, 2048, 1556, field_mode::progressive,       25,     1, L"2k2500",    boost::assign::list_of<int>(1920)                                                                    ))
-       (video_format_desc(video_format::x4k2398,               3840, 2160, 3840, 2160, field_mode::progressive,   24000,   1001, L"4k2398",    boost::assign::list_of<int>(2002)                                                        ))
-       (video_format_desc(video_format::x4k2400,               3840, 2160, 3840, 2160, field_mode::progressive,      24,      1, L"4k2400",    boost::assign::list_of<int>(2000)                                                                    ))
-       (video_format_desc(video_format::x4k2500,               3840, 2160, 3840, 2160, field_mode::progressive,      25,      1, L"4k2500",    boost::assign::list_of<int>(1920)                                                                    ))
-       (video_format_desc(video_format::x4k2997,               3840, 2160, 3840, 2160, field_mode::progressive,   30000,   1001, L"4k2398",    boost::assign::list_of<int>(1602)    (1601)    (1602)    (1601)    (1602)    ))
-       (video_format_desc(video_format::x4k3000,               3840, 2160, 3840, 2160, field_mode::progressive,      30,      1, L"4k3000",    boost::assign::list_of<int>(1600)                                                                    ))
-       (video_format_desc(video_format::invalid,                  0,    0,    0,        0, field_mode::progressive,       1,      1, L"invalid",       boost::assign::list_of<int>(1)                                               ));
+       (video_format_desc(video_format::pal,                    720,  576, 1024, 576,  field_mode::upper,                         25,     1, L"PAL",           boost::assign::list_of<int>(1920)                        ))
+       (video_format_desc(video_format::ntsc,                   720,  486,  720, 540,  field_mode::lower,                      30000,  1001, L"NTSC",          boost::assign::list_of<int>(1602)(1601)(1602)(1601)(1602)))
+       (video_format_desc(video_format::x576p2500,              720,  576, 1024, 576,  field_mode::progressive,           25,     1, L"576p2500",      boost::assign::list_of<int>(1920)                        ))
+       (video_format_desc(video_format::x720p2398,             1280,  720, 1280, 720,  field_mode::progressive,        24000,  1001, L"720p2398",      boost::assign::list_of<int>(2002)                        ))
+       (video_format_desc(video_format::x720p2400,             1280,  720, 1280, 720,  field_mode::progressive,           24,     1, L"720p2400",      boost::assign::list_of<int>(2000)                        ))
+       (video_format_desc(video_format::x720p2500,             1280,  720, 1280, 720,  field_mode::progressive,           25,     1, L"720p2500",      boost::assign::list_of<int>(1920)                        ))
+       (video_format_desc(video_format::x720p5000,             1280,  720, 1280, 720,  field_mode::progressive,           50,     1, L"720p5000",      boost::assign::list_of<int>(960)                         ))
+       (video_format_desc(video_format::x720p2997,             1280,  720, 1280, 720,  field_mode::progressive,        30000,  1001, L"720p2997",      boost::assign::list_of<int>(1602)(1601)(1602)(1601)(1602)))
+       (video_format_desc(video_format::x720p5994,             1280,  720, 1280, 720,  field_mode::progressive,        60000,  1001, L"720p5994",      boost::assign::list_of<int>(801) (800) (801) (801) (801) ))
+       (video_format_desc(video_format::x720p3000,             1280,  720, 1280, 720,  field_mode::progressive,           30,     1, L"720p3000",      boost::assign::list_of<int>(1600)                        ))
+       (video_format_desc(video_format::x720p6000,             1280,  720, 1280, 720,  field_mode::progressive,           60,     1, L"720p6000",      boost::assign::list_of<int>(800)                         ))
+       (video_format_desc(video_format::x1080p2398,    1920, 1080, 1920, 1080, field_mode::progressive,        24000,  1001, L"1080p2398",     boost::assign::list_of<int>(2002)                        ))
+       (video_format_desc(video_format::x1080p2400,    1920, 1080, 1920, 1080, field_mode::progressive,           24,     1, L"1080p2400",     boost::assign::list_of<int>(2000)                        ))
+       (video_format_desc(video_format::x1080i5000,    1920, 1080, 1920, 1080, field_mode::upper,                         25,     1, L"1080i5000",     boost::assign::list_of<int>(1920)                        ))
+       (video_format_desc(video_format::x1080i5994,    1920, 1080, 1920, 1080, field_mode::upper,                      30000,  1001, L"1080i5994",     boost::assign::list_of<int>(1602)(1601)(1602)(1601)(1602)))
+       (video_format_desc(video_format::x1080i6000,    1920, 1080, 1920, 1080, field_mode::upper,                         30,     1, L"1080i6000",     boost::assign::list_of<int>(1600)                        ))
+       (video_format_desc(video_format::x1080p2500,    1920, 1080, 1920, 1080, field_mode::progressive,           25,     1, L"1080p2500",     boost::assign::list_of<int>(1920)                        ))
+       (video_format_desc(video_format::x1080p2997,    1920, 1080, 1920, 1080, field_mode::progressive,        30000,  1001, L"1080p2997",     boost::assign::list_of<int>(1602)(1601)(1602)(1601)(1602)))
+       (video_format_desc(video_format::x1080p3000,    1920, 1080, 1920, 1080, field_mode::progressive,           30,     1, L"1080p3000",     boost::assign::list_of<int>(1600)                        ))
+       (video_format_desc(video_format::x1080p5000,    1920, 1080, 1920, 1080, field_mode::progressive,           50,     1, L"1080p5000",     boost::assign::list_of<int>(960)                         ))
+       (video_format_desc(video_format::x1080p5994,    1920, 1080, 1920, 1080, field_mode::progressive,        60000,  1001, L"1080p5994",     boost::assign::list_of<int>(801) (800) (801) (801) (801) ))
+       (video_format_desc(video_format::x1080p6000,    1920, 1080, 1920, 1080, field_mode::progressive,           60,     1, L"1080p6000",     boost::assign::list_of<int>(800)                         ))
+       (video_format_desc(video_format::x2k2398,               2048, 1556, 2048, 1556, field_mode::progressive,    24000,  1001, L"2k2398",    boost::assign::list_of<int>(2002)                                                ))
+       (video_format_desc(video_format::x2k2400,               2048, 1556, 2048, 1556, field_mode::progressive,           24,     1, L"2k2400",        boost::assign::list_of<int>(2000)                                                ))
+       (video_format_desc(video_format::x2k2500,               2048, 1556, 2048, 1556, field_mode::progressive,       25,     1, L"2k2500",    boost::assign::list_of<int>(1920)                                                ))
+       (video_format_desc(video_format::x4k2398,               3840, 2160, 3840, 2160, field_mode::progressive,   24000,   1001, L"4k2398",    boost::assign::list_of<int>(2002)                                    ))
+       (video_format_desc(video_format::x4k2400,               3840, 2160, 3840, 2160, field_mode::progressive,      24,      1, L"4k2400",    boost::assign::list_of<int>(2000)                                                ))
+       (video_format_desc(video_format::x4k2500,               3840, 2160, 3840, 2160, field_mode::progressive,      25,      1, L"4k2500",    boost::assign::list_of<int>(1920)                                                ))
+       (video_format_desc(video_format::x4k2997,               3840, 2160, 3840, 2160, field_mode::progressive,   30000,   1001, L"4k2398",    boost::assign::list_of<int>(1602)(1601)(1602)(1601)(1602)))
+       (video_format_desc(video_format::x4k3000,               3840, 2160, 3840, 2160, field_mode::progressive,      30,      1, L"4k3000",    boost::assign::list_of<int>(1600)                                                ))
+       (video_format_desc(video_format::invalid,                  0,    0,    0,        0, field_mode::progressive,       1,      1, L"invalid",       boost::assign::list_of<int>(1)                           ));
 
 video_format_desc::video_format_desc(video_format format,
                                        int width,
index 1358048d35a84a0d4df8c59836ee09c8d56cd8f2..c488deec3936df2c5ca5025f282c09ab2b8c2fbb 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <ItemGroup Label="ProjectConfigurations">\r
     <ProjectConfiguration Include="Debug|x64">\r
       <Configuration>Debug</Configuration>\r
     <CharacterSet>Unicode</CharacterSet>\r
     <UseDebugLibraries>false</UseDebugLibraries>\r
     <WholeProgramOptimization>true</WholeProgramOptimization>\r
+    <PlatformToolset>v120</PlatformToolset>\r
   </PropertyGroup>\r
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">\r
     <ConfigurationType>StaticLibrary</ConfigurationType>\r
     <CharacterSet>Unicode</CharacterSet>\r
     <UseDebugLibraries>true</UseDebugLibraries>\r
+    <PlatformToolset>v120</PlatformToolset>\r
   </PropertyGroup>\r
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
   <ImportGroup Label="ExtensionSettings">\r
@@ -61,7 +63,7 @@
       <BrowseInformation>true</BrowseInformation>\r
       <WarningLevel>Level4</WarningLevel>\r
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
-      <PreprocessorDefinitions>TBB_USE_DEBUG;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;TBB_USE_CAPTURED_EXCEPTION=0;TBB_USE_ASSERT=1;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions>SFML_STATIC;BOOST_THREAD_VERSION=4;TBB_USE_DEBUG;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;TBB_USE_CAPTURED_EXCEPTION=0;TBB_USE_ASSERT=1;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
       <TreatWarningAsError>true</TreatWarningAsError>\r
       <MultiProcessorCompilation>true</MultiProcessorCompilation>\r
       <FloatingPointModel>Fast</FloatingPointModel>\r
       <AdditionalIncludeDirectories>../;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
       <ExceptionHandling>Async</ExceptionHandling>\r
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\r
-      <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>\r
+      <EnableEnhancedInstructionSet>NotSet</EnableEnhancedInstructionSet>\r
       <RuntimeTypeInfo>true</RuntimeTypeInfo>\r
       <PrecompiledHeader>Use</PrecompiledHeader>\r
       <WarningLevel>Level4</WarningLevel>\r
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
       <MultiProcessorCompilation>true</MultiProcessorCompilation>\r
-      <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;TBB_USE_CAPTURED_EXCEPTION=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions>SFML_STATIC;BOOST_THREAD_VERSION=4;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;TBB_USE_CAPTURED_EXCEPTION=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
       <WholeProgramOptimization>false</WholeProgramOptimization>\r
       <TreatWarningAsError>true</TreatWarningAsError>\r
       <OmitFramePointers>true</OmitFramePointers>\r
index 3ad32d01c17780f61bec4df08acbbea787ee07af..2138f3c209bdefc911e589bb2ae0039a7a25ccaa 100644 (file)
@@ -186,7 +186,7 @@ public:
                        CASPAR_LOG(error)<< print() << TEXT(" Failed to disable video output.");                
        }
        
-       boost::unique_future<bool> send(core::const_frame& frame)
+       std::future<bool> send(core::const_frame& frame)
        {                                       
                return executor_.begin_invoke([=]() -> bool
                {
@@ -328,7 +328,7 @@ public:
                consumer_.reset(new bluefish_consumer(format_desc, device_index_, embedded_audio_, key_only_, channel_index));
        }
        
-       boost::unique_future<bool> send(core::const_frame frame) override
+       std::future<bool> send(core::const_frame frame) override
        {
                CASPAR_VERIFY(audio_cadence_.front() * format_desc_.audio_channels == static_cast<size_t>(frame.audio_data().size()));
                boost::range::rotate(audio_cadence_, std::begin(audio_cadence_)+1);
index b2b9620b1d129336e8150e1af30d0f11d626a673..83e35c32e149b42d6f3a95f3f49207324196de66 100644 (file)
@@ -432,7 +432,7 @@ public:
 
                        unsigned long buffered;
                        output_->GetBufferedAudioSampleFrameCount(&buffered);
-                       graph_->set_value("buffered-audio", static_cast<double>(buffered)/(format_desc_.audio_cadence[0]*format_desc_.audio_channels*2));
+                       graph_->set_value("buffered-audio", static_cast<double>(buffered) / (format_desc_.audio_cadence[0] * format_desc_.audio_channels * 2));
                }
                catch(...)
                {
@@ -469,7 +469,7 @@ public:
                tick_timer_.restart();
        }
 
-       boost::unique_future<bool> send(core::const_frame frame)
+       std::future<bool> send(core::const_frame frame)
        {
                auto exception = lock(exception_mutex_, [&]
                {
@@ -500,7 +500,7 @@ public:
                };
                
                if (enqueue_task())
-                       return wrap_as_future(true);
+                       return make_ready_future(true);
 
                send_completion_.set_task(enqueue_task);
 
@@ -552,7 +552,7 @@ public:
                });
        }
        
-       boost::unique_future<bool> send(core::const_frame frame) override
+       std::future<bool> send(core::const_frame frame) override
        {
                return consumer_->send(frame);
        }
index 1d91d979d78293bc9e6af02bcc134d553d58d1d9..9789a999e96946ca37c11d56032cce99255a9ad6 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <ItemGroup Label="ProjectConfigurations">\r
     <ProjectConfiguration Include="Debug|x64">\r
       <Configuration>Debug</Configuration>\r
     <CharacterSet>Unicode</CharacterSet>\r
     <UseDebugLibraries>false</UseDebugLibraries>\r
     <WholeProgramOptimization>true</WholeProgramOptimization>\r
+    <PlatformToolset>v120</PlatformToolset>\r
   </PropertyGroup>\r
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">\r
     <ConfigurationType>StaticLibrary</ConfigurationType>\r
     <CharacterSet>Unicode</CharacterSet>\r
     <UseDebugLibraries>true</UseDebugLibraries>\r
+    <PlatformToolset>v120</PlatformToolset>\r
   </PropertyGroup>\r
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
   <ImportGroup Label="ExtensionSettings">\r
@@ -69,7 +71,7 @@
       <BrowseInformation>true</BrowseInformation>\r
       <WarningLevel>Level4</WarningLevel>\r
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
-      <PreprocessorDefinitions>TBB_USE_DEBUG;TBB_USE_CAPTURED_EXCEPTION=0;TBB_USE_ASSERT=1;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions>SFML_STATIC;BOOST_THREAD_VERSION=4;TBB_USE_DEBUG;TBB_USE_CAPTURED_EXCEPTION=0;TBB_USE_ASSERT=1;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
       <TreatWarningAsError>true</TreatWarningAsError>\r
       <MultiProcessorCompilation>true</MultiProcessorCompilation>\r
       <FloatingPointModel>Fast</FloatingPointModel>\r
       <AdditionalIncludeDirectories>../;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
       <ExceptionHandling>Async</ExceptionHandling>\r
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\r
-      <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>\r
+      <EnableEnhancedInstructionSet>NotSet</EnableEnhancedInstructionSet>\r
       <RuntimeTypeInfo>true</RuntimeTypeInfo>\r
       <PrecompiledHeader>Use</PrecompiledHeader>\r
       <WarningLevel>Level4</WarningLevel>\r
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
       <MultiProcessorCompilation>true</MultiProcessorCompilation>\r
-      <PreprocessorDefinitions>TBB_USE_CAPTURED_EXCEPTION=0;NDEBUG;_VC80_UPGRADE=0x0710;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions>SFML_STATIC;BOOST_THREAD_VERSION=4;TBB_USE_CAPTURED_EXCEPTION=0;NDEBUG;_VC80_UPGRADE=0x0710;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
       <WholeProgramOptimization>false</WholeProgramOptimization>\r
       <TreatWarningAsError>true</TreatWarningAsError>\r
       <OmitFramePointers>true</OmitFramePointers>\r
index 1748fa29445491e9b4b1c77638079581fed9154d..496a555f5f5c7db3ad6aa979be640baf768c17ae 100644 (file)
@@ -785,7 +785,7 @@ public:
                }
        }
        
-       boost::unique_future<bool> send(core::const_frame frame) override
+       std::future<bool> send(core::const_frame frame) override
        {
                bool ready_for_frame = consumer_->ready_for_frame();
                
@@ -807,7 +807,7 @@ public:
                                key_only_consumer_->mark_dropped();
                }
                
-               return caspar::wrap_as_future(true); 
+               return make_ready_future(true);
        }
        
        std::wstring print() const override
index b96b4430c1c9665fe77ef43aeb1ebc5debfab90e..70ac4abd98052dfafa2af31464c6000f42ca0458 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <ItemGroup Label="ProjectConfigurations">\r
     <ProjectConfiguration Include="Debug|x64">\r
       <Configuration>Debug</Configuration>\r
     <CharacterSet>Unicode</CharacterSet>\r
     <WholeProgramOptimization>true</WholeProgramOptimization>\r
     <UseDebugLibraries>false</UseDebugLibraries>\r
+    <PlatformToolset>v120</PlatformToolset>\r
   </PropertyGroup>\r
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">\r
     <ConfigurationType>StaticLibrary</ConfigurationType>\r
     <CharacterSet>Unicode</CharacterSet>\r
     <UseDebugLibraries>true</UseDebugLibraries>\r
+    <PlatformToolset>v120</PlatformToolset>\r
   </PropertyGroup>\r
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
   <ImportGroup Label="ExtensionSettings">\r
@@ -61,7 +63,7 @@
       <BrowseInformation>true</BrowseInformation>\r
       <WarningLevel>Level4</WarningLevel>\r
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
-      <PreprocessorDefinitions>TBB_USE_DEBUG;TBB_USE_CAPTURED_EXCEPTION=0;TBB_USE_ASSERT=1;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions>SFML_STATIC;BOOST_THREAD_VERSION=4;TBB_USE_DEBUG;TBB_USE_CAPTURED_EXCEPTION=0;TBB_USE_ASSERT=1;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
       <TreatWarningAsError>true</TreatWarningAsError>\r
       <MultiProcessorCompilation>true</MultiProcessorCompilation>\r
       <FloatingPointModel>Fast</FloatingPointModel>\r
       <AdditionalIncludeDirectories>../;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
       <ExceptionHandling>Async</ExceptionHandling>\r
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\r
-      <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>\r
+      <EnableEnhancedInstructionSet>NotSet</EnableEnhancedInstructionSet>\r
       <RuntimeTypeInfo>true</RuntimeTypeInfo>\r
       <PrecompiledHeader>Use</PrecompiledHeader>\r
       <WarningLevel>Level4</WarningLevel>\r
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
       <MultiProcessorCompilation>true</MultiProcessorCompilation>\r
-      <PreprocessorDefinitions>TBB_USE_CAPTURED_EXCEPTION=0;NDEBUG;_VC80_UPGRADE=0x0710;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions>SFML_STATIC;BOOST_THREAD_VERSION=4;TBB_USE_CAPTURED_EXCEPTION=0;NDEBUG;_VC80_UPGRADE=0x0710;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
       <WholeProgramOptimization>false</WholeProgramOptimization>\r
       <TreatWarningAsError>true</TreatWarningAsError>\r
       <OmitFramePointers>true</OmitFramePointers>\r
index 2a623f82d188e9dda5ec2f8801b3b2dff42f7f89..64be5c78efb95755aa67fadddc295ad0363b7a99 100644 (file)
@@ -250,7 +250,7 @@ public:
                return video_decoder_ ? video_decoder_->file_frame_number() : 0;
        }
                
-       boost::unique_future<std::wstring> call(const std::vector<std::wstring>& params) override
+       std::future<std::wstring> call(const std::vector<std::wstring>& params) override
        {
                static const boost::wregex loop_exp(L"LOOP\\s*(?<VALUE>\\d?)?", boost::regex::icase);
                static const boost::wregex seek_exp(L"SEEK\\s+(?<VALUE>\\d+)", boost::regex::icase);
@@ -291,7 +291,7 @@ public:
                else
                        CASPAR_THROW_EXCEPTION(invalid_argument());
 
-               return async(launch::deferred, [=]{return result;});
+               return make_ready_future(std::move(result));
        }
                                
        std::wstring print() const override
index d2313b5b85e7293d5fcace610d4890de4a4c7709..a3ea49a6d0c37f33000eed6e67523f0cd6410e97 100644 (file)
@@ -127,7 +127,7 @@ struct frame_muxer::impl : boost::noncopyable
 
                if(!audio->data[0])             
                {
-                       boost::range::push_back(audio_stream_, core::audio_buffer(audio_cadence_.front(), 0));  
+                       boost::range::push_back(audio_stream_, core::audio_buffer(audio_cadence_.front() * format_desc_.audio_channels, 0));    
                }
                else
                {
@@ -156,9 +156,9 @@ struct frame_muxer::impl : boost::noncopyable
                switch(display_mode_)
                {
                case display_mode::duplicate:                                   
-                       return audio_stream_.size() >= static_cast<size_t>(audio_cadence_[0] + audio_cadence_[1 % audio_cadence_.size()]);
+                       return audio_stream_.size() >= static_cast<size_t>(audio_cadence_[0] + audio_cadence_[1 % audio_cadence_.size()]) * format_desc_.audio_channels;
                default:                                                                                
-                       return audio_stream_.size() >= static_cast<size_t>(audio_cadence_.front());
+                       return audio_stream_.size() >= static_cast<size_t>(audio_cadence_.front()) * format_desc_.audio_channels;
                }
        }
 
@@ -206,11 +206,21 @@ struct frame_muxer::impl : boost::noncopyable
                                }
                        case display_mode::duplicate:   
                                {
-                                       boost::range::push_back(frame1.audio_data(), pop_audio());
-
-                                       auto draw_frame = core::draw_frame(std::move(frame1));
-                                       frame_buffer_.push(draw_frame);
-                                       frame_buffer_.push(draw_frame);
+                                       //boost::range::push_back(frame1.audio_data(), pop_audio());
+
+                                       auto second_audio_frame = core::mutable_frame(
+                                                       std::vector<array<std::uint8_t>>(),
+                                                       pop_audio(),
+                                                       frame1.data_tag(),
+                                                       core::pixel_format_desc());
+                                       auto first_frame = core::draw_frame(std::move(frame1));
+                                       auto muted_first_frame = core::draw_frame(first_frame);
+                                       muted_first_frame.transform().audio_transform.volume = 0;
+                                       auto second_frame = core::draw_frame({ core::draw_frame(std::move(second_audio_frame)), muted_first_frame });
+
+                                       // Same video but different audio.
+                                       frame_buffer_.push(first_frame);
+                                       frame_buffer_.push(second_frame);
                                        break;
                                }
                        case display_mode::half:        
@@ -235,11 +245,11 @@ struct frame_muxer::impl : boost::noncopyable
 
        core::audio_buffer pop_audio()
        {
-               if(audio_stream_.size() < audio_cadence_.front())
+               if (audio_stream_.size() < audio_cadence_.front() * format_desc_.audio_channels)
                        CASPAR_THROW_EXCEPTION(out_of_range());
 
                auto begin = audio_stream_.begin();
-               auto end   = begin + audio_cadence_.front();
+               auto end   = begin + audio_cadence_.front() * format_desc_.audio_channels;
 
                core::audio_buffer samples(begin, end);
                audio_stream_.erase(begin, end);
index c8de982f8728169b18182cf9fd536ad6ed653b05..f484252b9fcefd581fd3364cf86b615cff8fe416 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <ItemGroup Label="ProjectConfigurations">\r
     <ProjectConfiguration Include="Debug|x64">\r
       <Configuration>Debug</Configuration>\r
     <CharacterSet>Unicode</CharacterSet>\r
     <WholeProgramOptimization>true</WholeProgramOptimization>\r
     <UseDebugLibraries>false</UseDebugLibraries>\r
+    <PlatformToolset>v120</PlatformToolset>\r
   </PropertyGroup>\r
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">\r
     <ConfigurationType>StaticLibrary</ConfigurationType>\r
     <CharacterSet>Unicode</CharacterSet>\r
     <UseDebugLibraries>true</UseDebugLibraries>\r
+    <PlatformToolset>v120</PlatformToolset>\r
   </PropertyGroup>\r
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
   <ImportGroup Label="ExtensionSettings">\r
@@ -61,7 +63,7 @@
       <BrowseInformation>true</BrowseInformation>\r
       <WarningLevel>Level4</WarningLevel>\r
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
-      <PreprocessorDefinitions>TBB_USE_DEBUG;TBB_USE_CAPTURED_EXCEPTION=0;TBB_USE_ASSERT=1;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions>SFML_STATIC;BOOST_THREAD_VERSION=4;TBB_USE_DEBUG;TBB_USE_CAPTURED_EXCEPTION=0;TBB_USE_ASSERT=1;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
       <TreatWarningAsError>true</TreatWarningAsError>\r
       <MultiProcessorCompilation>true</MultiProcessorCompilation>\r
       <FloatingPointModel>Fast</FloatingPointModel>\r
       <AdditionalIncludeDirectories>../;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
       <ExceptionHandling>Async</ExceptionHandling>\r
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\r
-      <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>\r
+      <EnableEnhancedInstructionSet>NotSet</EnableEnhancedInstructionSet>\r
       <RuntimeTypeInfo>true</RuntimeTypeInfo>\r
       <PrecompiledHeader>Use</PrecompiledHeader>\r
       <WarningLevel>Level4</WarningLevel>\r
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
       <MultiProcessorCompilation>true</MultiProcessorCompilation>\r
-      <PreprocessorDefinitions>TBB_USE_CAPTURED_EXCEPTION=0;NDEBUG;_VC80_UPGRADE=0x0710;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions>SFML_STATIC;BOOST_THREAD_VERSION=4;TBB_USE_CAPTURED_EXCEPTION=0;NDEBUG;_VC80_UPGRADE=0x0710;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
       <WholeProgramOptimization>false</WholeProgramOptimization>\r
       <TreatWarningAsError>true</TreatWarningAsError>\r
       <OmitFramePointers>true</OmitFramePointers>\r
index 2acb9da6be6e43bfe1d43fe407d675532c274624..83dfe39390ef65ef5f47e5f01666ddf1a2763111 100644 (file)
@@ -34,7 +34,9 @@
 #include <boost/algorithm/string.hpp>
 #include <boost/regex.hpp>
 #include <boost/property_tree/ptree.hpp>
-               
+
+#include <future>
+
 namespace caspar { namespace flash {
        
 struct cg_proxy::impl : boost::noncopyable
@@ -45,7 +47,7 @@ public:
                : flash_producer_(frame_producer)
        {}
        
-       boost::unique_future<std::wstring> add(int layer, std::wstring filename,  bool play_on_load, const std::wstring& label, const std::wstring& data)
+       std::future<std::wstring> add(int layer, std::wstring filename,  bool play_on_load, const std::wstring& label, const std::wstring& data)
        {
                if(filename.size() > 0 && filename[0] == L'/')
                        filename = filename.substr(1, filename.size()-1);
@@ -60,7 +62,7 @@ public:
                return flash_producer_->call(std::move(params));
        }
 
-       boost::unique_future<std::wstring> remove(int layer)
+       std::future<std::wstring> remove(int layer)
        {
                auto str = (boost::wformat(L"<invoke name=\"Delete\" returntype=\"xml\"><arguments><array><property id=\"0\"><number>%1%</number></property></array></arguments></invoke>") % layer).str();
                CASPAR_LOG(info) << flash_producer_->print() << " Invoking remove-command: " << str;
@@ -69,7 +71,7 @@ public:
                return flash_producer_->call(std::move(params));
        }
 
-       boost::unique_future<std::wstring> play(int layer)
+       std::future<std::wstring> play(int layer)
        {
                auto str = (boost::wformat(L"<invoke name=\"Play\" returntype=\"xml\"><arguments><array><property id=\"0\"><number>%1%</number></property></array></arguments></invoke>") % layer).str();
                CASPAR_LOG(info) << flash_producer_->print() << " Invoking play-command: " << str;
@@ -78,7 +80,7 @@ public:
                return flash_producer_->call(std::move(params));
        }
 
-       boost::unique_future<std::wstring> stop(int layer, unsigned int)
+       std::future<std::wstring> stop(int layer, unsigned int)
        {
                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();
                CASPAR_LOG(info) << flash_producer_->print() << " Invoking stop-command: " << str;
@@ -87,7 +89,7 @@ public:
                return flash_producer_->call(std::move(params));
        }
 
-       boost::unique_future<std::wstring> next(int layer)
+       std::future<std::wstring> next(int layer)
        {
                auto str = (boost::wformat(L"<invoke name=\"Next\" returntype=\"xml\"><arguments><array><property id=\"0\"><number>%1%</number></property></array></arguments></invoke>") % layer).str();
                CASPAR_LOG(info) << flash_producer_->print() << " Invoking next-command: " << str;
@@ -96,7 +98,7 @@ public:
                return flash_producer_->call(std::move(params));
        }
 
-       boost::unique_future<std::wstring> update(int layer, const std::wstring& data)
+       std::future<std::wstring> update(int layer, const std::wstring& data)
        {
                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();
                CASPAR_LOG(info) << flash_producer_->print() <<" Invoking update-command: " << str;
@@ -105,7 +107,7 @@ public:
                return flash_producer_->call(std::move(params));
        }
 
-       boost::unique_future<std::wstring> invoke(int layer, const std::wstring& label)
+       std::future<std::wstring> invoke(int layer, const std::wstring& label)
        {
                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();
                CASPAR_LOG(info) << flash_producer_->print() << " Invoking invoke-command: " << str;
@@ -114,7 +116,7 @@ public:
                return flash_producer_->call(std::move(params));
        }
 
-       boost::unique_future<std::wstring> description(int layer)
+       std::future<std::wstring> description(int layer)
        {
                auto str = (boost::wformat(L"<invoke name=\"GetDescription\" returntype=\"xml\"><arguments><array><property id=\"0\"><number>%1%</number></property></array></arguments></invoke>") % layer).str();
                CASPAR_LOG(info) << flash_producer_->print() << " Invoking description-command: " << str;
@@ -123,7 +125,7 @@ public:
                return flash_producer_->call(std::move(params));
        }
 
-       boost::unique_future<std::wstring> template_host_info()
+       std::future<std::wstring> template_host_info()
        {
                auto str = (boost::wformat(L"<invoke name=\"GetInfo\" returntype=\"xml\"><arguments></arguments></invoke>")).str();
                CASPAR_LOG(info) << flash_producer_->print() << " Invoking info-command: " << str;
@@ -135,21 +137,21 @@ public:
        std::wstring timed_invoke(int layer, const std::wstring& label)
        {
                auto result = invoke(layer, label);
-               if(result.timed_wait(boost::posix_time::seconds(2)))
+               if(result.wait_for(std::chrono::seconds(2)) == std::future_status::ready)
                        return result.get();
                return L"";
        }
        std::wstring timed_description(int layer)
        {
                auto result = description(layer);
-               if(result.timed_wait(boost::posix_time::seconds(2)))
+               if (result.wait_for(std::chrono::seconds(2)) == std::future_status::ready)
                        return result.get();
                return L"";
        }
        std::wstring timed_template_host_info()
        {
                auto result = template_host_info();
-               if(result.timed_wait(boost::posix_time::seconds(2)))
+               if (result.wait_for(std::chrono::seconds(2)) == std::future_status::ready)
                        return result.get();
                return L"";
        }
@@ -162,7 +164,7 @@ public:
        
 cg_proxy create_cg_proxy(const spl::shared_ptr<core::video_channel>& video_channel, int render_layer)
 {      
-       auto flash_producer = video_channel->stage().foreground(render_layer).get();
+       auto flash_producer = spl::make_shared_ptr(video_channel->stage().foreground(render_layer).get());
 
        try
        {
@@ -192,7 +194,7 @@ spl::shared_ptr<core::frame_producer> create_cg_producer_and_autoplay_file(
                return core::frame_producer::empty();
                
        boost::filesystem::path path(filename);
-       path = boost::filesystem3::complete(path);
+       path = boost::filesystem::complete(path);
        auto filename2 = path.wstring();
 
        auto flash_producer = flash::create_producer(frame_factory, format_desc, boost::assign::list_of<std::wstring>());       
index 9cc18f47fe4e6f77fc9c1d2ad866919e311e7cb5..2710ba243b0d1e11e71622f2814efcfaa87f0873 100644 (file)
@@ -401,7 +401,7 @@ public:
                return constraints_;
        }
                
-       boost::unique_future<std::wstring> call(const std::vector<std::wstring>& params) override
+       std::future<std::wstring> call(const std::vector<std::wstring>& params) override
        {
                auto param = boost::algorithm::join(params, L" ");
 
index 7a351c211544b6bef76753571593f07ebfa79634..db2608e19f5aa434f4c823f425c4209f0e0b207e 100644 (file)
@@ -82,7 +82,7 @@ public:
        {
        }
        
-       boost::unique_future<bool> send(core::const_frame frame) override
+       std::future<bool> send(core::const_frame frame) override
        {
                auto filename = filename_;
 
@@ -109,7 +109,7 @@ public:
                });
                async.detach();
 
-               return wrap_as_future(false);
+               return make_ready_future(false);
        }
 
        std::wstring print() const override
index b5f541c3cbc94e659bc2c72c7cdc988489c7767d..d74ed440fbb4baf45b7c5875dabb47b1748b25b4 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <ItemGroup Label="ProjectConfigurations">\r
     <ProjectConfiguration Include="Debug|x64">\r
       <Configuration>Debug</Configuration>\r
     <CharacterSet>Unicode</CharacterSet>\r
     <WholeProgramOptimization>true</WholeProgramOptimization>\r
     <UseDebugLibraries>false</UseDebugLibraries>\r
+    <PlatformToolset>v120</PlatformToolset>\r
   </PropertyGroup>\r
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">\r
     <ConfigurationType>StaticLibrary</ConfigurationType>\r
     <CharacterSet>Unicode</CharacterSet>\r
     <UseDebugLibraries>true</UseDebugLibraries>\r
+    <PlatformToolset>v120</PlatformToolset>\r
   </PropertyGroup>\r
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
   <ImportGroup Label="ExtensionSettings">\r
@@ -61,7 +63,7 @@
       <BrowseInformation>true</BrowseInformation>\r
       <WarningLevel>Level4</WarningLevel>\r
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
-      <PreprocessorDefinitions>TBB_USE_DEBUG;_SCL_SECURE_NO_WARNINGS;TBB_USE_CAPTURED_EXCEPTION=0;TBB_USE_ASSERT=1;_DEBUG;FREEIMAGE_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions>SFML_STATIC;BOOST_THREAD_VERSION=4;TBB_USE_DEBUG;_SCL_SECURE_NO_WARNINGS;TBB_USE_CAPTURED_EXCEPTION=0;TBB_USE_ASSERT=1;_DEBUG;FREEIMAGE_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
       <TreatWarningAsError>true</TreatWarningAsError>\r
       <MultiProcessorCompilation>true</MultiProcessorCompilation>\r
       <FloatingPointModel>Fast</FloatingPointModel>\r
       <AdditionalIncludeDirectories>../;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
       <ExceptionHandling>Async</ExceptionHandling>\r
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\r
-      <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>\r
+      <EnableEnhancedInstructionSet>NotSet</EnableEnhancedInstructionSet>\r
       <RuntimeTypeInfo>true</RuntimeTypeInfo>\r
       <PrecompiledHeader>NotUsing</PrecompiledHeader>\r
       <WarningLevel>Level4</WarningLevel>\r
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
       <MultiProcessorCompilation>true</MultiProcessorCompilation>\r
-      <PreprocessorDefinitions>_SCL_SECURE_NO_WARNINGS;TBB_USE_CAPTURED_EXCEPTION=0;NDEBUG;FREEIMAGE_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions>SFML_STATIC;BOOST_THREAD_VERSION=4;_SCL_SECURE_NO_WARNINGS;TBB_USE_CAPTURED_EXCEPTION=0;NDEBUG;FREEIMAGE_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
       <WholeProgramOptimization>false</WholeProgramOptimization>\r
       <TreatWarningAsError>true</TreatWarningAsError>\r
       <OmitFramePointers>true</OmitFramePointers>\r
index 746a5cd7a7dde977ffab234bd62f71b7b4ce9655..ed64be1c62c7c181d7416beb7640a58714c0bc47 100644 (file)
@@ -182,7 +182,7 @@ spl::shared_ptr<core::frame_producer> create_producer(const spl::shared_ptr<core
                        return core::frame_producer::empty();
 
                auto dir = boost::filesystem::path(env::media_folder() + params[1]).parent_path();
-               auto basename = boost::filesystem3::basename(params[1]);
+               auto basename = boost::filesystem::basename(params[1]);
                std::set<std::wstring> files;
                boost::filesystem::directory_iterator end;
 
index fc2b4e5360507b83ebeffb63b4418d8dcd69982c..5b6fa2dd272100c056d81ff37743bc517f06b963 100644 (file)
@@ -23,6 +23,7 @@
 
 #include <vector>
 #include <cstdint>
+#include <algorithm>
 
 namespace caspar { namespace image {
 
index d4fc9e8ff5aba8c646c1f31f0f10ada9110e9a38..91b755414c3c82f32c6e9e183ee79c55e8aac2b2 100644 (file)
@@ -177,7 +177,7 @@ public:
                });
        }
        
-       boost::unique_future<bool> send(core::const_frame frame) override
+       std::future<bool> send(core::const_frame frame) override
        {
                // Will only block if the default executor queue capacity of 512 is
                // exhausted, which should not happen
@@ -218,7 +218,7 @@ public:
                        perf_timer_.restart();
                });
 
-               return wrap_as_future(true);
+               return make_ready_future(true);
        }
        
        std::wstring print() const override
index c9121cf0550ad4d975b3881a344278d638d8ffeb..57c6a44129a6d8be54b13bdebfc1ff93cd4fc4eb 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <ItemGroup Label="ProjectConfigurations">\r
     <ProjectConfiguration Include="Debug|x64">\r
       <Configuration>Debug</Configuration>\r
     <CharacterSet>Unicode</CharacterSet>\r
     <WholeProgramOptimization>true</WholeProgramOptimization>\r
     <UseDebugLibraries>false</UseDebugLibraries>\r
+    <PlatformToolset>v120</PlatformToolset>\r
   </PropertyGroup>\r
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">\r
     <ConfigurationType>StaticLibrary</ConfigurationType>\r
     <CharacterSet>Unicode</CharacterSet>\r
     <UseDebugLibraries>true</UseDebugLibraries>\r
+    <PlatformToolset>v120</PlatformToolset>\r
   </PropertyGroup>\r
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
   <ImportGroup Label="ExtensionSettings">\r
@@ -61,7 +63,7 @@
       <BrowseInformation>true</BrowseInformation>\r
       <WarningLevel>Level4</WarningLevel>\r
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
-      <PreprocessorDefinitions>TBB_USE_DEBUG;TBB_USE_CAPTURED_EXCEPTION=0;TBB_USE_ASSERT=1;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions>SFML_STATIC;BOOST_THREAD_VERSION=4;TBB_USE_DEBUG;TBB_USE_CAPTURED_EXCEPTION=0;TBB_USE_ASSERT=1;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
       <TreatWarningAsError>true</TreatWarningAsError>\r
       <MultiProcessorCompilation>true</MultiProcessorCompilation>\r
       <FloatingPointModel>Fast</FloatingPointModel>\r
       <AdditionalIncludeDirectories>../;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
       <ExceptionHandling>Async</ExceptionHandling>\r
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\r
-      <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>\r
+      <EnableEnhancedInstructionSet>NotSet</EnableEnhancedInstructionSet>\r
       <RuntimeTypeInfo>true</RuntimeTypeInfo>\r
       <PrecompiledHeader>Use</PrecompiledHeader>\r
       <WarningLevel>Level4</WarningLevel>\r
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
       <MultiProcessorCompilation>true</MultiProcessorCompilation>\r
-      <PreprocessorDefinitions>TBB_USE_CAPTURED_EXCEPTION=0;NDEBUG;_VC80_UPGRADE=0x0710;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions>SFML_STATIC;BOOST_THREAD_VERSION=4;TBB_USE_CAPTURED_EXCEPTION=0;NDEBUG;_VC80_UPGRADE=0x0710;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
       <WholeProgramOptimization>false</WholeProgramOptimization>\r
       <TreatWarningAsError>true</TreatWarningAsError>\r
       <OmitFramePointers>true</OmitFramePointers>\r
index 912e4d7a62de3b275c13f47ed7a807589248379f..3cfb4a3fcff6d5cf0b01a9bff02c822ed57cf7ee 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <ItemGroup Label="ProjectConfigurations">
     <ProjectConfiguration Include="Debug|x64">
       <Configuration>Debug</Configuration>
     <Keyword>Win32Proj</Keyword>
     <RootNamespace>psd</RootNamespace>
     <ProjectName>psd</ProjectName>
- </PropertyGroup>
 </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
     <ConfigurationType>StaticLibrary</ConfigurationType>
     <UseDebugLibraries>true</UseDebugLibraries>
     <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v120</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
     <ConfigurationType>StaticLibrary</ConfigurationType>
     <UseDebugLibraries>false</UseDebugLibraries>
     <WholeProgramOptimization>true</WholeProgramOptimization>
     <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v120</PlatformToolset>
   </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
   <ImportGroup Label="ExtensionSettings">
@@ -87,7 +89,9 @@
       </PrecompiledHeader>
       <WarningLevel>Level3</WarningLevel>
       <Optimization>Disabled</Optimization>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>SFML_STATIC;BOOST_THREAD_VERSION=4;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <ExceptionHandling>Async</ExceptionHandling>
+      <FloatingPointModel>Fast</FloatingPointModel>
     </ClCompile>
     <Link>
       <SubSystem>Windows</SubSystem>
       <Optimization>MaxSpeed</Optimization>
       <FunctionLevelLinking>true</FunctionLevelLinking>
       <IntrinsicFunctions>true</IntrinsicFunctions>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>SFML_STATIC;BOOST_THREAD_VERSION=4;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
       <WholeProgramOptimization>false</WholeProgramOptimization>
       <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
       <OmitFramePointers>true</OmitFramePointers>
+      <ExceptionHandling>Async</ExceptionHandling>
+      <FloatingPointModel>Fast</FloatingPointModel>
     </ClCompile>
     <Link>
       <SubSystem>Windows</SubSystem>
     </Link>
     <Lib>
       <LinkTimeCodeGeneration>false</LinkTimeCodeGeneration>
-    </Lib>     
+    </Lib>
   </ItemDefinitionGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
index c8411fd8e21cdaad8d7b31b2f1a7198c8764801a..96d30889403666259be0f2086980acf4b5daf11c 100644 (file)
@@ -43,6 +43,8 @@
 #include <boost/algorithm/string.hpp>
 #include <boost/rational.hpp>
 
+#include <future>
+
 namespace caspar { namespace psd {
 
 void init()
index cb07b3bfee6c0d263896d038e7bc7e369059345f..9fc3c24f5ea05af47400a9ba47875548dc65bc4b 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <ItemGroup Label="ProjectConfigurations">\r
     <ProjectConfiguration Include="Debug|x64">\r
       <Configuration>Debug</Configuration>\r
     <CharacterSet>Unicode</CharacterSet>\r
     <WholeProgramOptimization>true</WholeProgramOptimization>\r
     <UseDebugLibraries>false</UseDebugLibraries>\r
+    <PlatformToolset>v120</PlatformToolset>\r
   </PropertyGroup>\r
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">\r
     <ConfigurationType>StaticLibrary</ConfigurationType>\r
     <CharacterSet>Unicode</CharacterSet>\r
     <UseDebugLibraries>true</UseDebugLibraries>\r
+    <PlatformToolset>v120</PlatformToolset>\r
   </PropertyGroup>\r
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
   <ImportGroup Label="ExtensionSettings">\r
@@ -69,7 +71,7 @@
       <BrowseInformation>true</BrowseInformation>\r
       <WarningLevel>Level4</WarningLevel>\r
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
-      <PreprocessorDefinitions>TBB_USE_DEBUG;_SCL_SECURE_NO_WARNINGS;TBB_USE_CAPTURED_EXCEPTION=0;TBB_USE_ASSERT=1;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions>SFML_STATIC;BOOST_THREAD_VERSION=4;TBB_USE_DEBUG;_SCL_SECURE_NO_WARNINGS;TBB_USE_CAPTURED_EXCEPTION=0;TBB_USE_ASSERT=1;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
       <TreatWarningAsError>true</TreatWarningAsError>\r
       <MultiProcessorCompilation>true</MultiProcessorCompilation>\r
       <FloatingPointModel>Fast</FloatingPointModel>\r
       <AdditionalIncludeDirectories>../;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
       <ExceptionHandling>Async</ExceptionHandling>\r
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\r
-      <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>\r
+      <EnableEnhancedInstructionSet>NotSet</EnableEnhancedInstructionSet>\r
       <RuntimeTypeInfo>true</RuntimeTypeInfo>\r
       <PrecompiledHeader>Use</PrecompiledHeader>\r
       <WarningLevel>Level4</WarningLevel>\r
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
       <MultiProcessorCompilation>true</MultiProcessorCompilation>\r
-      <PreprocessorDefinitions>_SCL_SECURE_NO_WARNINGS;TBB_USE_CAPTURED_EXCEPTION=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions>SFML_STATIC;BOOST_THREAD_VERSION=4;_SCL_SECURE_NO_WARNINGS;TBB_USE_CAPTURED_EXCEPTION=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
       <WholeProgramOptimization>false</WholeProgramOptimization>\r
       <TreatWarningAsError>true</TreatWarningAsError>\r
       <OmitFramePointers>true</OmitFramePointers>\r
index b6b6990418a303e18bcfe37f1f86d865911d31aa..78ddc7adfcc728b43f3cecfd85bbc19f46be620a 100644 (file)
@@ -34,6 +34,8 @@
 #include <common/prec_timer.h>
 #include <common/future.h>
 
+#include <windows.h>
+
 #include <ffmpeg/producer/filter/filter.h>
 
 #include <core/video_format.h>
@@ -236,11 +238,11 @@ public:
 
        void init()
        {
-               window_.Create(sf::VideoMode(screen_width_, screen_height_, 32), u8(L"Screen consumer " + channel_and_format()), config_.windowed ? sf::Style::Resize | sf::Style::Close : sf::Style::Fullscreen);
-               window_.ShowMouseCursor(config_.interactive);
-               window_.SetPosition(screen_x_, screen_y_);
-               window_.SetSize(screen_width_, screen_height_);
-               window_.SetActive();
+               window_.create(sf::VideoMode(screen_width_, screen_height_, 32), u8(L"Screen consumer " + channel_and_format()), config_.windowed ? sf::Style::Resize | sf::Style::Close : sf::Style::Fullscreen);
+               window_.setMouseCursorVisible(config_.interactive);
+               window_.setPosition(sf::Vector2i(screen_x_, screen_y_));
+               window_.setSize(sf::Vector2u(screen_width_, screen_height_));
+               window_.setActive();
                
                if(!GLEW_VERSION_2_1 && glewInit() != GLEW_OK)
                        CASPAR_THROW_EXCEPTION(gl::ogl_exception() << msg_info("Failed to initialize GLEW."));
@@ -311,35 +313,35 @@ public:
                                try
                                {
                                        sf::Event e;            
-                                       while(window_.GetEvent(e))
+                                       while(window_.pollEvent(e))
                                        {
-                                               if (e.Type == sf::Event::Resized)
+                                               if (e.type == sf::Event::Resized)
                                                        calculate_aspect();
-                                               else if (e.Type == sf::Event::Closed)
+                                               else if (e.type == sf::Event::Closed)
                                                        is_running_ = false;
                                                else if (config_.interactive && sink_)
                                                {
-                                                       switch (e.Type)
+                                                       switch (e.type)
                                                        {
                                                        case sf::Event::MouseMoved:
                                                                {
-                                                                       auto& mouse_move = e.MouseMove;
+                                                                       auto& mouse_move = e.mouseMove;
                                                                        sink_->on_interaction(spl::make_shared<core::mouse_move_event>(
                                                                                        1,
-                                                                                       static_cast<double>(mouse_move.X) / screen_width_,
-                                                                                       static_cast<double>(mouse_move.Y) / screen_height_));
+                                                                                       static_cast<double>(mouse_move.x) / screen_width_,
+                                                                                       static_cast<double>(mouse_move.y) / screen_height_));
                                                                }
                                                                break;
                                                        case sf::Event::MouseButtonPressed:
                                                        case sf::Event::MouseButtonReleased:
                                                                {
-                                                                       auto& mouse_button = e.MouseButton;
+                                                                       auto& mouse_button = e.mouseButton;
                                                                        sink_->on_interaction(spl::make_shared<core::mouse_button_event>(
                                                                                        1,
-                                                                                       static_cast<double>(mouse_button.X) / screen_width_,
-                                                                                       static_cast<double>(mouse_button.Y) / screen_height_,
-                                                                                       static_cast<int>(mouse_button.Button),
-                                                                                       e.Type == sf::Event::MouseButtonPressed));
+                                                                                       static_cast<double>(mouse_button.x) / screen_width_,
+                                                                                       static_cast<double>(mouse_button.y) / screen_height_,
+                                                                                       static_cast<int>(mouse_button.button),
+                                                                                       e.type == sf::Event::MouseButtonPressed));
                                                                }
                                                                break;
                                                        }
@@ -388,7 +390,7 @@ public:
        void wait_for_vblank_and_display()
        {
                try_sleep_almost_until_vblank();
-               window_.Display();
+               window_.display();
                // Make sure that the next tick measures the duration from this point in time.
                wait_timer_.tick(0.0);
        }
@@ -498,12 +500,12 @@ public:
        }
 
 
-       boost::unique_future<bool> send(core::const_frame frame)
+       std::future<bool> send(core::const_frame frame)
        {
                if(!frame_buffer_.try_push(frame))
                        graph_->set_tag("dropped-frame");
 
-               return wrap_as_future(is_running_.load());
+               return make_ready_future(is_running_.load());
        }
 
        std::wstring channel_and_format() const
@@ -520,8 +522,8 @@ public:
        {
                if(config_.windowed)
                {
-                       screen_height_ = window_.GetHeight();
-                       screen_width_ = window_.GetWidth();
+                       screen_height_ = window_.getSize().y;
+                       screen_width_ = window_.getSize().x;
                }
                
                GL(glViewport(0, 0, screen_width_, screen_height_));
@@ -597,7 +599,7 @@ public:
                consumer_.reset(new screen_consumer(config_, format_desc, channel_index, sink_));
        }
        
-       boost::unique_future<bool> send(core::const_frame frame) override
+       std::future<bool> send(core::const_frame frame) override
        {
                return consumer_->send(frame);
        }
index 6f6666b296a4914568d18a040b486af6c978ce56..467fada3401513824f66f937365ad55c6a568fa9 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <ItemGroup Label="ProjectConfigurations">\r
     <ProjectConfiguration Include="Debug|x64">\r
       <Configuration>Debug</Configuration>\r
     <CharacterSet>Unicode</CharacterSet>\r
     <WholeProgramOptimization>true</WholeProgramOptimization>\r
     <UseDebugLibraries>false</UseDebugLibraries>\r
+    <PlatformToolset>v120</PlatformToolset>\r
   </PropertyGroup>\r
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">\r
     <ConfigurationType>StaticLibrary</ConfigurationType>\r
     <CharacterSet>Unicode</CharacterSet>\r
     <UseDebugLibraries>true</UseDebugLibraries>\r
+    <PlatformToolset>v120</PlatformToolset>\r
   </PropertyGroup>\r
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
   <ImportGroup Label="ExtensionSettings">\r
@@ -69,7 +71,7 @@
       <BrowseInformation>true</BrowseInformation>\r
       <WarningLevel>Level4</WarningLevel>\r
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
-      <PreprocessorDefinitions>TBB_USE_DEBUG;_SCL_SECURE_NO_WARNINGS;TBB_USE_CAPTURED_EXCEPTION=0;TBB_USE_ASSERT=1;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions>SFML_STATIC;BOOST_THREAD_VERSION=4;TBB_USE_DEBUG;_SCL_SECURE_NO_WARNINGS;TBB_USE_CAPTURED_EXCEPTION=0;TBB_USE_ASSERT=1;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
       <TreatWarningAsError>true</TreatWarningAsError>\r
       <MultiProcessorCompilation>true</MultiProcessorCompilation>\r
       <FloatingPointModel>Fast</FloatingPointModel>\r
       <AdditionalIncludeDirectories>../;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
       <ExceptionHandling>Async</ExceptionHandling>\r
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\r
-      <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>\r
+      <EnableEnhancedInstructionSet>NotSet</EnableEnhancedInstructionSet>\r
       <RuntimeTypeInfo>true</RuntimeTypeInfo>\r
       <PrecompiledHeader>Use</PrecompiledHeader>\r
       <WarningLevel>Level4</WarningLevel>\r
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
       <MultiProcessorCompilation>true</MultiProcessorCompilation>\r
-      <PreprocessorDefinitions>_SCL_SECURE_NO_WARNINGS;TBB_USE_CAPTURED_EXCEPTION=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions>SFML_STATIC;BOOST_THREAD_VERSION=4;_SCL_SECURE_NO_WARNINGS;TBB_USE_CAPTURED_EXCEPTION=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
       <WholeProgramOptimization>false</WholeProgramOptimization>\r
       <TreatWarningAsError>true</TreatWarningAsError>\r
       <OmitFramePointers>true</OmitFramePointers>\r
index 27d0eae2161a8823e0b4629867766684bac476a7..7f2b1263d3c32d67c05ae0689ff5b477a240acbc 100644 (file)
@@ -66,6 +66,7 @@
 #include <memory>
 #include <cctype>
 #include <io.h>
+#include <future>
 
 #include <boost/date_time/posix_time/posix_time.hpp>
 #include <boost/lexical_cast.hpp>
@@ -370,7 +371,7 @@ bool CallCommand::DoExecute()
        {
                auto result = channel()->stage().call(layer_index(), parameters());
                
-               if(!result.timed_wait(boost::posix_time::seconds(2)))
+               if (result.wait_for(std::chrono::seconds(2)) != std::future_status::ready)
                        CASPAR_THROW_EXCEPTION(timed_out());
                                
                std::wstringstream replyString;
@@ -1470,7 +1471,7 @@ bool InfoCommand::DoExecute()
 {
        std::wstringstream replyString;
        
-       boost::property_tree::xml_writer_settings<wchar_t> w(' ', 3);
+       boost::property_tree::xml_writer_settings<std::wstring> w(' ', 3);
 
        try
        {
@@ -1501,7 +1502,7 @@ bool InfoCommand::DoExecute()
 
                        boost::property_tree::wptree info;
                        info.add_child(L"paths", caspar::env::properties().get_child(L"configuration.paths"));
-                       info.add(L"paths.initial-path", boost::filesystem3::initial_path().wstring() + L"\\");
+                       info.add(L"paths.initial-path", boost::filesystem::initial_path().wstring() + L"\\");
 
                        boost::property_tree::write_xml(replyString, info, w);
                }
index 2844be375f23077904b5250d2a291f92d9539251..d6ad32637fbbcdf1aaf727cde0a5af431beedcb6 100644 (file)
 
 #include "AMCPCommand.h"
 
-#include <boost/thread/future.hpp>
 #include <core/thumbnail_generator.h>
 
+#include <future>
+
 namespace caspar { namespace protocol {
        
 std::wstring ListMedia();
@@ -314,23 +315,23 @@ private:
 class KillCommand : public AMCPCommandBase<0> 
 {
 public:
-       KillCommand(IO::ClientInfoPtr client, boost::promise<bool>& shutdown_server_now) : AMCPCommandBase(client), shutdown_server_now_(&shutdown_server_now) {}
+       KillCommand(IO::ClientInfoPtr client, std::promise<bool>& shutdown_server_now) : AMCPCommandBase(client), shutdown_server_now_(&shutdown_server_now) {}
        std::wstring print() const { return L"KillCommand";}
        bool DoExecute();
 
 private:
-       boost::promise<bool>* shutdown_server_now_;
+       std::promise<bool>* shutdown_server_now_;
 };
 
 class RestartCommand : public AMCPCommandBase<0> 
 {
 public:
-       RestartCommand(IO::ClientInfoPtr client, boost::promise<bool>& shutdown_server_now) : AMCPCommandBase(client), shutdown_server_now_(&shutdown_server_now) {}
+       RestartCommand(IO::ClientInfoPtr client, std::promise<bool>& shutdown_server_now) : AMCPCommandBase(client), shutdown_server_now_(&shutdown_server_now) {}
        std::wstring print() const { return L"RestartCommand";}
        bool DoExecute();
 
 private:
-       boost::promise<bool>* shutdown_server_now_;
+       std::promise<bool>* shutdown_server_now_;
 };
 
 }      //namespace amcp
index d95fd9133626a081fce994fdc9ff5ddcefb0c061..cdb4c8eda0834c5b96dc179344eabcff848dd188 100644 (file)
@@ -33,6 +33,7 @@
 #include <string.h>
 #include <algorithm>
 #include <cctype>
+#include <future>
 
 #include <boost/algorithm/string/trim.hpp>
 #include <boost/algorithm/string/split.hpp>
@@ -53,10 +54,10 @@ private:
        std::vector<channel_context>                            channels_;
        std::vector<AMCPCommandQueue::ptr_type>         commandQueues_;
        std::shared_ptr<core::thumbnail_generator>      thumb_gen_;
-       boost::promise<bool>&                                           shutdown_server_now_;
+       std::promise<bool>&                                                     shutdown_server_now_;
 
 public:
-       impl(const std::vector<spl::shared_ptr<core::video_channel>>& channels, const std::shared_ptr<core::thumbnail_generator>& thumb_gen, boost::promise<bool>& shutdown_server_now) : thumb_gen_(thumb_gen), shutdown_server_now_(shutdown_server_now)
+       impl(const std::vector<spl::shared_ptr<core::video_channel>>& channels, const std::shared_ptr<core::thumbnail_generator>& thumb_gen, std::promise<bool>& shutdown_server_now) : thumb_gen_(thumb_gen), shutdown_server_now_(shutdown_server_now)
        {
                commandQueues_.push_back(std::make_shared<AMCPCommandQueue>());
 
@@ -388,7 +389,7 @@ private:
 };
 
 
-AMCPProtocolStrategy::AMCPProtocolStrategy(const std::vector<spl::shared_ptr<core::video_channel>>& channels, const std::shared_ptr<core::thumbnail_generator>& thumb_gen, boost::promise<bool>& shutdown_server_now) : impl_(spl::make_unique<impl>(channels, thumb_gen, shutdown_server_now)) {}
+AMCPProtocolStrategy::AMCPProtocolStrategy(const std::vector<spl::shared_ptr<core::video_channel>>& channels, const std::shared_ptr<core::thumbnail_generator>& thumb_gen, std::promise<bool>& shutdown_server_now) : impl_(spl::make_unique<impl>(channels, thumb_gen, shutdown_server_now)) {}
 AMCPProtocolStrategy::~AMCPProtocolStrategy() {}
 void AMCPProtocolStrategy::Parse(const std::wstring& msg, IO::ClientInfoPtr pClientInfo) { impl_->Parse(msg, pClientInfo); }
 
index e647473c1a687c47f576a60c32375046c3f95c94..b474369c87ec7d4598a270eb7b0120f5bdfb14fb 100644 (file)
@@ -29,9 +29,9 @@
 #include <common/memory.h>
 
 #include <boost/noncopyable.hpp>
-#include <boost/thread/future.hpp>
 
 #include <string>
+#include <future>
 
 namespace caspar { namespace protocol { namespace amcp {
 
@@ -41,7 +41,7 @@ public:
        AMCPProtocolStrategy(
                const std::vector<spl::shared_ptr<core::video_channel>>& channels, 
                const std::shared_ptr<core::thumbnail_generator>& thumb_gen,
-               boost::promise<bool>& shutdown_server_now);
+               std::promise<bool>& shutdown_server_now);
 
        virtual ~AMCPProtocolStrategy();
 
index 95b218d3f765a2ab595bdcd9e429b2561d8f8ebf..75209288d9508c4eb787fdaf1aa3aac4d91c59d2 100644 (file)
@@ -23,6 +23,7 @@
 \r
 #include <stdexcept>\r
 #include <sstream>\r
+#include <future>\r
 \r
 #include <boost/lexical_cast.hpp>\r
 \r
index 7379ae597eb0928e7517f2af063d8989b18bed12..6e2f871bcb239b922ed59b6fafe0b98719818da3 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <ItemGroup Label="ProjectConfigurations">\r
     <ProjectConfiguration Include="Debug|x64">\r
       <Configuration>Debug</Configuration>\r
     <ConfigurationType>StaticLibrary</ConfigurationType>\r
     <UseDebugLibraries>true</UseDebugLibraries>\r
     <CharacterSet>Unicode</CharacterSet>\r
+    <PlatformToolset>v120</PlatformToolset>\r
   </PropertyGroup>\r
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">\r
     <ConfigurationType>StaticLibrary</ConfigurationType>\r
     <UseDebugLibraries>false</UseDebugLibraries>\r
     <WholeProgramOptimization>true</WholeProgramOptimization>\r
     <CharacterSet>Unicode</CharacterSet>\r
+    <PlatformToolset>v120</PlatformToolset>\r
   </PropertyGroup>\r
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
   <ImportGroup Label="ExtensionSettings">\r
       <PrecompiledHeader>Use</PrecompiledHeader>\r
       <WarningLevel>Level4</WarningLevel>\r
       <Optimization>Disabled</Optimization>\r
-      <PreprocessorDefinitions>TBB_USE_CAPTURED_EXCEPTION=0;TBB_USE_ASSERT=1;TBB_USE_DEBUG;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions>SFML_STATIC;BOOST_THREAD_VERSION=4;TBB_USE_CAPTURED_EXCEPTION=0;TBB_USE_ASSERT=1;TBB_USE_DEBUG;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>\r
       <FloatingPointModel>Fast</FloatingPointModel>\r
       <MultiProcessorCompilation>true</MultiProcessorCompilation>\r
       <Optimization>MaxSpeed</Optimization>\r
       <FunctionLevelLinking>true</FunctionLevelLinking>\r
       <IntrinsicFunctions>true</IntrinsicFunctions>\r
-      <PreprocessorDefinitions>TBB_USE_CAPTURED_EXCEPTION=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions>SFML_STATIC;BOOST_THREAD_VERSION=4;TBB_USE_CAPTURED_EXCEPTION=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
       <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>\r
       <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>\r
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\r
       <ExceptionHandling>Async</ExceptionHandling>\r
       <ForcedIncludeFiles>common/compiler/vs/disable_silly_warnings.h</ForcedIncludeFiles>\r
       <TreatWarningAsError>true</TreatWarningAsError>\r
-      <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>\r
+      <EnableEnhancedInstructionSet>NotSet</EnableEnhancedInstructionSet>\r
       <WholeProgramOptimization>false</WholeProgramOptimization>\r
     </ClCompile>\r
     <Lib>\r
index 2905e8b97903b857d9d5b75c83608425764fba9b..c0c4cf035e5c6efb203918ec70857d079e974d63 100644 (file)
@@ -28,6 +28,7 @@
 #include <string>
 #include <set>
 #include <memory>
+#include <functional>
 
 #include <boost/asio.hpp>
 #include <boost/thread.hpp>
@@ -66,34 +67,50 @@ class connection : public spl::enable_shared_from_this<connection>
        {
                std::weak_ptr<connection> connection_;
        public:
-               explicit connection_holder(std::weak_ptr<connection> conn) : connection_(conn)
+               explicit connection_holder(std::weak_ptr<connection> conn) : connection_(std::move(conn))
                {}
 
                virtual void send(std::basic_string<char>&& data)
                {
                        auto conn = connection_.lock();
-                       conn->send(std::move(data));
+
+                       if (conn)
+                               conn->send(std::move(data));
                }
+
                virtual void disconnect()
                {
                        auto conn = connection_.lock();
-                       conn->disconnect();
+
+                       if (conn)
+                               conn->disconnect();
                }
+
                virtual std::wstring print() const
                {
                        auto conn = connection_.lock();
-                       return conn->print();
+
+                       if (conn)
+                               return conn->print();
+                       else
+                               return L"[destroyed-connection]";
                }
 
                virtual void add_lifecycle_bound_object(const std::wstring& key, const std::shared_ptr<void>& lifecycle_bound)
                {
                        auto conn = connection_.lock();
-                       return conn->add_lifecycle_bound_object(key, lifecycle_bound);
+
+                       if (conn)
+                               return conn->add_lifecycle_bound_object(key, lifecycle_bound);
                }
                virtual std::shared_ptr<void> remove_lifecycle_bound_object(const std::wstring& key)
                {
                        auto conn = connection_.lock();
-                       return conn->remove_lifecycle_bound_object(key);
+
+                       if (conn)
+                               return conn->remove_lifecycle_bound_object(key);
+                       else
+                               return std::shared_ptr<void>();
                }
        };
 
@@ -268,7 +285,7 @@ struct AsyncEventServer::implementation
        implementation(const protocol_strategy_factory<char>::ptr& protocol, unsigned short port)
                : acceptor_(service_, tcp::endpoint(tcp::v4(), port))
                , protocol_factory_(protocol)
-               , thread_(std::bind(&boost::asio::io_service::run, &service_))
+               , thread_([&] { service_.run(); })
        {
                start_accept();
        }
index 2d462a463cafacda19c02249c8e08b9e57ae807a..73bf52025909d2e141e5b7a058e5ea4d0a2639b9 100644 (file)
@@ -25,6 +25,9 @@
 
 #include "stdafx.h"
 
+#include <tbb/task_scheduler_init.h>
+#include <tbb/task_scheduler_observer.h>
+
 #ifdef _DEBUG
        #define _CRTDBG_MAP_ALLOC
        #include <stdlib.h>
@@ -58,9 +61,6 @@
 #include <common/os/windows/current_version.h>
 #include <common/os/windows/system_info.h>
 
-#include <tbb/task_scheduler_init.h>
-#include <tbb/task_scheduler_observer.h>
-
 #include <boost/property_tree/detail/file_parser_error.hpp>
 #include <boost/property_tree/xml_parser.hpp>
 #include <boost/foreach.hpp>
@@ -71,6 +71,8 @@
 #include <boost/thread/future.hpp>
 #include <boost/algorithm/string/case_conv.hpp>
 
+#include <future>
+
 #include <signal.h>
 
 using namespace caspar;
@@ -181,7 +183,7 @@ LONG WINAPI UserUnhandledExceptionFilter(EXCEPTION_POINTERS* info)
        return EXCEPTION_CONTINUE_EXECUTION;
 }
 
-void do_run(server& caspar_server, boost::promise<bool>& shutdown_server_now)
+void do_run(server& caspar_server, std::promise<bool>& shutdown_server_now)
 {
        // Create a dummy client which prints amcp responses to console.
        auto console_client = spl::make_shared<IO::ConsoleClientInfo>();
@@ -283,8 +285,8 @@ void do_run(server& caspar_server, boost::promise<bool>& shutdown_server_now)
 
 bool run()
 {
-       boost::promise<bool> shutdown_server_now;
-       boost::unique_future<bool> shutdown_server = shutdown_server_now.get_future();
+       std::promise<bool> shutdown_server_now;
+       std::future<bool> shutdown_server = shutdown_server_now.get_future();
 
        // Create server object which initializes channels, protocols and controllers.
        server caspar_server(shutdown_server_now);
@@ -385,7 +387,7 @@ int main(int argc, wchar_t* argv[])
                print_info();
                
                std::wstringstream str;
-               boost::property_tree::xml_writer_settings<wchar_t> w(' ', 3);
+               boost::property_tree::xml_writer_settings<std::wstring> w(' ', 3);
                boost::property_tree::write_xml(str, env::properties(), w);
                CASPAR_LOG(info) << L"casparcg.config:\n-----------------------------------------\n" << str.str().c_str() << L"-----------------------------------------";
                
index 40f74c0466ac1636a4eb5ff3b0a6101fd31e6b43..eed31a8296a07febb447f108e258cc87e179b1f0 100644 (file)
@@ -29,6 +29,7 @@
 #include <common/utf.h>
 #include <common/memory.h>
 #include <common/polling_filesystem_monitor.h>
+#include <common/diagnostics/graph.h>
 
 #include <core/video_channel.h>
 #include <core/video_format.h>
@@ -71,6 +72,8 @@
 #include <boost/property_tree/ptree.hpp>
 #include <boost/property_tree/xml_parser.hpp>
 
+#include <future>
+
 namespace caspar {
 
 using namespace core;
@@ -87,9 +90,9 @@ struct server::impl : boost::noncopyable
        std::vector<std::shared_ptr<void>>                                      predefined_osc_subscriptions_;
        std::vector<spl::shared_ptr<video_channel>>                     channels_;
        std::shared_ptr<thumbnail_generator>                            thumbnail_generator_;
-       boost::promise<bool>&                                                           shutdown_server_now_;
+       std::promise<bool>&                                                                     shutdown_server_now_;
 
-       explicit impl(boost::promise<bool>& shutdown_server_now)                
+       explicit impl(std::promise<bool>& shutdown_server_now)          
                : accelerator_(env::properties().get(L"configuration.accelerator", L"auto"))
                , osc_client_(io_service_manager_.service())
                , shutdown_server_now_(shutdown_server_now)
@@ -149,6 +152,7 @@ struct server::impl : boost::noncopyable
 
                image::uninit();
                ffmpeg::uninit();
+               diagnostics::shutdown();
        }
                                
        void setup_channels(const boost::property_tree::wptree& pt)
@@ -308,7 +312,7 @@ struct server::impl : boost::noncopyable
 
 };
 
-server::server(boost::promise<bool>& shutdown_server_now) : impl_(new impl(shutdown_server_now)){}
+server::server(std::promise<bool>& shutdown_server_now) : impl_(new impl(shutdown_server_now)){}
 
 const std::vector<spl::shared_ptr<video_channel>> server::channels() const
 {
index a658abc306246e9c3a686dd57cb4bdcb200e5c22..d579b5008f71dc9aa7f666af21badc24788436ee 100644 (file)
 #pragma once
 
 #include <common/memory.h>
+#include <common/future_fwd.h>
 
 #include <core/monitor/monitor.h>
 
 #include <boost/noncopyable.hpp>
-#include <boost/thread/future.hpp>
 
 #include <vector>
 
@@ -40,7 +40,7 @@ namespace core {
 class server /* final */ : public boost::noncopyable
 {
 public:
-       explicit server(boost::promise<bool>& shutdown_server_now);
+       explicit server(std::promise<bool>& shutdown_server_now);
        const std::vector<spl::shared_ptr<core::video_channel>> channels() const;
        std::shared_ptr<core::thumbnail_generator> get_thumbnail_generator() const;
 
index d38bb3f619d0891e88ed65678fe63597caca32ef..f20c23a2175202848df7b0ce5a60aaab109a086f 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <ItemGroup Label="ProjectConfigurations">\r
     <ProjectConfiguration Include="Debug|x64">\r
       <Configuration>Debug</Configuration>\r
     <ConfigurationType>Application</ConfigurationType>\r
     <UseDebugLibraries>true</UseDebugLibraries>\r
     <CharacterSet>Unicode</CharacterSet>\r
+    <PlatformToolset>v120</PlatformToolset>\r
   </PropertyGroup>\r
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">\r
     <ConfigurationType>Application</ConfigurationType>\r
     <UseDebugLibraries>false</UseDebugLibraries>\r
     <WholeProgramOptimization>true</WholeProgramOptimization>\r
     <CharacterSet>Unicode</CharacterSet>\r
+    <PlatformToolset>v120</PlatformToolset>\r
   </PropertyGroup>\r
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
   <ImportGroup Label="ExtensionSettings">\r
     <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)tmp\$(Configuration)\</IntDir>\r
     <IncludePath Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\dependencies64\boost\;..\dependencies64\ffmpeg\include\;..\dependencies64\glew\include;..\dependencies64\sfml\include\;..\dependencies64\tbb\include\;$(IncludePath)</IncludePath>\r
     <IncludePath Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\dependencies64\boost\;..\dependencies64\ffmpeg\include\;..\dependencies64\glew\include;..\dependencies64\sfml\include\;..\dependencies64\tbb\include\;$(IncludePath)</IncludePath>\r
-    <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\dependencies64\boost\stage\lib;..\dependencies64\ffmpeg\lib\;..\dependencies64\glew\lib;..\dependencies64\sfml\extlibs\lib;..\dependencies64\sfml\lib\;..\dependencies64\tbb\lib\;..\dependencies64\freeimage\lib\;..\dependencies64\openal\lib\;..\dependencies64\asmlib\;$(LibraryPath)</LibraryPath>\r
-    <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\dependencies64\boost\stage\lib;..\dependencies64\ffmpeg\lib\;..\dependencies64\glew\lib;..\dependencies64\sfml\lib\;..\dependencies64\tbb\lib\;..\dependencies64\freeimage\lib\;..\dependencies64\openal\lib\;..\dependencies64\asmlib\;..\dependencies64\freetype\objs\win32\vc2010;$(LibraryPath)</LibraryPath>\r
+    <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\dependencies64\boost\stage\lib;..\dependencies64\ffmpeg\lib\;..\dependencies64\glew\lib;..\dependencies64\freeimage\lib\;..\dependencies64\sfml\extlibs\lib;..\dependencies64\sfml\lib\;..\dependencies64\tbb\lib\;..\dependencies64\openal\lib\;..\dependencies64\freetype\objs\win32\vc2010;..\dependencies64\asmlib\;..\dependencies64\zlib\lib\;$(LibraryPath)</LibraryPath>\r
+    <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\dependencies64\boost\stage\lib;..\dependencies64\ffmpeg\lib\;..\dependencies64\glew\lib;..\dependencies64\sfml\lib\;..\dependencies64\tbb\lib\;..\dependencies64\freeimage\lib\;..\dependencies64\openal\lib\;..\dependencies64\asmlib\;..\dependencies64\sfml\extlibs\lib;..\dependencies64\freetype\objs\win32\vc2010;..\dependencies64\zlib\lib\;$(LibraryPath)</LibraryPath>\r
     <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)bin\$(Configuration)\</OutDir>\r
     <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)bin\$(Configuration)\</OutDir>\r
     <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionName)</TargetName>\r
       <BrowseInformation>true</BrowseInformation>\r
       <WarningLevel>Level4</WarningLevel>\r
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
-      <PreprocessorDefinitions>TBB_USE_CAPTURED_EXCEPTION=0;TBB_USE_ASSERT=1;TBB_USE_DEBUG;_DEBUG;_CRT_SECURE_NO_WARNINGS;COMPILE_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions>_WIN32_WINNT=0x0601;SFML_STATIC;BOOST_THREAD_VERSION=4;TBB_USE_CAPTURED_EXCEPTION=0;TBB_USE_ASSERT=1;TBB_USE_DEBUG;_DEBUG;_CRT_SECURE_NO_WARNINGS;COMPILE_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
       <TreatWarningAsError>true</TreatWarningAsError>\r
       <MultiProcessorCompilation>true</MultiProcessorCompilation>\r
       <FloatingPointModel>Fast</FloatingPointModel>\r
       <ForcedIncludeFiles>common/compiler/vs/disable_silly_warnings.h</ForcedIncludeFiles>\r
     </ClCompile>\r
     <Link>\r
-      <AdditionalDependencies>alibcof64.lib;freetype248_d.lib;sfml-system-d.lib;sfml-window-d.lib;sfml-graphics-d.lib;sfml-audio-d.lib;Winmm.lib;Ws2_32.lib;avformat.lib;avcodec.lib;avutil.lib;avfilter.lib;swscale.lib;swresample.lib;tbb.lib;OpenGL32.lib;FreeImaged.lib;glew32.lib;openal32.lib</AdditionalDependencies>\r
+      <AdditionalDependencies>alibcof64.lib;jpeg.lib;sndfile.lib;sfml-system-d-2.lib;sfml-window-d-2.lib;sfml-graphics-d-2.lib;Winmm.lib;Ws2_32.lib;avformat.lib;avcodec.lib;avutil.lib;avfilter.lib;swscale.lib;swresample.lib;tbb.lib;OpenGL32.lib;FreeImaged.lib;glew32.lib;openal32.lib;freetype.lib;zlibstat.lib</AdditionalDependencies>\r
       <Version>\r
       </Version>\r
       <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
@@ -195,13 +197,13 @@ copy "$(ProjectDir)casparcg_auto_restart.bat" "$(OutDir)"
       <AdditionalIncludeDirectories>../;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
       <ExceptionHandling>Async</ExceptionHandling>\r
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\r
-      <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>\r
+      <EnableEnhancedInstructionSet>NotSet</EnableEnhancedInstructionSet>\r
       <RuntimeTypeInfo>true</RuntimeTypeInfo>\r
       <PrecompiledHeader>Use</PrecompiledHeader>\r
       <WarningLevel>Level4</WarningLevel>\r
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
       <MultiProcessorCompilation>true</MultiProcessorCompilation>\r
-      <PreprocessorDefinitions>TBB_USE_CAPTURED_EXCEPTION=0;NDEBUG;COMPILE_RELEASE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions>_WIN32_WINNT=0x0601;SFML_STATIC;BOOST_THREAD_VERSION=4;TBB_USE_CAPTURED_EXCEPTION=0;NDEBUG;COMPILE_RELEASE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
       <WholeProgramOptimization>false</WholeProgramOptimization>\r
       <TreatWarningAsError>true</TreatWarningAsError>\r
       <OmitFramePointers>true</OmitFramePointers>\r
@@ -210,7 +212,7 @@ copy "$(ProjectDir)casparcg_auto_restart.bat" "$(OutDir)"
     </ClCompile>\r
     <Link>\r
       <OptimizeReferences>false</OptimizeReferences>\r
-      <AdditionalDependencies>alibcof64.lib;freetype250.lib;sfml-system.lib;sfml-window.lib;sfml-graphics.lib;Winmm.lib;Ws2_32.lib;avformat.lib;avcodec.lib;avutil.lib;avfilter.lib;swscale.lib;swresample.lib;tbb.lib;OpenGL32.lib;glew32.lib;openal32.lib;freeimage.lib</AdditionalDependencies>\r
+      <AdditionalDependencies>alibcof64.lib;jpeg.lib;sndfile.lib;sfml-system-2.lib;sfml-window-2.lib;sfml-graphics-2.lib;Winmm.lib;Ws2_32.lib;avformat.lib;avcodec.lib;avutil.lib;avfilter.lib;swscale.lib;swresample.lib;tbb.lib;OpenGL32.lib;glew32.lib;openal32.lib;FreeImage.lib;freetype.lib;zlibstat.lib</AdditionalDependencies>\r
       <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
       <GenerateDebugInformation>true</GenerateDebugInformation>\r
       <ProgramDatabaseFile>$(TargetDir)$(TargetName).pdb</ProgramDatabaseFile>\r
index 3888f88766f8ea0ad32e6f38639db2c911a78c7d..046988411cfe2eb22efa65375c83190943bd8bd7 100644 (file)
@@ -27,7 +27,7 @@ int _tmain(int argc, _TCHAR* argv[])
                        if(doc.has_timeline())
                        {
                                trace << L"<timeline>" << std::endl;
-                                       boost::property_tree::xml_writer_settings<wchar_t> w(' ', 3);
+                                       boost::property_tree::xml_writer_settings<std::wstring> w(' ', 3);
                                        boost::property_tree::write_xml(trace, doc.timeline(), w);
 
                                trace << L"</timeline>" << std::endl;
@@ -46,13 +46,13 @@ int _tmain(int argc, _TCHAR* argv[])
                                if(layer->is_text())
                                {
                                        trace << L"                     <text value='" << (*it)->text_data().get(L"EngineDict.Editor.Text", L"") << L"' />" << std::endl;
-                                       boost::property_tree::xml_writer_settings<wchar_t> w(' ', 3);
+                                       boost::property_tree::xml_writer_settings<std::wstring> w(' ', 3);
                                        boost::property_tree::write_xml(trace, (*it)->text_data(), w);
                                }
                                if(layer->has_timeline())
                                {
                                        trace << L"                     <timeline>" << std::endl;
-                                       boost::property_tree::xml_writer_settings<wchar_t> w(' ', 3);
+                                       boost::property_tree::xml_writer_settings<std::wstring> w(' ', 3);
                                        boost::property_tree::write_xml(trace, (*it)->timeline_data(), w);
                                        trace << L"                     </timeline>" << std::endl;
                                }
index 23b93ade6358c21cb7871ca88dc9b4b61974aac4..17c1bef1789caad3732eda9a390a0354384757a3 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <ItemGroup Label="ProjectConfigurations">
     <ProjectConfiguration Include="Debug|x64">
       <Configuration>Debug</Configuration>
     <ConfigurationType>Application</ConfigurationType>
     <UseDebugLibraries>true</UseDebugLibraries>
     <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v120</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
     <UseDebugLibraries>false</UseDebugLibraries>
     <WholeProgramOptimization>true</WholeProgramOptimization>
     <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v120</PlatformToolset>
   </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
   <ImportGroup Label="ExtensionSettings">
@@ -53,7 +55,9 @@
       </PrecompiledHeader>
       <WarningLevel>Level3</WarningLevel>
       <Optimization>Disabled</Optimization>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>SFML_STATIC;BOOST_THREAD_VERSION=4;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <ExceptionHandling>Async</ExceptionHandling>
+      <FloatingPointModel>Fast</FloatingPointModel>
     </ClCompile>
     <Link>
       <SubSystem>Console</SubSystem>
@@ -68,7 +72,9 @@
       <Optimization>MaxSpeed</Optimization>
       <FunctionLevelLinking>true</FunctionLevelLinking>
       <IntrinsicFunctions>true</IntrinsicFunctions>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>SFML_STATIC;BOOST_THREAD_VERSION=4;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <ExceptionHandling>Async</ExceptionHandling>
+      <FloatingPointModel>Fast</FloatingPointModel>
     </ClCompile>
     <Link>
       <SubSystem>Console</SubSystem>
index e37d2995191ce4b56f75c77759da4e2a18cf55d8..4667215f6fb3466bc7c4dda92b64e8886e2eac60 100644 (file)
@@ -68,7 +68,7 @@ TEST(Base64Test, InvalidInputCharacters)
        for (int i = 1; i < 256; ++i)
        {
                if (get_dictionary().find(static_cast<char>(i)) == get_dictionary().end()
-                               && !std::isspace(i)
+                               && !std::isspace(i, std::locale())
                                && i != '=')
                {
                        auto invalid = PREFIX + static_cast<char>(i);
index 8225f06ef60933492bc607efe16680b202864376..aa23fb30406585193df3a92e4d8b673daca1271a 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <ItemGroup Label="ProjectConfigurations">
     <ProjectConfiguration Include="Debug|x64">
       <Configuration>Debug</Configuration>
     <ConfigurationType>Application</ConfigurationType>
     <UseDebugLibraries>true</UseDebugLibraries>
     <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v120</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
     <UseDebugLibraries>false</UseDebugLibraries>
     <WholeProgramOptimization>true</WholeProgramOptimization>
     <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v120</PlatformToolset>
   </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
   <ImportGroup Label="ExtensionSettings">
@@ -97,8 +99,8 @@
     <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)tmp\unit-test\$(Configuration)\</IntDir>
     <IncludePath Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\dependencies64\boost\;..\dependencies64\ffmpeg\include\;..\dependencies64\glew\include;..\dependencies64\sfml\include\;..\dependencies64\tbb\include\;..\;..\dependencies64\gtest\include;$(IncludePath)</IncludePath>
     <IncludePath Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\dependencies64\boost\;..\dependencies64\ffmpeg\include\;..\dependencies64\glew\include;..\dependencies64\sfml\include\;..\dependencies64\tbb\include\;..\;..\dependencies64\gtest\include;$(IncludePath)</IncludePath>
-    <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\dependencies64\boost\stage\lib;..\dependencies64\ffmpeg\lib\;..\dependencies64\glew\lib;..\dependencies64\sfml\extlibs\lib;..\dependencies64\sfml\lib\;..\dependencies64\tbb\lib\;..\dependencies64\freeimage\lib\;..\dependencies64\openal\lib\;..\dependencies64\asmlib\;..\dependencies64\gtest\lib;$(LibraryPath)</LibraryPath>
-    <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\dependencies64\boost\stage\lib;..\dependencies64\ffmpeg\lib\;..\dependencies64\glew\lib;..\dependencies64\sfml\extlibs\lib;..\dependencies64\sfml\lib\;..\dependencies64\tbb\lib\;..\dependencies64\freeimage\lib\;..\dependencies64\openal\lib\;..\dependencies64\asmlib\;..\dependencies64\gtest\lib;..\dependencies64\freetype\objs\win32\vc2010;$(LibraryPath)</LibraryPath>
+    <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\dependencies64\boost\stage\lib;..\dependencies64\ffmpeg\lib\;..\dependencies64\glew\lib;..\dependencies64\sfml\extlibs\lib;..\dependencies64\sfml\lib\;..\dependencies64\tbb\lib\;..\dependencies64\freeimage\lib\;..\dependencies64\openal\lib\;..\dependencies64\asmlib\;..\dependencies64\gtest\lib;..\dependencies64\freetype\objs\win32\vc2010;..\dependencies64\zlib\lib\;$(LibraryPath)</LibraryPath>
+    <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\dependencies64\boost\stage\lib;..\dependencies64\ffmpeg\lib\;..\dependencies64\glew\lib;..\dependencies64\sfml\extlibs\lib;..\dependencies64\sfml\lib\;..\dependencies64\tbb\lib\;..\dependencies64\freeimage\lib\;..\dependencies64\openal\lib\;..\dependencies64\asmlib\;..\dependencies64\gtest\lib;..\dependencies64\freetype\objs\win32\vc2010;..\dependencies64\zlib\lib\;$(LibraryPath)</LibraryPath>
     <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)bin\unit-test\$(Configuration)\</OutDir>
     <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)bin\unit-test\$(Configuration)\</OutDir>
     <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectName)</TargetName>
       <BrowseInformation>true</BrowseInformation>
       <WarningLevel>Level4</WarningLevel>
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
-      <PreprocessorDefinitions>TBB_USE_CAPTURED_EXCEPTION=0;TBB_USE_ASSERT=1;TBB_USE_DEBUG;_DEBUG;_CRT_SECURE_NO_WARNINGS;COMPILE_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>SFML_STATIC;BOOST_THREAD_VERSION=4;TBB_USE_CAPTURED_EXCEPTION=0;TBB_USE_ASSERT=1;TBB_USE_DEBUG;_DEBUG;_CRT_SECURE_NO_WARNINGS;COMPILE_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <TreatWarningAsError>true</TreatWarningAsError>
       <MultiProcessorCompilation>true</MultiProcessorCompilation>
       <FloatingPointModel>Fast</FloatingPointModel>
       <ForcedIncludeFiles>common/compiler/vs/disable_silly_warnings.h</ForcedIncludeFiles>
     </ClCompile>
     <Link>
-      <AdditionalDependencies>alibcof64.lib;freetype248_d.lib;sfml-system-d.lib;sfml-window-d.lib;sfml-graphics-d.lib;sfml-audio-d.lib;Winmm.lib;Ws2_32.lib;user32.lib;gdi32.lib;avformat.lib;avcodec.lib;avutil.lib;avfilter.lib;swscale.lib;swresample.lib;tbb.lib;OpenGL32.lib;FreeImaged.lib;glew32.lib;openal32.lib;gtestd.lib;Advapi32.lib</AdditionalDependencies>
+      <AdditionalDependencies>alibcof64.lib;jpeg.lib;sndfile.lib;sfml-system-d-2.lib;sfml-window-d-2.lib;sfml-graphics-d-2.lib;sfml-audio-d-2.lib;Winmm.lib;Ws2_32.lib;user32.lib;gdi32.lib;avformat.lib;avcodec.lib;avutil.lib;avfilter.lib;swscale.lib;swresample.lib;tbb.lib;OpenGL32.lib;FreeImaged.lib;glew32.lib;openal32.lib;gtestd.lib;Advapi32.lib;freetype.lib;zlibstat.lib</AdditionalDependencies>
       <Version>
       </Version>
       <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
@@ -177,13 +179,13 @@ copy "$(SolutionDir)dependencies64\openal\bin\*.dll" "$(OutDir)"
       <AdditionalIncludeDirectories>../;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <ExceptionHandling>Async</ExceptionHandling>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
+      <EnableEnhancedInstructionSet>NotSet</EnableEnhancedInstructionSet>
       <RuntimeTypeInfo>true</RuntimeTypeInfo>
       <PrecompiledHeader>NotUsing</PrecompiledHeader>
       <WarningLevel>Level4</WarningLevel>
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
       <MultiProcessorCompilation>true</MultiProcessorCompilation>
-      <PreprocessorDefinitions>TBB_USE_CAPTURED_EXCEPTION=0;NDEBUG;COMPILE_RELEASE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>SFML_STATIC;BOOST_THREAD_VERSION=4;TBB_USE_CAPTURED_EXCEPTION=0;NDEBUG;COMPILE_RELEASE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <WholeProgramOptimization>false</WholeProgramOptimization>
       <TreatWarningAsError>true</TreatWarningAsError>
       <OmitFramePointers>true</OmitFramePointers>
@@ -192,7 +194,7 @@ copy "$(SolutionDir)dependencies64\openal\bin\*.dll" "$(OutDir)"
     </ClCompile>
     <Link>
       <OptimizeReferences>true</OptimizeReferences>
-      <AdditionalDependencies>alibcof64.lib;freetype250.lib;sfml-system.lib;sfml-window.lib;sfml-graphics.lib;Winmm.lib;Ws2_32.lib;user32.lib;gdi32.lib;avformat.lib;avcodec.lib;avutil.lib;avfilter.lib;swscale.lib;swresample.lib;tbb.lib;OpenGL32.lib;glew32.lib;openal32.lib;freeimage.lib;gtest.lib;Advapi32.lib</AdditionalDependencies>
+      <AdditionalDependencies>alibcof64.lib;jpeg.lib;sndfile.lib;sfml-system-2.lib;sfml-window-2.lib;sfml-graphics-2.lib;Winmm.lib;Ws2_32.lib;user32.lib;gdi32.lib;avformat.lib;avcodec.lib;avutil.lib;avfilter.lib;swscale.lib;swresample.lib;tbb.lib;OpenGL32.lib;glew32.lib;openal32.lib;freeimage.lib;gtest.lib;Advapi32.lib;freetype.lib;zlibstat.lib</AdditionalDependencies>
       <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <ProgramDatabaseFile>$(TargetDir)$(TargetName).pdb</ProgramDatabaseFile>