<?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
<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
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);
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:
{
}
- 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);
}
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);}
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;
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); }))
{
}
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);
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
{
{
}
- 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)
}
}
- 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);
}));
}
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)
{
{
}
- 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);
}
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);}
// 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
"} \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();
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(...)
{
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)
// 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;
}
}}}
};
};
-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
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."));
{
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();
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)
}
// 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()))
}, 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);
}, 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."));
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));
}
};
: 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();}
}}}
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);
}
\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
// 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)
*/
void set_capacity(size_type capacity)
{
- boost::mutex::scoped_lock lock (capacity_mutex_);
+ boost::unique_lock<boost::mutex> lock (capacity_mutex_);
if (capacity_ < capacity)
{
*/
size_type capacity() const
{
- boost::mutex::scoped_lock lock (capacity_mutex_);
+ boost::unique_lock<boost::mutex> lock (capacity_mutex_);
return capacity_;
}
*/
void set_capacity(size_type capacity)
{
- boost::mutex::scoped_lock lock (capacity_mutex_);
+ boost::unique_lock<boost::mutex> lock(capacity_mutex_);
if (capacity_ < capacity)
{
*/
size_type capacity() const
{
- boost::mutex::scoped_lock lock (capacity_mutex_);
+ boost::unique_lock<boost::mutex> lock (capacity_mutex_);
return capacity_;
}
<?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
<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
#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 {
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
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")
{
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);
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);
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)
}
}
- 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;
}
};
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;
}
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;
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);
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&);
context::show(value);
}
+void shutdown()
+{
+ context::shutdown();
+}
+
//namespace v2
//{
//
void register_graph(const spl::shared_ptr<graph>& graph);
void show_graphs(bool value);
+void shutdown();
}}
\ No newline at end of file
{
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);
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\\");
}
-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
#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>
#include <boost/assign/list_of.hpp>
#include <functional>
+#include <future>
namespace caspar {
}
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_));
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.
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))
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
#include <boost/filesystem.hpp>
#include <boost/noncopyable.hpp>
-#include <boost/thread/future.hpp>
#include "memory.h"
+#include "future_fwd.h"
namespace caspar {
* @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.
#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.
*/
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>();
}
/**
*
* @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();
}
*/
bool try_completion()
{
- boost::mutex::scoped_lock lock(mutex_);
+ boost::unique_lock<boost::mutex> lock(mutex_);
return try_completion_internal();
}
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())
{
catch (...)
{
CASPAR_LOG_CURRENT_EXCEPTION();
- promise_.set_exception(boost::current_exception());
+ promise_.set_exception(std::current_exception());
done_ = true;
}
}
catch (...)
{
CASPAR_LOG_CURRENT_EXCEPTION();
- promise_.set_exception(boost::current_exception());
+ promise_.set_exception(std::current_exception());
done_ = true;
return true;
private:
boost::mutex mutex_;
func_type func_;
- boost::promise<R> promise_;
+ std::promise<R> promise_;
bool done_;
};
* @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
#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);
#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();
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'?');
}
}
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()
}
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
#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>
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)
{
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();\
}}
-#if defined(_MSC_VER)
-#pragma warning (pop)
-#endif
\ No newline at end of file
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;
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:
scanning_thread_.join();
}
- virtual boost::unique_future<void> initial_files_processed()
+ virtual std::future<void> initial_files_processed()
{
return initial_scan_completion_.get_future();
}
#include <boost/noncopyable.hpp>
#include <boost/thread/mutex.hpp>
-#include <boost/thread/condition.hpp>
+#include <boost/thread/condition_variable.hpp>
namespace caspar {
{
mutable boost::mutex mutex_;
unsigned int permits_;
- boost::condition_variable permits_available_;
+ boost::condition_variable_any permits_available_;
public:
/**
* Constructor.
*/
void release()
{
- boost::mutex::scoped_lock lock(mutex_);
+ boost::unique_lock<boost::mutex> lock(mutex_);
++permits_;
*/
void release(unsigned int permits)
{
- boost::mutex::scoped_lock lock(mutex_);
+ boost::unique_lock<boost::mutex> lock(mutex_);
permits_ += permits;
*/
void acquire()
{
- boost::mutex::scoped_lock lock(mutex_);
+ boost::unique_lock<boost::mutex> lock(mutex_);
while (permits_ == 0u)
{
*/
void acquire(unsigned int permits)
{
- boost::mutex::scoped_lock lock(mutex_);
+ boost::unique_lock<boost::mutex> lock(mutex_);
auto num_acquired = 0u;
while (true)
*/
bool try_acquire()
{
- boost::mutex::scoped_lock lock(mutex_);
+ boost::unique_lock<boost::mutex> lock(mutex_);
if (permits_ == 0u)
return false;
*/
unsigned int permits() const
{
- boost::mutex::scoped_lock lock(mutex_);
+ boost::unique_lock<boost::mutex> lock(mutex_);
return permits_;
}
#include <boost/thread.hpp>
+#include <future>
+
namespace caspar { namespace core {
std::vector<const consumer_factory_t> g_factories;
}).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();}
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
{
}
- virtual boost::unique_future<bool> send(const_frame frame)
+ virtual std::future<bool> send(const_frame frame)
{
try
{
{
CASPAR_LOG_CURRENT_EXCEPTION();
CASPAR_LOG(error) << print() << " Failed to recover consumer.";
- return wrap_as_future(false);
+ return make_ready_future(false);
}
}
}
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()))
{
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";}
#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>
// 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
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();)
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
{
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
// Properties
- boost::unique_future<boost::property_tree::wptree> info() const;
+ std::future<boost::property_tree::wptree> info() const;
private:
struct impl;
#include "../frame/frame.h"
#include <boost/lexical_cast.hpp>
+#include <future>
+
namespace caspar { namespace core {
struct port::impl
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));
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();}
#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 {
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();
<?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
#include <common/except.h>
#include <common/array.h>
+#include <common/future.h>
#include <core/frame/frame_visitor.h>
#include <core/frame/pixel_format.h>
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_;
{
}
- 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)
{
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());
}
}
};
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(){}
#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>
// 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);
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;
#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>
}, 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());
}
};
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
// Properties
- boost::unique_future<boost::property_tree::wptree> info() const;
+ std::future<boost::property_tree::wptree> info() const;
private:
struct impl;
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());
}
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();}
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);}
// 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;
// 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;
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
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)
{
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
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);
}
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;
.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");
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();
#include <common/env.h>
#include <core/producer/frame_producer.h>
+#include <future>
+
#include "scene_producer.h"
namespace caspar { namespace core { namespace scene {
#include <tbb/parallel_invoke.h>
+#include <future>
+
namespace caspar { namespace core {
class separated_producer : public frame_producer_base
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);
#include <functional>
#include <map>
#include <vector>
+#include <future>
namespace caspar { namespace core {
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(...)
{
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([=]
{
}, 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([=]
{
}, task_priority::high_priority);
}
- boost::unique_future<void> clear_transforms(int index)
+ std::future<void> clear_transforms(int index)
{
return executor_.begin_invoke([=]
{
}, task_priority::high_priority);
}
- boost::unique_future<void> clear_transforms()
+ std::future<void> clear_transforms()
{
return executor_.begin_invoke([=]
{
}, 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([=]
{
}, task_priority::high_priority);
}
- boost::unique_future<void> pause(int index)
+ std::future<void> pause(int index)
{
return executor_.begin_invoke([=]
{
}, task_priority::high_priority);
}
- boost::unique_future<void> play(int index)
+ std::future<void> play(int index)
{
return executor_.begin_invoke([=]
{
}, task_priority::high_priority);
}
- boost::unique_future<void> stop(int index)
+ std::future<void> stop(int index)
{
return executor_.begin_invoke([=]
{
}, task_priority::high_priority);
}
- boost::unique_future<void> clear(int index)
+ std::future<void> clear(int index)
{
return executor_.begin_invoke([=]
{
}, task_priority::high_priority);
}
- boost::unique_future<void> clear()
+ std::future<void> clear()
{
return executor_.begin_invoke([=]
{
}, 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 = [=]
{
}, 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([=]
{
}, 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_;
}
}
- 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
{
}, 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([=]
{
}, 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));
}
};
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);}
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();
// 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;
namespace caspar { namespace core {
namespace text {
- using namespace boost::filesystem3;
+ using namespace boost::filesystem;
std::map<std::wstring, std::wstring> fonts;
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)
{}
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); }
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;
#include <tbb/parallel_invoke.h>
+#include <future>
+
namespace caspar { namespace core {
class transition_producer : public frame_producer_base
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);
}
#include <iostream>
#include <iterator>
#include <set>
+#include <future>
#include <boost/thread.hpp>
#include <boost/range/algorithm/transform.hpp>
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();
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();
{
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();
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,
<?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
<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
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
{
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);
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(...)
{
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_, [&]
{
};
if (enqueue_task())
- return wrap_as_future(true);
+ return make_ready_future(true);
send_completion_.set_task(enqueue_task);
});
}
- boost::unique_future<bool> send(core::const_frame frame) override
+ std::future<bool> send(core::const_frame frame) override
{
return consumer_->send(frame);
}
<?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
<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
}
}
- 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();
key_only_consumer_->mark_dropped();
}
- return caspar::wrap_as_future(true);
+ return make_ready_future(true);
}
std::wstring print() const override
<?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
<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
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);
else
CASPAR_THROW_EXCEPTION(invalid_argument());
- return async(launch::deferred, [=]{return result;});
+ return make_ready_future(std::move(result));
}
std::wstring print() const override
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
{
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;
}
}
}
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:
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);
<?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
<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
#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
: 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);
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;
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;
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;
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;
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;
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;
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;
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;
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"";
}
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
{
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>());
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" ");
{
}
- boost::unique_future<bool> send(core::const_frame frame) override
+ std::future<bool> send(core::const_frame frame) override
{
auto filename = filename_;
});
async.detach();
- return wrap_as_future(false);
+ return make_ready_future(false);
}
std::wstring print() const override
<?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
<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
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;
#include <vector>
#include <cstdint>
+#include <algorithm>
namespace caspar { namespace image {
});
}
- 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
perf_timer_.restart();
});
- return wrap_as_future(true);
+ return make_ready_future(true);
}
std::wstring print() const override
<?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
<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
<?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">
</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">
#include <boost/algorithm/string.hpp>
#include <boost/rational.hpp>
+#include <future>
+
namespace caspar { namespace psd {
void init()
<?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
<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
#include <common/prec_timer.h>
#include <common/future.h>
+#include <windows.h>
+
#include <ffmpeg/producer/filter/filter.h>
#include <core/video_format.h>
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."));
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;
}
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);
}
}
- 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
{
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_));
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);
}
<?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
<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
#include <memory>
#include <cctype>
#include <io.h>
+#include <future>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/lexical_cast.hpp>
{
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;
{
std::wstringstream replyString;
- boost::property_tree::xml_writer_settings<wchar_t> w(' ', 3);
+ boost::property_tree::xml_writer_settings<std::wstring> w(' ', 3);
try
{
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);
}
#include "AMCPCommand.h"
-#include <boost/thread/future.hpp>
#include <core/thumbnail_generator.h>
+#include <future>
+
namespace caspar { namespace protocol {
std::wstring ListMedia();
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
#include <string.h>
#include <algorithm>
#include <cctype>
+#include <future>
#include <boost/algorithm/string/trim.hpp>
#include <boost/algorithm/string/split.hpp>
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>());
};
-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); }
#include <common/memory.h>
#include <boost/noncopyable.hpp>
-#include <boost/thread/future.hpp>
#include <string>
+#include <future>
namespace caspar { namespace protocol { namespace amcp {
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();
\r
#include <stdexcept>\r
#include <sstream>\r
+#include <future>\r
\r
#include <boost/lexical_cast.hpp>\r
\r
<?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
#include <string>
#include <set>
#include <memory>
+#include <functional>
#include <boost/asio.hpp>
#include <boost/thread.hpp>
{
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>();
}
};
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();
}
#include "stdafx.h"
+#include <tbb/task_scheduler_init.h>
+#include <tbb/task_scheduler_observer.h>
+
#ifdef _DEBUG
#define _CRTDBG_MAP_ALLOC
#include <stdlib.h>
#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>
#include <boost/thread/future.hpp>
#include <boost/algorithm/string/case_conv.hpp>
+#include <future>
+
#include <signal.h>
using namespace caspar;
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>();
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);
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"-----------------------------------------";
#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>
#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/xml_parser.hpp>
+#include <future>
+
namespace caspar {
using namespace core;
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)
image::uninit();
ffmpeg::uninit();
+ diagnostics::shutdown();
}
void setup_channels(const boost::property_tree::wptree& pt)
};
-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
{
#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>
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;
<?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
<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
</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
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;
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;
}
<?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">
</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>
<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>
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);
<?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">
<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>
<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>
</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>