]> git.sesse.net Git - casparcg/commitdiff
2.1.0: -ogl project: Renamed to screen. -extracted gpu specific stuff into accelerato...
authorronag <ronag@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Sat, 4 Feb 2012 20:49:51 +0000 (20:49 +0000)
committerronag <ronag@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Sat, 4 Feb 2012 20:49:51 +0000 (20:49 +0000)
git-svn-id: https://casparcg.svn.sourceforge.net/svnroot/casparcg/server/branches/2.1.0@2244 362d55ac-95cf-4e76-9f9a-cbaa9c17b72d

49 files changed:
TODO.txt
accelerator/StdAfx.cpp [new file with mode: 0644]
accelerator/StdAfx.h [new file with mode: 0644]
accelerator/accelerator.vcxproj [new file with mode: 0644]
accelerator/accelerator.vcxproj.filters [new file with mode: 0644]
accelerator/image/blending_glsl.h [moved from core/mixer/gpu/image/blending_glsl.h with 100% similarity]
accelerator/image/image_kernel.cpp [moved from core/mixer/gpu/image/image_kernel.cpp with 93% similarity]
accelerator/image/image_kernel.h [moved from core/mixer/gpu/image/image_kernel.h with 68% similarity]
accelerator/image/image_mixer.cpp [moved from core/mixer/gpu/image/image_mixer.cpp with 68% similarity]
accelerator/image/image_mixer.h [moved from core/mixer/gpu/image/image_mixer.h with 70% similarity]
accelerator/image/image_shader.cpp [moved from core/mixer/gpu/image/image_shader.cpp with 95% similarity]
accelerator/image/image_shader.h [moved from core/mixer/gpu/image/image_shader.h with 83% similarity]
accelerator/ogl/context.cpp [moved from core/mixer/gpu/accelerator.cpp with 81% similarity]
accelerator/ogl/context.h [moved from core/mixer/gpu/accelerator.h with 89% similarity]
accelerator/ogl/device_buffer.cpp [moved from core/mixer/gpu/device_buffer.cpp with 88% similarity]
accelerator/ogl/device_buffer.h [moved from core/mixer/gpu/device_buffer.h with 85% similarity]
accelerator/ogl/host_buffer.cpp [moved from core/mixer/gpu/host_buffer.cpp with 88% similarity]
accelerator/ogl/host_buffer.h [moved from core/mixer/gpu/host_buffer.h with 85% similarity]
accelerator/ogl/shader.cpp [moved from core/mixer/gpu/shader.cpp with 95% similarity]
accelerator/ogl/shader.h [moved from core/mixer/gpu/shader.h with 90% similarity]
accelerator/ogl/write_frame.cpp [moved from core/mixer/gpu/write_frame.cpp with 74% similarity]
accelerator/ogl/write_frame.h [moved from core/mixer/gpu/write_frame.h with 72% similarity]
casparcg.sln
core/core.vcxproj
core/core.vcxproj.filters
core/mixer/audio/audio_mixer.cpp
core/mixer/image/image_mixer.h
core/mixer/mixer.cpp
core/mixer/mixer.h
core/producer/color/color_producer.cpp
core/video_channel.cpp
core/video_channel.h
modules/decklink/producer/decklink_producer.cpp
modules/ffmpeg/producer/muxer/frame_muxer.cpp
modules/ffmpeg/producer/util/util.cpp
modules/flash/producer/FlashAxContainer.cpp
modules/flash/producer/flash_producer.cpp
modules/image/producer/image_producer.cpp
modules/image/producer/image_scroll_producer.cpp
modules/reroute/producer/reroute_producer.cpp
modules/screen/consumer/screen_consumer.cpp [new file with mode: 0644]
modules/screen/consumer/screen_consumer.h [new file with mode: 0644]
modules/screen/screen.cpp [new file with mode: 0644]
modules/screen/screen.h [new file with mode: 0644]
modules/screen/screen.vcxproj [new file with mode: 0644]
modules/screen/screen.vcxproj.filters [new file with mode: 0644]
protocol/amcp/AMCPCommandsImpl.cpp
shell/server.cpp
shell/shell.vcxproj

index 3d09b499f153d05fbf6063f5f4dea0bf6d0a51dc..384a2f5bd57f10bf85bc54ba3fa8ada3bead74f4 100644 (file)
--- a/TODO.txt
+++ b/TODO.txt
@@ -1,7 +1,7 @@
 o Rewrite transform API\r
        * Current transforms api is both ugly and unspecified, e.g. what should happen if you have simultanous tweens o nthe same layer?\r
        \r
-o Factor out gpu specific stuff\r
+o Factor out ogl specific stuff\r
        * We want to have a cpu fallback.\r
        \r
 o Replace AMCP with new OSC based implemention (throw out protocol project)\r
diff --git a/accelerator/StdAfx.cpp b/accelerator/StdAfx.cpp
new file mode 100644 (file)
index 0000000..f2b946a
--- /dev/null
@@ -0,0 +1,22 @@
+/*\r
+* Copyright (c) 2011 Sveriges Television AB <info@casparcg.com>\r
+*\r
+* This file is part of CasparCG (www.casparcg.com).\r
+*\r
+* CasparCG is free software: you can redistribute it and/or modify\r
+* it under the terms of the GNU General Public License as published by\r
+* the Free Software Foundation, either version 3 of the License, or\r
+* (at your option) any later version.\r
+*\r
+* CasparCG is distributed in the hope that it will be useful,\r
+* but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+* GNU General Public License for more details.\r
+*\r
+* You should have received a copy of the GNU General Public License\r
+* along with CasparCG. If not, see <http://www.gnu.org/licenses/>.\r
+*\r
+* Author: Robert Nagy, ronag89@gmail.com\r
+*/\r
+\r
+#include "stdafx.h"
\ No newline at end of file
diff --git a/accelerator/StdAfx.h b/accelerator/StdAfx.h
new file mode 100644 (file)
index 0000000..92f9c39
--- /dev/null
@@ -0,0 +1,65 @@
+/*\r
+* Copyright (c) 2011 Sveriges Television AB <info@casparcg.com>\r
+*\r
+* This file is part of CasparCG (www.casparcg.com).\r
+*\r
+* CasparCG is free software: you can redistribute it and/or modify\r
+* it under the terms of the GNU General Public License as published by\r
+* the Free Software Foundation, either version 3 of the License, or\r
+* (at your option) any later version.\r
+*\r
+* CasparCG is distributed in the hope that it will be useful,\r
+* but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+* GNU General Public License for more details.\r
+*\r
+* You should have received a copy of the GNU General Public License\r
+* along with CasparCG. If not, see <http://www.gnu.org/licenses/>.\r
+*\r
+* Author: Robert Nagy, ronag89@gmail.com\r
+*/\r
+\r
+#pragma once\r
+\r
+#ifdef _DEBUG\r
+#include <crtdbg.h>\r
+#endif\r
+\r
+#define NOMINMAX\r
+#define WIN32_LEAN_AND_MEAN\r
+\r
+#include <GL/glew.h>\r
+\r
+#include <algorithm>\r
+#include <array>\r
+#include <functional>\r
+#include <deque>\r
+#include <map>\r
+#include <memory>\r
+#include <queue>\r
+#include <string>\r
+#include <vector>\r
+\r
+#include <tbb/atomic.h>\r
+#include <tbb/concurrent_queue.h>\r
+#include <tbb/concurrent_unordered_map.h>\r
+\r
+#include <boost/assign.hpp>\r
+#include <boost/circular_buffer.hpp>\r
+#include <boost/timer.hpp>\r
+#include <boost/filesystem.hpp>\r
+#include <boost/foreach.hpp>\r
+#include <boost/range.hpp>\r
+#include <boost/range/adaptors.hpp>\r
+#include <boost/range/algorithm.hpp>\r
+#include <boost/thread.hpp>\r
+#include <boost/property_tree/ptree.hpp>\r
+#include <boost/property_tree/xml_parser.hpp>\r
+\r
+#include <common/assert.h>\r
+#include <common/utf.h>\r
+#include <common/spl/memory.h>\r
+//#include "../common/concurrency/executor.h" // Can't include this due to MSVC lambda bug\r
+\r
+#include <common/log.h>\r
+#include <common/except.h>\r
diff --git a/accelerator/accelerator.vcxproj b/accelerator/accelerator.vcxproj
new file mode 100644 (file)
index 0000000..b8fb210
--- /dev/null
@@ -0,0 +1,180 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project DefaultTargets="Build" ToolsVersion="4.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="Release|x64">\r
+      <Configuration>Release</Configuration>\r
+      <Platform>x64</Platform>\r
+    </ProjectConfiguration>\r
+  </ItemGroup>\r
+  <PropertyGroup Label="Globals">\r
+    <ProjectGuid>{8493D01A-F642-454C-8C44-88B38E2A3EF8}</ProjectGuid>\r
+    <RootNamespace>Server</RootNamespace>\r
+    <Keyword>Win32Proj</Keyword>\r
+    <ProjectName>accelerator</ProjectName>\r
+  </PropertyGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">\r
+    <ConfigurationType>StaticLibrary</ConfigurationType>\r
+    <CharacterSet>Unicode</CharacterSet>\r
+    <UseDebugLibraries>true</UseDebugLibraries>\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
+  </PropertyGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
+  <ImportGroup Label="ExtensionSettings">\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />\r
+  </ImportGroup>\r
+  <PropertyGroup Label="UserMacros" />\r
+  <PropertyGroup>\r
+    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectDir)tmp\$(Configuration)\</IntDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectDir)tmp\$(Configuration)\</IntDir>\r
+    <IncludePath Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\;..\dependencies64\boost\;..\dependencies64\tbb\include\;..\dependencies64\sfml\include\;..\dependencies64\glew\include\;..\dependencies64\asmlib\;$(IncludePath)</IncludePath>\r
+    <IncludePath Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\;..\dependencies64\boost\;..\dependencies64\tbb\include\;..\dependencies64\sfml\include\;..\dependencies64\glew\include\;..\dependencies64\asmlib\;$(IncludePath)</IncludePath>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectDir)bin\$(Configuration)\</OutDir>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectDir)bin\$(Configuration)\</OutDir>\r
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectName)</TargetName>\r
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectName)</TargetName>\r
+  </PropertyGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">\r
+    <PreBuildEvent>\r
+      <Command>\r
+      </Command>\r
+    </PreBuildEvent>\r
+    <ClCompile>\r
+      <Optimization>Disabled</Optimization>\r
+      <AdditionalIncludeDirectories>../;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <MinimalRebuild>false</MinimalRebuild>\r
+      <ExceptionHandling>Async</ExceptionHandling>\r
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
+      <SmallerTypeCheck>false</SmallerTypeCheck>\r
+      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>\r
+      <EnableEnhancedInstructionSet>NotSet</EnableEnhancedInstructionSet>\r
+      <RuntimeTypeInfo>true</RuntimeTypeInfo>\r
+      <PrecompiledHeader>Use</PrecompiledHeader>\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
+      <TreatWarningAsError>true</TreatWarningAsError>\r
+      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r
+      <FloatingPointModel>Fast</FloatingPointModel>\r
+      <ForcedIncludeFiles>common/compiler/vs/disable_silly_warnings.h</ForcedIncludeFiles>\r
+    </ClCompile>\r
+    <PostBuildEvent>\r
+      <Command>\r
+      </Command>\r
+    </PostBuildEvent>\r
+    <Lib />\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">\r
+    <PreBuildEvent>\r
+      <Command>\r
+      </Command>\r
+    </PreBuildEvent>\r
+    <ClCompile>\r
+      <Optimization>MaxSpeed</Optimization>\r
+      <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>\r
+      <IntrinsicFunctions>true</IntrinsicFunctions>\r
+      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>\r
+      <AdditionalIncludeDirectories>../;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <ExceptionHandling>Async</ExceptionHandling>\r
+      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\r
+      <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</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
+      <WholeProgramOptimization>true</WholeProgramOptimization>\r
+      <TreatWarningAsError>true</TreatWarningAsError>\r
+      <OmitFramePointers>true</OmitFramePointers>\r
+      <FloatingPointModel>Fast</FloatingPointModel>\r
+      <ForcedIncludeFiles>common/compiler/vs/disable_silly_warnings.h</ForcedIncludeFiles>\r
+    </ClCompile>\r
+    <PostBuildEvent>\r
+      <Command>\r
+      </Command>\r
+    </PostBuildEvent>\r
+    <Lib>\r
+      <LinkTimeCodeGeneration>true</LinkTimeCodeGeneration>\r
+    </Lib>\r
+  </ItemDefinitionGroup>\r
+  <ItemGroup>\r
+    <ClInclude Include="image\blending_glsl.h" />\r
+    <ClInclude Include="image\image_kernel.h" />\r
+    <ClInclude Include="image\image_mixer.h" />\r
+    <ClInclude Include="image\image_shader.h" />\r
+    <ClInclude Include="ogl\context.h" />\r
+    <ClInclude Include="ogl\device_buffer.h" />\r
+    <ClInclude Include="ogl\host_buffer.h" />\r
+    <ClInclude Include="ogl\shader.h" />\r
+    <ClInclude Include="ogl\write_frame.h" />\r
+    <ClInclude Include="StdAfx.h" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ProjectReference Include="..\common\common.vcxproj">\r
+      <Project>{02308602-7fe0-4253-b96e-22134919f56a}</Project>\r
+    </ProjectReference>\r
+    <ProjectReference Include="..\core\core.vcxproj">\r
+      <Project>{79388c20-6499-4bf6-b8b9-d8c33d7d4ddd}</Project>\r
+    </ProjectReference>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ClCompile Include="image\image_kernel.cpp">\r
+      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">../StdAfx.h</PrecompiledHeaderFile>\r
+      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|x64'">../StdAfx.h</PrecompiledHeaderFile>\r
+    </ClCompile>\r
+    <ClCompile Include="image\image_mixer.cpp">\r
+      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">../StdAfx.h</PrecompiledHeaderFile>\r
+      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|x64'">../StdAfx.h</PrecompiledHeaderFile>\r
+    </ClCompile>\r
+    <ClCompile Include="image\image_shader.cpp">\r
+      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">../StdAfx.h</PrecompiledHeaderFile>\r
+      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|x64'">../StdAfx.h</PrecompiledHeaderFile>\r
+    </ClCompile>\r
+    <ClCompile Include="ogl\context.cpp">\r
+      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">../StdAfx.h</PrecompiledHeaderFile>\r
+      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|x64'">../StdAfx.h</PrecompiledHeaderFile>\r
+    </ClCompile>\r
+    <ClCompile Include="ogl\device_buffer.cpp">\r
+      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">../StdAfx.h</PrecompiledHeaderFile>\r
+      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|x64'">../StdAfx.h</PrecompiledHeaderFile>\r
+    </ClCompile>\r
+    <ClCompile Include="ogl\host_buffer.cpp">\r
+      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">../StdAfx.h</PrecompiledHeaderFile>\r
+      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|x64'">../StdAfx.h</PrecompiledHeaderFile>\r
+    </ClCompile>\r
+    <ClCompile Include="ogl\shader.cpp">\r
+      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">../StdAfx.h</PrecompiledHeaderFile>\r
+      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|x64'">../StdAfx.h</PrecompiledHeaderFile>\r
+    </ClCompile>\r
+    <ClCompile Include="ogl\write_frame.cpp">\r
+      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">../StdAfx.h</PrecompiledHeaderFile>\r
+      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|x64'">../StdAfx.h</PrecompiledHeaderFile>\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
+    </ClCompile>\r
+  </ItemGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
+  <ImportGroup Label="ExtensionTargets">\r
+  </ImportGroup>\r
+</Project>
\ No newline at end of file
diff --git a/accelerator/accelerator.vcxproj.filters b/accelerator/accelerator.vcxproj.filters
new file mode 100644 (file)
index 0000000..2c4e62c
--- /dev/null
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+  <ItemGroup>\r
+    <Filter Include="source">\r
+      <UniqueIdentifier>{34e95782-44c6-42ea-9eb3-ef56fa1f8068}</UniqueIdentifier>\r
+    </Filter>\r
+    <Filter Include="source\ogl">\r
+      <UniqueIdentifier>{dbb5f22a-c188-4ab8-af04-3ec2b12d2e27}</UniqueIdentifier>\r
+    </Filter>\r
+    <Filter Include="source\image">\r
+      <UniqueIdentifier>{1e686392-8f55-4919-8eee-026f3e8d2e9a}</UniqueIdentifier>\r
+    </Filter>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ClInclude Include="ogl\device_buffer.h">\r
+      <Filter>source\ogl</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="ogl\host_buffer.h">\r
+      <Filter>source\ogl</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="ogl\shader.h">\r
+      <Filter>source\ogl</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="ogl\write_frame.h">\r
+      <Filter>source\ogl</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="StdAfx.h" />\r
+    <ClInclude Include="image\blending_glsl.h">\r
+      <Filter>source\image</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="image\image_kernel.h">\r
+      <Filter>source\image</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="image\image_mixer.h">\r
+      <Filter>source\image</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="image\image_shader.h">\r
+      <Filter>source\image</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="ogl\context.h">\r
+      <Filter>source\ogl</Filter>\r
+    </ClInclude>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ClCompile Include="ogl\device_buffer.cpp">\r
+      <Filter>source\ogl</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="ogl\host_buffer.cpp">\r
+      <Filter>source\ogl</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="ogl\shader.cpp">\r
+      <Filter>source\ogl</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="ogl\write_frame.cpp">\r
+      <Filter>source\ogl</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="StdAfx.cpp" />\r
+    <ClCompile Include="image\image_kernel.cpp">\r
+      <Filter>source\image</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="image\image_mixer.cpp">\r
+      <Filter>source\image</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="image\image_shader.cpp">\r
+      <Filter>source\image</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="ogl\context.cpp">\r
+      <Filter>source\ogl</Filter>\r
+    </ClCompile>\r
+  </ItemGroup>\r
+</Project>
\ No newline at end of file
similarity index 93%
rename from core/mixer/gpu/image/image_kernel.cpp
rename to accelerator/image/image_kernel.cpp
index 57194aae4ff49cb9cc5ada5ca5f5ea3038a33f8b..179d6add43d7694b59e72b647be64ead4711c109 100644 (file)
 * Author: Robert Nagy, ronag89@gmail.com\r
 */\r
 \r
-#include "../../../stdafx.h"\r
+#include "../stdafx.h"\r
 \r
 #include "image_kernel.h"\r
 \r
 #include "image_shader.h"\r
 #include "blending_glsl.h"\r
 \r
-#include "../shader.h"\r
-#include "../device_buffer.h"\r
-#include "../accelerator.h"\r
+#include "../ogl/shader.h"\r
+#include "../ogl/device_buffer.h"\r
+#include "../ogl/context.h"\r
 \r
 #include <common/except.h>\r
 #include <common/gl/gl_check.h>\r
@@ -40,7 +40,7 @@
 \r
 #include <boost/noncopyable.hpp>\r
 \r
-namespace caspar { namespace core { namespace gpu {\r
+namespace caspar { namespace accelerator { namespace ogl {\r
        \r
 GLubyte upper_pattern[] = {\r
        0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00,\r
@@ -56,11 +56,11 @@ GLubyte lower_pattern[] = {
 \r
 struct image_kernel::impl : boost::noncopyable\r
 {      \r
-       spl::shared_ptr<accelerator>    ogl_;\r
+       spl::shared_ptr<context>        ogl_;\r
        spl::shared_ptr<shader>         shader_;\r
        bool                                    blend_modes_;\r
                                                        \r
-       impl(const spl::shared_ptr<accelerator>& ogl)\r
+       impl(const spl::shared_ptr<context>& ogl)\r
                : ogl_(ogl)\r
                , shader_(ogl_->invoke([&]{return get_image_shader(*ogl, blend_modes_);}))\r
        {\r
@@ -108,7 +108,7 @@ struct image_kernel::impl : boost::noncopyable
                // Setup blend_func\r
                \r
                if(params.transform.is_key)\r
-                       params.blend_mode = blend_mode::normal;\r
+                       params.blend_mode = core::blend_mode::normal;\r
 \r
                if(blend_modes_)\r
                {\r
@@ -226,7 +226,7 @@ struct image_kernel::impl : boost::noncopyable
        }\r
 };\r
 \r
-image_kernel::image_kernel(const spl::shared_ptr<accelerator>& ogl) : impl_(new impl(ogl)){}\r
+image_kernel::image_kernel(const spl::shared_ptr<context>& ogl) : impl_(new impl(ogl)){}\r
 void image_kernel::draw(draw_params&& params)\r
 {\r
        impl_->draw(std::move(params));\r
similarity index 68%
rename from core/mixer/gpu/image/image_kernel.h
rename to accelerator/image/image_kernel.h
index 649890f65742370529b844163030224672bf6d39..24dc2d7e36a02b08b0eed2b63758492f62c052f4 100644 (file)
@@ -21,7 +21,7 @@
 \r
 #pragma once\r
 \r
-#include "../../image/blend_modes.h"\r
+#include <core/mixer/image/blend_modes.h>\r
 \r
 #include <common/enum_class.h>\r
 #include <common/spl/memory.h>\r
@@ -31,7 +31,7 @@
 \r
 #include <boost/noncopyable.hpp>\r
 \r
-namespace caspar { namespace core { namespace gpu {\r
+namespace caspar { namespace accelerator { namespace ogl {\r
        \r
 struct keyer_def\r
 {\r
@@ -45,18 +45,18 @@ typedef enum_class<keyer_def> keyer;
 \r
 struct draw_params sealed\r
 {\r
-       pixel_format_desc                                                       pix_desc;\r
+       core::pixel_format_desc                                                         pix_desc;\r
        std::vector<spl::shared_ptr<class device_buffer>>       textures;\r
-       frame_transform                                                         transform;\r
-       blend_mode                                                                      blend_mode;\r
-       keyer                                                                           keyer;\r
-       std::shared_ptr<class device_buffer>            background;\r
-       std::shared_ptr<class device_buffer>            local_key;\r
-       std::shared_ptr<class device_buffer>            layer_key;\r
+       core::frame_transform                                                           transform;\r
+       core::blend_mode                                                                        blend_mode;\r
+       keyer                                                                                           keyer;\r
+       std::shared_ptr<class device_buffer>                            background;\r
+       std::shared_ptr<class device_buffer>                            local_key;\r
+       std::shared_ptr<class device_buffer>                            layer_key;\r
 \r
        draw_params() \r
-               : pix_desc(pixel_format::invalid)\r
-               , blend_mode(blend_mode::normal)\r
+               : pix_desc(core::pixel_format::invalid)\r
+               , blend_mode(core::blend_mode::normal)\r
                , keyer(keyer::linear)\r
        {\r
        }\r
@@ -65,7 +65,7 @@ struct draw_params sealed
 class image_kernel sealed : boost::noncopyable\r
 {\r
 public:\r
-       image_kernel(const spl::shared_ptr<class accelerator>& ogl);\r
+       image_kernel(const spl::shared_ptr<class context>& ogl);\r
        void draw(draw_params&& params);\r
 private:\r
        struct impl;\r
similarity index 68%
rename from core/mixer/gpu/image/image_mixer.cpp
rename to accelerator/image/image_mixer.cpp
index abafb2f1afa02f96dbb245e2a07a659c70c79b58..e1d29d0df43d66fdb5e57b1c3800f0af38590400 100644 (file)
 * Author: Robert Nagy, ronag89@gmail.com\r
 */\r
 \r
-#include "../../../stdafx.h"\r
+#include "../stdafx.h"\r
 \r
 #include "image_mixer.h"\r
 \r
 #include "image_kernel.h"\r
 \r
-#include "../write_frame.h"\r
-#include "../accelerator.h"\r
-#include "../host_buffer.h"\r
-#include "../device_buffer.h"\r
+#include "../ogl/write_frame.h"\r
+#include "../ogl/context.h"\r
+#include "../ogl/host_buffer.h"\r
+#include "../ogl/device_buffer.h"\r
 \r
 #include <common/gl/gl_check.h>\r
 #include <common/concurrency/async.h>\r
 \r
 using namespace boost::assign;\r
 \r
-namespace caspar { namespace core { namespace gpu {\r
+namespace caspar { namespace accelerator { namespace ogl {\r
        \r
 struct item\r
 {\r
-       pixel_format_desc                                                                                       pix_desc;\r
+       core::pixel_format_desc                                                                                         pix_desc;\r
        std::vector<boost::shared_future<spl::shared_ptr<device_buffer>>>       textures;\r
-       frame_transform                                                                                         transform;\r
+       core::frame_transform                                                                                           transform;\r
 \r
        item()\r
-               : pix_desc(pixel_format::invalid)\r
+               : pix_desc(core::pixel_format::invalid)\r
        {\r
        }\r
 };\r
 \r
-typedef std::pair<blend_mode, std::vector<item>> layer;\r
+typedef std::pair<core::blend_mode, std::vector<item>> layer;\r
 \r
 class image_renderer\r
 {\r
-       spl::shared_ptr<accelerator>                    ogl_;\r
+       spl::shared_ptr<context>        ogl_;\r
        image_kernel                                    kernel_;        \r
 public:\r
-       image_renderer(const spl::shared_ptr<accelerator>& ogl)\r
+       image_renderer(const spl::shared_ptr<context>& ogl)\r
                : ogl_(ogl)\r
                , kernel_(ogl_)\r
        {\r
        }\r
        \r
-       boost::unique_future<boost::iterator_range<const uint8_t*>> operator()(std::vector<layer> layers, const video_format_desc& format_desc)\r
+       boost::unique_future<boost::iterator_range<const uint8_t*>> operator()(std::vector<layer> layers, const core::video_format_desc& format_desc)\r
        {       \r
                boost::shared_future<spl::shared_ptr<host_buffer>> buffer = ogl_->begin_invoke([=]() mutable -> spl::shared_ptr<host_buffer>\r
                {\r
                        auto draw_buffer = create_mixer_buffer(4, format_desc);\r
 \r
-                       if(format_desc.field_mode != field_mode::progressive)\r
+                       if(format_desc.field_mode != core::field_mode::progressive)\r
                        {\r
                                auto upper = layers;\r
                                auto lower = std::move(layers);\r
@@ -90,13 +90,13 @@ public:
                                BOOST_FOREACH(auto& layer, upper)\r
                                {\r
                                        BOOST_FOREACH(auto& item, layer.second)\r
-                                               item.transform.field_mode = static_cast<field_mode>(item.transform.field_mode & field_mode::upper);\r
+                                               item.transform.field_mode = static_cast<core::field_mode>(item.transform.field_mode & core::field_mode::upper);\r
                                }\r
 \r
                                BOOST_FOREACH(auto& layer, lower)\r
                                {\r
                                        BOOST_FOREACH(auto& item, layer.second)\r
-                                               item.transform.field_mode = static_cast<field_mode>(item.transform.field_mode & field_mode::lower);\r
+                                               item.transform.field_mode = static_cast<core::field_mode>(item.transform.field_mode & core::field_mode::lower);\r
                                }\r
 \r
                                draw(std::move(upper), draw_buffer, format_desc);\r
@@ -121,9 +121,9 @@ public:
 \r
 private:\r
 \r
-       void draw(std::vector<layer>&&          layers, \r
+       void draw(std::vector<layer>&&                          layers, \r
                          spl::shared_ptr<device_buffer>&       draw_buffer, \r
-                         const video_format_desc& format_desc)\r
+                         const core::video_format_desc&        format_desc)\r
        {\r
                std::shared_ptr<device_buffer> layer_key_buffer;\r
 \r
@@ -131,12 +131,12 @@ private:
                        draw_layer(std::move(layer), draw_buffer, layer_key_buffer, format_desc);\r
        }\r
 \r
-       void draw_layer(layer&&                                                 layer, \r
+       void draw_layer(layer&&                                                         layer, \r
                                        spl::shared_ptr<device_buffer>&         draw_buffer,\r
-                                       std::shared_ptr<device_buffer>& layer_key_buffer,\r
-                                       const video_format_desc&                format_desc)\r
+                                       std::shared_ptr<device_buffer>&         layer_key_buffer,\r
+                                       const core::video_format_desc&          format_desc)\r
        {                               \r
-               boost::remove_erase_if(layer.second, [](const item& item){return item.transform.field_mode == field_mode::empty;});\r
+               boost::remove_erase_if(layer.second, [](const item& item){return item.transform.field_mode == core::field_mode::empty;});\r
 \r
                if(layer.second.empty())\r
                        return;\r
@@ -144,14 +144,14 @@ private:
                std::shared_ptr<device_buffer> local_key_buffer;\r
                std::shared_ptr<device_buffer> local_mix_buffer;\r
                                \r
-               if(layer.first != blend_mode::normal)\r
+               if(layer.first != core::blend_mode::normal)\r
                {\r
                        auto layer_draw_buffer = create_mixer_buffer(4, format_desc);\r
 \r
                        BOOST_FOREACH(auto& item, layer.second)\r
                                draw_item(std::move(item), layer_draw_buffer, layer_key_buffer, local_key_buffer, local_mix_buffer, format_desc);       \r
                \r
-                       draw_mixer_buffer(layer_draw_buffer, std::move(local_mix_buffer), blend_mode::normal);                                                  \r
+                       draw_mixer_buffer(layer_draw_buffer, std::move(local_mix_buffer), core::blend_mode::normal);                                                    \r
                        draw_mixer_buffer(draw_buffer, std::move(layer_draw_buffer), layer.first);\r
                }\r
                else // fast path\r
@@ -159,18 +159,18 @@ private:
                        BOOST_FOREACH(auto& item, layer.second)         \r
                                draw_item(std::move(item), draw_buffer, layer_key_buffer, local_key_buffer, local_mix_buffer, format_desc);             \r
                                        \r
-                       draw_mixer_buffer(draw_buffer, std::move(local_mix_buffer), blend_mode::normal);\r
+                       draw_mixer_buffer(draw_buffer, std::move(local_mix_buffer), core::blend_mode::normal);\r
                }                                       \r
 \r
                layer_key_buffer = std::move(local_key_buffer);\r
        }\r
 \r
        void draw_item(item&&                                                   item, \r
-                                  spl::shared_ptr<device_buffer>&                      draw_buffer, \r
+                                  spl::shared_ptr<device_buffer>&      draw_buffer, \r
                                   std::shared_ptr<device_buffer>&      layer_key_buffer, \r
                                   std::shared_ptr<device_buffer>&      local_key_buffer, \r
                                   std::shared_ptr<device_buffer>&      local_mix_buffer,\r
-                                  const video_format_desc&                     format_desc)\r
+                                  const core::video_format_desc&       format_desc)\r
        {                       \r
                draw_params draw_params;\r
                draw_params.pix_desc                            = std::move(item.pix_desc);\r
@@ -202,7 +202,7 @@ private:
                }\r
                else\r
                {\r
-                       draw_mixer_buffer(draw_buffer, std::move(local_mix_buffer), blend_mode::normal);\r
+                       draw_mixer_buffer(draw_buffer, std::move(local_mix_buffer), core::blend_mode::normal);\r
                        \r
                        draw_params.background                  = draw_buffer;\r
                        draw_params.local_key                   = std::move(local_key_buffer);\r
@@ -212,25 +212,25 @@ private:
                }       \r
        }\r
 \r
-       void draw_mixer_buffer(spl::shared_ptr<device_buffer>&                  draw_buffer, \r
+       void draw_mixer_buffer(spl::shared_ptr<device_buffer>&  draw_buffer, \r
                                                   std::shared_ptr<device_buffer>&& source_buffer, \r
-                                                  blend_mode                                           blend_mode = blend_mode::normal)\r
+                                                  core::blend_mode                                     blend_mode = core::blend_mode::normal)\r
        {\r
                if(!source_buffer)\r
                        return;\r
 \r
                draw_params draw_params;\r
-               draw_params.pix_desc.format             = pixel_format::bgra;\r
-               draw_params.pix_desc.planes             = list_of(pixel_format_desc::plane(source_buffer->width(), source_buffer->height(), 4));\r
+               draw_params.pix_desc.format             = core::pixel_format::bgra;\r
+               draw_params.pix_desc.planes             = list_of(core::pixel_format_desc::plane(source_buffer->width(), source_buffer->height(), 4));\r
                draw_params.textures                    = list_of(source_buffer);\r
-               draw_params.transform                   = frame_transform();\r
+               draw_params.transform                   = core::frame_transform();\r
                draw_params.blend_mode                  = blend_mode;\r
                draw_params.background                  = draw_buffer;\r
 \r
                kernel_.draw(std::move(draw_params));\r
        }\r
                        \r
-       spl::shared_ptr<device_buffer> create_mixer_buffer(int stride, const video_format_desc& format_desc)\r
+       spl::shared_ptr<device_buffer> create_mixer_buffer(int stride, const core::video_format_desc& format_desc)\r
        {\r
                auto buffer = ogl_->create_device_buffer(format_desc.width, format_desc.height, stride);\r
                ogl_->clear(*buffer);\r
@@ -240,29 +240,29 @@ private:
                \r
 struct image_mixer::impl : boost::noncopyable\r
 {      \r
-       spl::shared_ptr<accelerator>                    ogl_;\r
-       image_renderer                                  renderer_;\r
-       std::vector<frame_transform>    transform_stack_;\r
-       std::vector<layer>                              layers_; // layer/stream/items\r
+       spl::shared_ptr<context>                ogl_;\r
+       image_renderer                                          renderer_;\r
+       std::vector<core::frame_transform>      transform_stack_;\r
+       std::vector<layer>                                      layers_; // layer/stream/items\r
 public:\r
-       impl(const spl::shared_ptr<accelerator>& ogl) \r
+       impl(const spl::shared_ptr<context>& ogl) \r
                : ogl_(ogl)\r
                , renderer_(ogl)\r
                , transform_stack_(1)   \r
        {\r
        }\r
 \r
-       void begin_layer(blend_mode blend_mode)\r
+       void begin_layer(core::blend_mode blend_mode)\r
        {\r
                layers_.push_back(std::make_pair(blend_mode, std::vector<item>()));\r
        }\r
                \r
-       void push(frame_transform& transform)\r
+       void push(core::frame_transform& transform)\r
        {\r
                transform_stack_.push_back(transform_stack_.back()*transform);\r
        }\r
                \r
-       void visit(data_frame& frame2)\r
+       void visit(core::data_frame& frame2)\r
        {                       \r
                write_frame* frame = dynamic_cast<write_frame*>(&frame2);\r
                if(frame == nullptr)\r
@@ -293,24 +293,24 @@ public:
        {               \r
        }\r
        \r
-       boost::unique_future<boost::iterator_range<const uint8_t*>> render(const video_format_desc& format_desc)\r
+       boost::unique_future<boost::iterator_range<const uint8_t*>> render(const core::video_format_desc& format_desc)\r
        {\r
                return renderer_(std::move(layers_), format_desc);\r
        }\r
        \r
-       virtual spl::shared_ptr<gpu::write_frame> create_frame(const void* tag, const core::pixel_format_desc& desc)\r
+       virtual spl::shared_ptr<ogl::write_frame> create_frame(const void* tag, const core::pixel_format_desc& desc)\r
        {\r
-               return spl::make_shared<gpu::write_frame>(ogl_, tag, desc);\r
+               return spl::make_shared<ogl::write_frame>(ogl_, tag, desc);\r
        }\r
 };\r
 \r
-image_mixer::image_mixer(const spl::shared_ptr<accelerator>& ogl) : impl_(new impl(ogl)){}\r
-void image_mixer::push(frame_transform& transform){impl_->push(transform);}\r
-void image_mixer::visit(data_frame& frame){impl_->visit(frame);}\r
+image_mixer::image_mixer(const spl::shared_ptr<context>& ogl) : impl_(new impl(ogl)){}\r
+void image_mixer::push(core::frame_transform& transform){impl_->push(transform);}\r
+void image_mixer::visit(core::data_frame& frame){impl_->visit(frame);}\r
 void image_mixer::pop(){impl_->pop();}\r
-boost::unique_future<boost::iterator_range<const uint8_t*>> image_mixer::operator()(const video_format_desc& format_desc){return impl_->render(format_desc);}\r
-void image_mixer::begin_layer(blend_mode blend_mode){impl_->begin_layer(blend_mode);}\r
+boost::unique_future<boost::iterator_range<const uint8_t*>> image_mixer::operator()(const core::video_format_desc& format_desc){return impl_->render(format_desc);}\r
+void image_mixer::begin_layer(core::blend_mode blend_mode){impl_->begin_layer(blend_mode);}\r
 void image_mixer::end_layer(){impl_->end_layer();}\r
-spl::shared_ptr<core::write_frame> image_mixer::create_frame(const void* tag, const pixel_format_desc& desc) {return impl_->create_frame(tag, desc);}\r
+spl::shared_ptr<core::write_frame> image_mixer::create_frame(const void* tag, const core::pixel_format_desc& desc) {return impl_->create_frame(tag, desc);}\r
 \r
 }}}
\ No newline at end of file
similarity index 70%
rename from core/mixer/gpu/image/image_mixer.h
rename to accelerator/image/image_mixer.h
index 82d088699aa0badb03dc16c997df2c98da098239..d1e251f4846bffc215cf9849e653d41f7b8fc1c7 100644 (file)
 \r
 #pragma once\r
 \r
-#include "../../image/blend_modes.h"\r
-#include "../../image/image_mixer.h"\r
-\r
 #include <common/forward.h>\r
 #include <common/spl/memory.h>\r
 \r
+#include <core/mixer/image/blend_modes.h>\r
+#include <core/mixer/image/image_mixer.h>\r
+\r
 #include <core/frame/frame_visitor.h>\r
 \r
 FORWARD1(boost, template<typename> class unique_future);\r
 FORWARD2(caspar, core, struct write_frame);\r
 FORWARD2(caspar, core, struct pixel_format_desc);\r
+FORWARD2(caspar, core, struct video_format_desc);\r
+FORWARD2(caspar, core, struct data_Frame);\r
+FORWARD2(caspar, core, struct frame_transform);\r
 \r
-namespace caspar { namespace core { namespace gpu {\r
+namespace caspar { namespace accelerator { namespace ogl {\r
        \r
 class image_mixer sealed : public core::image_mixer\r
 {\r
 public:\r
-       image_mixer(const spl::shared_ptr<class accelerator>& ogl);\r
+       image_mixer(const spl::shared_ptr<class context>& ogl);\r
        \r
-       virtual void push(struct frame_transform& frame);\r
-       virtual void visit(struct data_frame& frame);\r
+       virtual void push(core::frame_transform& frame);\r
+       virtual void visit(core::data_frame& frame);\r
        virtual void pop();\r
 \r
-       void begin_layer(blend_mode blend_mode);\r
+       void begin_layer(core::blend_mode blend_mode);\r
        void end_layer();\r
                \r
        // NOTE: Content of return future is only valid while future is valid.\r
-       virtual boost::unique_future<boost::iterator_range<const uint8_t*>> operator()(const struct video_format_desc& format_desc) override;\r
+       virtual boost::unique_future<boost::iterator_range<const uint8_t*>> operator()(const core::video_format_desc& format_desc) override;\r
                \r
        virtual spl::shared_ptr<core::write_frame> create_frame(const void* tag, const core::pixel_format_desc& desc) override;\r
 private:\r
similarity index 95%
rename from core/mixer/gpu/image/image_shader.cpp
rename to accelerator/image/image_shader.cpp
index 50982400e0c6b1a65e9286ad05ed39db8b767e6a..d2d3cf6f0a6f7f7f7c2cb44e48b4eac227779735 100644 (file)
 * Author: Robert Nagy, ronag89@gmail.com\r
 */\r
 \r
-#include "../../../StdAfx.h"\r
+#include "../stdafx.h"\r
 \r
 #include "image_shader.h"\r
 \r
-#include "../../gpu/shader.h"\r
-#include "../../gpu/accelerator.h"\r
+#include "../ogl/shader.h"\r
+#include "../ogl/context.h"\r
 \r
 #include "blending_glsl.h"\r
 \r
@@ -33,7 +33,7 @@
 \r
 #include <tbb/mutex.h>\r
 \r
-namespace caspar { namespace core { namespace gpu {\r
+namespace caspar { namespace accelerator { namespace ogl {\r
 \r
 std::shared_ptr<shader> g_shader;\r
 tbb::mutex                             g_shader_mutex;\r
@@ -273,7 +273,7 @@ std::string get_fragment(bool blend_modes)
        "}                                                                                                                                                                      \n";\r
 }\r
 \r
-spl::shared_ptr<shader> get_image_shader(accelerator& ogl, bool& blend_modes)\r
+spl::shared_ptr<shader> get_image_shader(context& ogl, bool& blend_modes)\r
 {\r
        tbb::mutex::scoped_lock lock(g_shader_mutex);\r
 \r
similarity index 83%
rename from core/mixer/gpu/image/image_shader.h
rename to accelerator/image/image_shader.h
index f610d3bcb8e0cabecf6b01e5e35cad944ec9d88b..ea2e63a882af55df1a55bb792026778b5caf18f4 100644 (file)
 \r
 #include <common/spl/memory.h>\r
 \r
-namespace caspar { namespace core { namespace gpu {\r
+namespace caspar { namespace accelerator { namespace ogl {\r
 \r
 class shader;\r
-class accelerator;\r
+class context;\r
 \r
 struct texture_id\r
 {\r
@@ -42,7 +42,7 @@ struct texture_id
        };\r
 };\r
 \r
-spl::shared_ptr<shader> get_image_shader(accelerator& ogl, bool& blend_modes);\r
+spl::shared_ptr<shader> get_image_shader(context& ogl, bool& blend_modes);\r
 \r
 \r
 }}}
\ No newline at end of file
similarity index 81%
rename from core/mixer/gpu/accelerator.cpp
rename to accelerator/ogl/context.cpp
index 946b38036565575314aa37b3585baa41daf6fb87..dc38edf1a628ebf73da4d8aa21905089b84234f0 100644 (file)
@@ -21,9 +21,9 @@
 \r
 // TODO: Smart GC\r
 \r
-#include "../../stdafx.h"\r
+#include "../stdafx.h"\r
 \r
-#include "accelerator.h"\r
+#include "context.h"\r
 \r
 #include "shader.h"\r
 \r
 \r
 #include <gl/glew.h>\r
 \r
-namespace caspar { namespace core { namespace gpu {\r
+namespace caspar { namespace accelerator { namespace ogl {\r
 \r
-accelerator::accelerator() \r
-       : executor_(L"accelerator")\r
+context::context() \r
+       : executor_(L"context")\r
 {\r
        CASPAR_LOG(info) << L"Initializing OpenGL Device.";\r
                \r
@@ -61,7 +61,7 @@ accelerator::accelerator()
        });\r
 }\r
 \r
-accelerator::~accelerator()\r
+context::~context()\r
 {\r
        invoke([=]\r
        {\r
@@ -73,7 +73,7 @@ accelerator::~accelerator()
        });\r
 }\r
 \r
-spl::shared_ptr<device_buffer> accelerator::allocate_device_buffer(int width, int height, int stride)\r
+spl::shared_ptr<device_buffer> context::allocate_device_buffer(int width, int height, int stride)\r
 {\r
        std::shared_ptr<device_buffer> buffer;\r
        try\r
@@ -99,7 +99,7 @@ spl::shared_ptr<device_buffer> accelerator::allocate_device_buffer(int width, in
        return spl::make_shared_ptr(buffer);\r
 }\r
                                \r
-spl::shared_ptr<device_buffer> accelerator::create_device_buffer(int width, int height, int stride)\r
+spl::shared_ptr<device_buffer> context::create_device_buffer(int width, int height, int stride)\r
 {\r
        CASPAR_VERIFY(stride > 0 && stride < 5);\r
        CASPAR_VERIFY(width > 0 && height > 0);\r
@@ -116,7 +116,7 @@ spl::shared_ptr<device_buffer> accelerator::create_device_buffer(int width, int
        });\r
 }\r
 \r
-spl::shared_ptr<host_buffer> accelerator::allocate_host_buffer(int size, host_buffer::usage usage)\r
+spl::shared_ptr<host_buffer> context::allocate_host_buffer(int size, host_buffer::usage usage)\r
 {\r
        std::shared_ptr<host_buffer> buffer;\r
 \r
@@ -152,7 +152,7 @@ spl::shared_ptr<host_buffer> accelerator::allocate_host_buffer(int size, host_bu
        return spl::make_shared_ptr(buffer);\r
 }\r
        \r
-spl::shared_ptr<host_buffer> accelerator::create_host_buffer(int size, host_buffer::usage usage)\r
+spl::shared_ptr<host_buffer> context::create_host_buffer(int size, host_buffer::usage usage)\r
 {\r
        CASPAR_VERIFY(usage == host_buffer::usage::write_only || usage == host_buffer::usage::read_only);\r
        CASPAR_VERIFY(size > 0);\r
@@ -179,9 +179,9 @@ spl::shared_ptr<host_buffer> accelerator::create_host_buffer(int size, host_buff
        });\r
 }\r
 \r
-spl::shared_ptr<accelerator> accelerator::create()\r
+spl::shared_ptr<context> context::create()\r
 {\r
-       return spl::shared_ptr<accelerator>(new accelerator());\r
+       return spl::shared_ptr<context>(new context());\r
 }\r
 \r
 //template<typename T>\r
@@ -200,7 +200,7 @@ spl::shared_ptr<accelerator> accelerator::create()
 //     pool.usage_count = 0;\r
 //}\r
 \r
-boost::unique_future<void> accelerator::gc()\r
+boost::unique_future<void> context::gc()\r
 {      \r
        return begin_invoke([=]\r
        {\r
@@ -226,7 +226,7 @@ boost::unique_future<void> accelerator::gc()
        }, task_priority::high_priority);\r
 }\r
 \r
-std::wstring accelerator::version()\r
+std::wstring context::version()\r
 {      \r
        static std::wstring ver = L"Not found";\r
        try\r
@@ -239,24 +239,24 @@ std::wstring accelerator::version()
        return ver;\r
 }\r
 \r
-void accelerator::attach(device_buffer& texture)\r
+void context::attach(device_buffer& texture)\r
 {      \r
        glBindFramebuffer(GL_FRAMEBUFFER, fbo_);\r
        GL(glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0 + 0, GL_TEXTURE_2D, texture.id(), 0));\r
 }\r
 \r
-void accelerator::clear(device_buffer& texture)\r
+void context::clear(device_buffer& texture)\r
 {      \r
        attach(texture);\r
        GL(glClear(GL_COLOR_BUFFER_BIT));\r
 }\r
 \r
-void accelerator::use(shader& shader)\r
+void context::use(shader& shader)\r
 {      \r
        GL(glUseProgramObjectARB(shader.id())); \r
 }\r
 \r
-boost::unique_future<spl::shared_ptr<device_buffer>> accelerator::copy_async(spl::shared_ptr<host_buffer>& source, int width, int height, int stride)\r
+boost::unique_future<spl::shared_ptr<device_buffer>> context::copy_async(spl::shared_ptr<host_buffer>& source, int width, int height, int stride)\r
 {\r
        return executor_.begin_invoke([=]() -> spl::shared_ptr<device_buffer>\r
        {\r
similarity index 89%
rename from core/mixer/gpu/accelerator.h
rename to accelerator/ogl/context.h
index 4eacaa105a3de48c7fbe1fc043cd58779a4907c3..7faca54c32d01dadc59f3740bca0c0409d89d912 100644 (file)
@@ -40,7 +40,7 @@
 #include <array>\r
 #include <unordered_map>\r
 \r
-namespace caspar { namespace core { namespace gpu {\r
+namespace caspar { namespace accelerator { namespace ogl {\r
 \r
 class shader;\r
 \r
@@ -58,7 +58,7 @@ struct buffer_pool
        }\r
 };\r
 \r
-class accelerator : public std::enable_shared_from_this<accelerator>, boost::noncopyable\r
+class context : public std::enable_shared_from_this<context>, boost::noncopyable\r
 {      \r
        std::unique_ptr<sf::Context> context_;\r
        \r
@@ -69,10 +69,10 @@ class accelerator : public std::enable_shared_from_this<accelerator>, boost::non
 \r
        executor executor_;\r
                                \r
-       accelerator();\r
+       context();\r
 public:                \r
-       static spl::shared_ptr<accelerator> create();\r
-       ~accelerator();\r
+       static spl::shared_ptr<context> create();\r
+       ~context();\r
        \r
        void attach(device_buffer& texture);\r
        void clear(device_buffer& texture);             \r
similarity index 88%
rename from core/mixer/gpu/device_buffer.cpp
rename to accelerator/ogl/device_buffer.cpp
index 16b6bcd476e3540cd0de1ba81d676ad96f57f11c..589b572e71d3d250a06a0e08739b58aea9259473 100644 (file)
 * Author: Robert Nagy, ronag89@gmail.com\r
 */\r
 \r
-#include "../../stdafx.h"\r
+#include "../stdafx.h"\r
 \r
 #include "device_buffer.h"\r
-#include "accelerator.h"\r
+#include "context.h"\r
 \r
 #include <common/except.h>\r
 #include <common/gl/gl_check.h>\r
@@ -33,7 +33,7 @@
 \r
 #include <boost/thread/future.hpp>\r
 \r
-namespace caspar { namespace core { namespace gpu {\r
+namespace caspar { namespace accelerator { namespace ogl {\r
        \r
 static GLenum FORMAT[] = {0, GL_RED, GL_RG, GL_BGR, GL_BGRA};\r
 static GLenum INTERNAL_FORMAT[] = {0, GL_R8, GL_RG8, GL_RGB8, GL_RGBA8};       \r
@@ -48,14 +48,14 @@ static tbb::atomic<int> g_total_count;
 \r
 struct device_buffer::impl : boost::noncopyable\r
 {\r
-       std::weak_ptr<accelerator>      parent_;\r
+       std::weak_ptr<context>  parent_;\r
        GLuint                                          id_;\r
 \r
        const int width_;\r
        const int height_;\r
        const int stride_;\r
 public:\r
-       impl(std::weak_ptr<accelerator> parent, int width, int height, int stride) \r
+       impl(std::weak_ptr<context> parent, int width, int height, int stride) \r
                : parent_(parent)\r
                , width_(width)\r
                , height_(height)\r
@@ -138,7 +138,7 @@ public:
        }\r
 };\r
 \r
-device_buffer::device_buffer(std::weak_ptr<accelerator> parent, int width, int height, int stride) : impl_(new impl(parent, width, height, stride)){}\r
+device_buffer::device_buffer(std::weak_ptr<context> parent, int width, int height, int stride) : impl_(new impl(parent, width, height, stride)){}\r
 int device_buffer::stride() const { return impl_->stride_; }\r
 int device_buffer::width() const { return impl_->width_; }\r
 int device_buffer::height() const { return impl_->height_; }\r
similarity index 85%
rename from core/mixer/gpu/device_buffer.h
rename to accelerator/ogl/device_buffer.h
index 127b80afc7d1658aba6ec6acd0348b388ac31fae..c390c84afa737c02e2f9d4e42e239cedb30987e8 100644 (file)
 \r
 FORWARD1(boost, template<typename> class unique_future);\r
 \r
-namespace caspar { namespace core { namespace gpu {\r
+namespace caspar { namespace accelerator { namespace ogl {\r
                \r
 class host_buffer;\r
-class accelerator;\r
+class context;\r
 \r
 class device_buffer : boost::noncopyable\r
 {\r
@@ -43,9 +43,9 @@ public:
        void copy_from(const spl::shared_ptr<host_buffer>& source);\r
        void copy_to(const spl::shared_ptr<host_buffer>& dest);\r
 private:\r
-       friend class accelerator;\r
+       friend class context;\r
        friend class image_kernel;\r
-       device_buffer(std::weak_ptr<accelerator> parent, int width, int height, int stride);\r
+       device_buffer(std::weak_ptr<context> parent, int width, int height, int stride);\r
                        \r
        void bind(int index);\r
        void unbind();\r
similarity index 88%
rename from core/mixer/gpu/host_buffer.cpp
rename to accelerator/ogl/host_buffer.cpp
index 2449d5c9c3fdc9a1cd12e37d6099875b05953cbc..45255c3124c73d3fb14974065045c3b972a10949 100644 (file)
 * Author: Robert Nagy, ronag89@gmail.com\r
 */\r
 \r
-#include "../../stdafx.h"\r
+#include "../stdafx.h"\r
 \r
 #include "host_buffer.h"\r
 \r
 #include "device_buffer.h"\r
-#include "accelerator.h"\r
+#include "context.h"\r
 \r
 #include <common/except.h>\r
 #include <common/gl/gl_check.h>\r
@@ -33,7 +33,7 @@
 \r
 #include <tbb/atomic.h>\r
 \r
-namespace caspar { namespace core { namespace gpu {\r
+namespace caspar { namespace accelerator { namespace ogl {\r
 \r
 static tbb::atomic<int> g_w_total_count;\r
 static tbb::atomic<int> g_r_total_count;\r
@@ -45,10 +45,10 @@ struct host_buffer::impl : boost::noncopyable
        tbb::atomic<void*>                      data_;\r
        GLenum                                          usage_;\r
        GLenum                                          target_;\r
-       std::weak_ptr<accelerator>      parent_;\r
+       std::weak_ptr<context>  parent_;\r
 \r
 public:\r
-       impl(std::weak_ptr<accelerator> parent, int size, host_buffer::usage usage) \r
+       impl(std::weak_ptr<context> parent, int size, host_buffer::usage usage) \r
                : parent_(parent)\r
                , size_(size)\r
                , pbo_(0)\r
@@ -138,7 +138,7 @@ public:
        }\r
 };\r
 \r
-host_buffer::host_buffer(std::weak_ptr<accelerator> parent, int size, usage usage) : impl_(new impl(parent, size, usage)){}\r
+host_buffer::host_buffer(std::weak_ptr<context> parent, int size, usage usage) : impl_(new impl(parent, size, usage)){}\r
 const void* host_buffer::data() const {return impl_->data_;}\r
 void* host_buffer::data() {return impl_->data();}\r
 void host_buffer::map(){impl_->map();}\r
similarity index 85%
rename from core/mixer/gpu/host_buffer.h
rename to accelerator/ogl/host_buffer.h
index c1873ab8a02835d2e5d2511508ff8798ada9d678..a5cb16cc4e5c6829a0c850acdf888a421c5bdd82 100644 (file)
@@ -26,7 +26,7 @@
 \r
 #include <boost/noncopyable.hpp>\r
 \r
-namespace caspar { namespace core { namespace gpu {\r
+namespace caspar { namespace accelerator { namespace ogl {\r
                        \r
 class host_buffer : boost::noncopyable\r
 {\r
@@ -46,7 +46,7 @@ public:
        int size() const;       \r
        \r
 private:\r
-       friend class accelerator;\r
+       friend class context;\r
        friend class device_buffer;\r
 \r
        void bind();\r
@@ -55,7 +55,7 @@ private:
        void map();\r
        void unmap();\r
 \r
-       host_buffer(std::weak_ptr<accelerator> parent, int size, usage usage);\r
+       host_buffer(std::weak_ptr<context> parent, int size, usage usage);\r
 \r
        struct impl;\r
        spl::shared_ptr<impl> impl_;\r
similarity index 95%
rename from core/mixer/gpu/shader.cpp
rename to accelerator/ogl/shader.cpp
index 5750b158fea68b9e37d25c3cf4b9cec0ac4caa77..441eb9300c5528ad50f100cf74bc682347ef43e3 100644 (file)
@@ -19,7 +19,7 @@
 * Author: Robert Nagy, ronag89@gmail.com\r
 */\r
 \r
-#include "../../stdafx.h"\r
+#include "../stdafx.h"\r
 \r
 #include "shader.h"\r
 \r
@@ -29,7 +29,7 @@
 \r
 #include <unordered_map>\r
 \r
-namespace caspar { namespace core { namespace gpu {\r
+namespace caspar { namespace accelerator { namespace ogl {\r
 \r
 struct shader::impl : boost::noncopyable\r
 {\r
similarity index 90%
rename from core/mixer/gpu/shader.h
rename to accelerator/ogl/shader.h
index 5366f1ea02442591e7e9409a332ba4672397795a..ec0454ce202c3e27aaf4d674b1e782d70e136fff 100644 (file)
@@ -27,7 +27,7 @@
 \r
 #include <string>\r
 \r
-namespace caspar { namespace core { namespace gpu {\r
+namespace caspar { namespace accelerator { namespace ogl {\r
                \r
 class shader : boost::noncopyable\r
 {\r
@@ -38,7 +38,7 @@ public:
        void set(const std::string& name, float value);\r
        void set(const std::string& name, double value);\r
 private:\r
-       friend class accelerator;\r
+       friend class context;\r
        struct impl;\r
        spl::shared_ptr<impl> impl_;\r
 \r
similarity index 74%
rename from core/mixer/gpu/write_frame.cpp
rename to accelerator/ogl/write_frame.cpp
index 2d1740e983267fca0b06f22b43a071ed5d3b234b..d48361a99768b2820d40740fea2a1ef67631515f 100644 (file)
 * Author: Robert Nagy, ronag89@gmail.com\r
 */\r
 \r
-#include "../../stdafx.h"\r
+#include "../stdafx.h"\r
 \r
 #include "write_frame.h"\r
 \r
-#include "accelerator.h"\r
+#include "context.h"\r
 #include "host_buffer.h"\r
 #include "device_buffer.h"\r
 \r
 \r
 #include <boost/lexical_cast.hpp>\r
 \r
-namespace caspar { namespace core { namespace gpu {\r
+namespace caspar { namespace accelerator { namespace ogl {\r
                                                                                                                                                                                                                                                                                                                        \r
 struct write_frame::impl : boost::noncopyable\r
 {                      \r
-       std::shared_ptr<gpu::accelerator>               ogl_;\r
-       std::vector<spl::shared_ptr<gpu::host_buffer>>  buffers_;\r
-       audio_buffer                                                    audio_data_;\r
-       const core::pixel_format_desc                   desc_;\r
-       const void*                                                             tag_;\r
+       std::shared_ptr<context>                                        ogl_;\r
+       std::vector<spl::shared_ptr<ogl::host_buffer>>  buffers_;\r
+       core::audio_buffer                                                              audio_data_;\r
+       const core::pixel_format_desc                                   desc_;\r
+       const void*                                                                             tag_;\r
 \r
        impl(const void* tag)\r
                : desc_(core::pixel_format::invalid)\r
@@ -49,7 +49,7 @@ struct write_frame::impl : boost::noncopyable
        {\r
        }\r
 \r
-       impl(const spl::shared_ptr<gpu::accelerator>& ogl, const void* tag, const core::pixel_format_desc& desc) \r
+       impl(const spl::shared_ptr<ogl::context>& ogl, const void* tag, const core::pixel_format_desc& desc) \r
                : ogl_(ogl)\r
                , desc_(desc)\r
                , tag_(tag)\r
@@ -58,7 +58,7 @@ struct write_frame::impl : boost::noncopyable
                {\r
                        std::transform(desc.planes.begin(), desc.planes.end(), std::back_inserter(buffers_), [&](const core::pixel_format_desc::plane& plane)\r
                        {\r
-                               return ogl_->create_host_buffer(plane.size, gpu::host_buffer::usage::write_only);\r
+                               return ogl_->create_host_buffer(plane.size, ogl::host_buffer::usage::write_only);\r
                        });\r
                }\r
        }\r
@@ -80,7 +80,7 @@ struct write_frame::impl : boost::noncopyable
 };\r
        \r
 write_frame::write_frame(const void* tag) : impl_(new impl(tag)){}\r
-write_frame::write_frame(const spl::shared_ptr<gpu::accelerator>& ogl, const void* tag, const core::pixel_format_desc& desc) \r
+write_frame::write_frame(const spl::shared_ptr<ogl::context>& ogl, const void* tag, const core::pixel_format_desc& desc) \r
        : impl_(new impl(ogl, tag, desc)){}\r
 write_frame::write_frame(write_frame&& other) : impl_(std::move(other.impl_)){}\r
 write_frame& write_frame::operator=(write_frame&& other)\r
@@ -90,15 +90,15 @@ write_frame& write_frame::operator=(write_frame&& other)
 }\r
 void write_frame::swap(write_frame& other){impl_.swap(other.impl_);}\r
 void write_frame::accept(core::frame_visitor& visitor){impl_->accept(*this, visitor);}\r
-const  pixel_format_desc& write_frame::get_pixel_format_desc() const{return impl_->desc_;}\r
+const core::pixel_format_desc& write_frame::get_pixel_format_desc() const{return impl_->desc_;}\r
 const boost::iterator_range<const uint8_t*> write_frame::image_data(int index) const{return impl_->image_data(index);}\r
-const audio_buffer& write_frame::audio_data() const{return impl_->audio_data_;}\r
+const core::audio_buffer& write_frame::audio_data() const{return impl_->audio_data_;}\r
 const boost::iterator_range<uint8_t*> write_frame::image_data(int index){return impl_->image_data(index);}\r
-audio_buffer& write_frame::audio_data(){return impl_->audio_data_;}\r
+core::audio_buffer& write_frame::audio_data(){return impl_->audio_data_;}\r
 double write_frame::get_frame_rate() const{return 0.0;} // TODO: what's this?\r
 int write_frame::width() const{return impl_->desc_.planes.at(0).width;}\r
 int write_frame::height() const{return impl_->desc_.planes.at(0).height;}                                              \r
 const void* write_frame::tag() const{return impl_->tag_;}      \r
-std::vector<spl::shared_ptr<gpu::host_buffer>> write_frame::get_buffers(){return impl_->buffers_;}\r
+std::vector<spl::shared_ptr<ogl::host_buffer>> write_frame::get_buffers(){return impl_->buffers_;}\r
 \r
 }}}
\ No newline at end of file
similarity index 72%
rename from core/mixer/gpu/write_frame.h
rename to accelerator/ogl/write_frame.h
index 38fb992f6a3b34b5bf5b7ca497c31abeca82b6ed..eb8566782bd0b29d1efb60dbe3dda8b9deee072e 100644 (file)
@@ -21,6 +21,8 @@
 \r
 #pragma once\r
 \r
+#include "context.h"\r
+\r
 #include <common/spl/memory.h>\r
 #include <common/forward.h>\r
 \r
 #include <stdint.h>\r
 #include <vector>\r
 \r
-FORWARD3(caspar, core, gpu, class accelerator);\r
-FORWARD3(caspar, core, gpu, class host_buffer);\r
+FORWARD2(caspar, core, struct frame_visitor);\r
+FORWARD2(caspar, core, struct pixel_format_desc);\r
 \r
-namespace caspar { namespace core { namespace gpu {\r
+namespace caspar { namespace accelerator { namespace ogl {\r
        \r
 class write_frame sealed : public core::write_frame\r
 {\r
@@ -44,7 +46,7 @@ class write_frame sealed : public core::write_frame
        write_frame& operator=(const write_frame);\r
 public:        \r
        explicit write_frame(const void* tag);\r
-       explicit write_frame(const spl::shared_ptr<gpu::accelerator>& ogl, const void* tag, const struct pixel_format_desc& desc);\r
+       explicit write_frame(const spl::shared_ptr<class context>& ogl, const void* tag, const core::pixel_format_desc& desc);\r
 \r
        write_frame(write_frame&& other);\r
        write_frame& operator=(write_frame&& other);\r
@@ -53,17 +55,17 @@ public:
                        \r
        // draw_frame\r
 \r
-       virtual void accept(struct frame_visitor& visitor) override;\r
+       virtual void accept(core::frame_visitor& visitor) override;\r
 \r
        // data_frame\r
                \r
-       virtual const struct pixel_format_desc& get_pixel_format_desc() const override;\r
+       virtual const core::pixel_format_desc& get_pixel_format_desc() const override;\r
 \r
        virtual const boost::iterator_range<const uint8_t*> image_data(int index) const override;\r
-       virtual const audio_buffer& audio_data() const override;\r
+       virtual const core::audio_buffer& audio_data() const override;\r
 \r
        virtual const boost::iterator_range<uint8_t*> image_data(int index) override;\r
-       virtual audio_buffer& audio_data() override;\r
+       virtual core::audio_buffer& audio_data() override;\r
        \r
        virtual double get_frame_rate() const override;\r
 \r
@@ -74,7 +76,7 @@ public:
                        \r
        // write_frames\r
 \r
-       std::vector<spl::shared_ptr<gpu::host_buffer>> get_buffers();\r
+       std::vector<spl::shared_ptr<class host_buffer>> get_buffers();\r
 private:\r
        struct impl;\r
        spl::shared_ptr<impl> impl_;\r
index fdb5cfc79f79ebf49e7bb5496d83af7d5c84e0a7..a190d2877a08bf624cf861f12f436a95f65d008d 100644 (file)
@@ -26,14 +26,16 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "flash", "modules\flash\flas
 EndProject\r
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "oal", "modules\oal\oal.vcxproj", "{82ED7ED6-8A15-40EC-A8AF-F5E712E0DA68}"\r
 EndProject\r
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ogl", "modules\ogl\ogl.vcxproj", "{88F974F0-D09F-4788-8CF8-F563209E60C1}"\r
-EndProject\r
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "image", "modules\image\image.vcxproj", "{3E11FF65-A9DA-4F80-87F2-A7C6379ED5E2}"\r
 EndProject\r
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "common", "common\common.vcxproj", "{02308602-7FE0-4253-B96E-22134919F56A}"\r
 EndProject\r
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "reroute", "modules\reroute\reroute.vcxproj", "{7D58BD57-FDD5-46E6-A23B-ED14B5314A0E}"\r
 EndProject\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "accelerator", "accelerator\accelerator.vcxproj", "{8493D01A-F642-454C-8C44-88B38E2A3EF8}"\r
+EndProject\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "screen", "modules\screen\screen.vcxproj", "{88F974F0-D09F-4788-8CF8-F563209E60C1}"\r
+EndProject\r
 Global\r
        GlobalSection(SubversionScc) = preSolution\r
                Svn-Managed = True\r
@@ -128,16 +130,6 @@ Global
                {82ED7ED6-8A15-40EC-A8AF-F5E712E0DA68}.Release|Win32.ActiveCfg = Release|x64\r
                {82ED7ED6-8A15-40EC-A8AF-F5E712E0DA68}.Release|x64.ActiveCfg = Release|x64\r
                {82ED7ED6-8A15-40EC-A8AF-F5E712E0DA68}.Release|x64.Build.0 = Release|x64\r
-               {88F974F0-D09F-4788-8CF8-F563209E60C1}.Debug|Mixed Platforms.ActiveCfg = Debug|x64\r
-               {88F974F0-D09F-4788-8CF8-F563209E60C1}.Debug|Mixed Platforms.Build.0 = Debug|x64\r
-               {88F974F0-D09F-4788-8CF8-F563209E60C1}.Debug|Win32.ActiveCfg = Debug|x64\r
-               {88F974F0-D09F-4788-8CF8-F563209E60C1}.Debug|x64.ActiveCfg = Debug|x64\r
-               {88F974F0-D09F-4788-8CF8-F563209E60C1}.Debug|x64.Build.0 = Debug|x64\r
-               {88F974F0-D09F-4788-8CF8-F563209E60C1}.Release|Mixed Platforms.ActiveCfg = Release|x64\r
-               {88F974F0-D09F-4788-8CF8-F563209E60C1}.Release|Mixed Platforms.Build.0 = Release|x64\r
-               {88F974F0-D09F-4788-8CF8-F563209E60C1}.Release|Win32.ActiveCfg = Release|x64\r
-               {88F974F0-D09F-4788-8CF8-F563209E60C1}.Release|x64.ActiveCfg = Release|x64\r
-               {88F974F0-D09F-4788-8CF8-F563209E60C1}.Release|x64.Build.0 = Release|x64\r
                {3E11FF65-A9DA-4F80-87F2-A7C6379ED5E2}.Debug|Mixed Platforms.ActiveCfg = Debug|x64\r
                {3E11FF65-A9DA-4F80-87F2-A7C6379ED5E2}.Debug|Mixed Platforms.Build.0 = Debug|x64\r
                {3E11FF65-A9DA-4F80-87F2-A7C6379ED5E2}.Debug|Win32.ActiveCfg = Debug|x64\r
@@ -168,6 +160,26 @@ Global
                {7D58BD57-FDD5-46E6-A23B-ED14B5314A0E}.Release|Win32.ActiveCfg = Release|x64\r
                {7D58BD57-FDD5-46E6-A23B-ED14B5314A0E}.Release|x64.ActiveCfg = Release|x64\r
                {7D58BD57-FDD5-46E6-A23B-ED14B5314A0E}.Release|x64.Build.0 = Release|x64\r
+               {8493D01A-F642-454C-8C44-88B38E2A3EF8}.Debug|Mixed Platforms.ActiveCfg = Debug|x64\r
+               {8493D01A-F642-454C-8C44-88B38E2A3EF8}.Debug|Mixed Platforms.Build.0 = Debug|x64\r
+               {8493D01A-F642-454C-8C44-88B38E2A3EF8}.Debug|Win32.ActiveCfg = Debug|x64\r
+               {8493D01A-F642-454C-8C44-88B38E2A3EF8}.Debug|x64.ActiveCfg = Debug|x64\r
+               {8493D01A-F642-454C-8C44-88B38E2A3EF8}.Debug|x64.Build.0 = Debug|x64\r
+               {8493D01A-F642-454C-8C44-88B38E2A3EF8}.Release|Mixed Platforms.ActiveCfg = Release|x64\r
+               {8493D01A-F642-454C-8C44-88B38E2A3EF8}.Release|Mixed Platforms.Build.0 = Release|x64\r
+               {8493D01A-F642-454C-8C44-88B38E2A3EF8}.Release|Win32.ActiveCfg = Release|x64\r
+               {8493D01A-F642-454C-8C44-88B38E2A3EF8}.Release|x64.ActiveCfg = Release|x64\r
+               {8493D01A-F642-454C-8C44-88B38E2A3EF8}.Release|x64.Build.0 = Release|x64\r
+               {88F974F0-D09F-4788-8CF8-F563209E60C1}.Debug|Mixed Platforms.ActiveCfg = Debug|x64\r
+               {88F974F0-D09F-4788-8CF8-F563209E60C1}.Debug|Mixed Platforms.Build.0 = Debug|x64\r
+               {88F974F0-D09F-4788-8CF8-F563209E60C1}.Debug|Win32.ActiveCfg = Debug|x64\r
+               {88F974F0-D09F-4788-8CF8-F563209E60C1}.Debug|x64.ActiveCfg = Debug|x64\r
+               {88F974F0-D09F-4788-8CF8-F563209E60C1}.Debug|x64.Build.0 = Debug|x64\r
+               {88F974F0-D09F-4788-8CF8-F563209E60C1}.Release|Mixed Platforms.ActiveCfg = Release|x64\r
+               {88F974F0-D09F-4788-8CF8-F563209E60C1}.Release|Mixed Platforms.Build.0 = Release|x64\r
+               {88F974F0-D09F-4788-8CF8-F563209E60C1}.Release|Win32.ActiveCfg = Release|x64\r
+               {88F974F0-D09F-4788-8CF8-F563209E60C1}.Release|x64.ActiveCfg = Release|x64\r
+               {88F974F0-D09F-4788-8CF8-F563209E60C1}.Release|x64.Build.0 = Release|x64\r
        EndGlobalSection\r
        GlobalSection(SolutionProperties) = preSolution\r
                HideSolutionNode = FALSE\r
@@ -178,8 +190,8 @@ Global
                {F6223AF3-BE0B-4B61-8406-98922CE521C2} = {C54DA43E-4878-45DB-B76D-35970553672C}\r
                {816DEABA-3757-4306-AFE0-C27CF96C4DEA} = {C54DA43E-4878-45DB-B76D-35970553672C}\r
                {82ED7ED6-8A15-40EC-A8AF-F5E712E0DA68} = {C54DA43E-4878-45DB-B76D-35970553672C}\r
-               {88F974F0-D09F-4788-8CF8-F563209E60C1} = {C54DA43E-4878-45DB-B76D-35970553672C}\r
                {3E11FF65-A9DA-4F80-87F2-A7C6379ED5E2} = {C54DA43E-4878-45DB-B76D-35970553672C}\r
                {7D58BD57-FDD5-46E6-A23B-ED14B5314A0E} = {C54DA43E-4878-45DB-B76D-35970553672C}\r
+               {88F974F0-D09F-4788-8CF8-F563209E60C1} = {C54DA43E-4878-45DB-B76D-35970553672C}\r
        EndGlobalSection\r
 EndGlobal\r
index be7fdd66a767d847d2501509dfa68d9f3d9cd2cb..20e6483e6b036e729444677753479f68e2bf86bf 100644 (file)
     <ClInclude Include="frame\pixel_format.h" />\r
     <ClInclude Include="frame\write_frame.h" />\r
     <ClInclude Include="mixer\audio\audio_util.h" />\r
-    <ClInclude Include="mixer\gpu\device_buffer.h" />\r
-    <ClInclude Include="mixer\gpu\host_buffer.h" />\r
-    <ClInclude Include="mixer\gpu\image\blending_glsl.h" />\r
-    <ClInclude Include="mixer\gpu\image\image_kernel.h" />\r
-    <ClInclude Include="mixer\gpu\image\image_mixer.h" />\r
-    <ClInclude Include="mixer\gpu\image\image_shader.h" />\r
-    <ClInclude Include="mixer\gpu\accelerator.h" />\r
-    <ClInclude Include="mixer\gpu\shader.h" />\r
-    <ClInclude Include="mixer\gpu\write_frame.h" />\r
     <ClInclude Include="mixer\image\blend_modes.h" />\r
     <ClInclude Include="video_channel.h" />\r
     <ClInclude Include="consumer\output.h" />\r
       <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">../StdAfx.h</PrecompiledHeaderFile>\r
       <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|x64'">../StdAfx.h</PrecompiledHeaderFile>\r
     </ClCompile>\r
-    <ClCompile Include="mixer\gpu\device_buffer.cpp">\r
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">../../StdAfx.h</PrecompiledHeaderFile>\r
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|x64'">../../StdAfx.h</PrecompiledHeaderFile>\r
-    </ClCompile>\r
-    <ClCompile Include="mixer\gpu\host_buffer.cpp">\r
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">../../StdAfx.h</PrecompiledHeaderFile>\r
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|x64'">../../StdAfx.h</PrecompiledHeaderFile>\r
-    </ClCompile>\r
-    <ClCompile Include="mixer\gpu\image\image_kernel.cpp">\r
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">../../../StdAfx.h</PrecompiledHeaderFile>\r
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|x64'">../../../StdAfx.h</PrecompiledHeaderFile>\r
-    </ClCompile>\r
-    <ClCompile Include="mixer\gpu\image\image_mixer.cpp">\r
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">../../../StdAfx.h</PrecompiledHeaderFile>\r
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|x64'">../../../StdAfx.h</PrecompiledHeaderFile>\r
-    </ClCompile>\r
-    <ClCompile Include="mixer\gpu\image\image_shader.cpp">\r
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">../../../StdAfx.h</PrecompiledHeaderFile>\r
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|x64'">../../../StdAfx.h</PrecompiledHeaderFile>\r
-    </ClCompile>\r
-    <ClCompile Include="mixer\gpu\accelerator.cpp">\r
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">../../StdAfx.h</PrecompiledHeaderFile>\r
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|x64'">../../StdAfx.h</PrecompiledHeaderFile>\r
-    </ClCompile>\r
-    <ClCompile Include="mixer\gpu\shader.cpp">\r
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">../../StdAfx.h</PrecompiledHeaderFile>\r
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|x64'">../../StdAfx.h</PrecompiledHeaderFile>\r
-    </ClCompile>\r
-    <ClCompile Include="mixer\gpu\write_frame.cpp">\r
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">../../StdAfx.h</PrecompiledHeaderFile>\r
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|x64'">../../StdAfx.h</PrecompiledHeaderFile>\r
-    </ClCompile>\r
     <ClCompile Include="mixer\image\blend_modes.cpp">\r
       <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">../../StdAfx.h</PrecompiledHeaderFile>\r
       <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|x64'">../../StdAfx.h</PrecompiledHeaderFile>\r
index 5980cbba5b9ab5d1dfa7452729d618e6f0028e1d..65ab681dea81e002c17331f38d3020cd098106db 100644 (file)
     <Filter Include="source\producer\separated">\r
       <UniqueIdentifier>{cf834e89-32d6-47bc-8d5a-10e032f88e15}</UniqueIdentifier>\r
     </Filter>\r
-    <Filter Include="source\mixer\gpu">\r
-      <UniqueIdentifier>{b2af87a2-9528-4f82-b3f1-b7409ca15acd}</UniqueIdentifier>\r
-    </Filter>\r
-    <Filter Include="source\mixer\gpu\image">\r
-      <UniqueIdentifier>{d8d99a8a-42f9-48a3-b8a5-c07228226eab}</UniqueIdentifier>\r
-    </Filter>\r
     <Filter Include="source\frame">\r
       <UniqueIdentifier>{b19721c1-8dd1-45fb-b9e3-212b548ebbb6}</UniqueIdentifier>\r
     </Filter>\r
     <ClInclude Include="producer\separated\separated_producer.h">\r
       <Filter>source\producer\separated</Filter>\r
     </ClInclude>\r
-    <ClInclude Include="mixer\gpu\device_buffer.h">\r
-      <Filter>source\mixer\gpu</Filter>\r
-    </ClInclude>\r
-    <ClInclude Include="mixer\gpu\host_buffer.h">\r
-      <Filter>source\mixer\gpu</Filter>\r
-    </ClInclude>\r
-    <ClInclude Include="mixer\gpu\shader.h">\r
-      <Filter>source\mixer\gpu</Filter>\r
-    </ClInclude>\r
-    <ClInclude Include="mixer\gpu\image\image_mixer.h">\r
-      <Filter>source\mixer\gpu\image</Filter>\r
-    </ClInclude>\r
-    <ClInclude Include="mixer\gpu\image\image_kernel.h">\r
-      <Filter>source\mixer\gpu\image</Filter>\r
-    </ClInclude>\r
-    <ClInclude Include="mixer\gpu\image\blending_glsl.h">\r
-      <Filter>source\mixer\gpu\image</Filter>\r
-    </ClInclude>\r
-    <ClInclude Include="mixer\gpu\image\image_shader.h">\r
-      <Filter>source\mixer\gpu\image</Filter>\r
-    </ClInclude>\r
     <ClInclude Include="mixer\image\blend_modes.h">\r
       <Filter>source\mixer\image</Filter>\r
     </ClInclude>\r
-    <ClInclude Include="mixer\gpu\accelerator.h">\r
-      <Filter>source\mixer\gpu</Filter>\r
-    </ClInclude>\r
     <ClInclude Include="frame\frame_factory.h">\r
       <Filter>source\frame</Filter>\r
     </ClInclude>\r
     <ClInclude Include="frame\draw_frame.h">\r
       <Filter>source\frame</Filter>\r
     </ClInclude>\r
-    <ClInclude Include="mixer\gpu\write_frame.h">\r
-      <Filter>source\mixer\gpu</Filter>\r
-    </ClInclude>\r
     <ClInclude Include="consumer\cadence_guard.h">\r
       <Filter>source\consumer</Filter>\r
     </ClInclude>\r
     <ClCompile Include="producer\frame_producer.cpp">\r
       <Filter>source\producer</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="mixer\gpu\device_buffer.cpp">\r
-      <Filter>source\mixer\gpu</Filter>\r
-    </ClCompile>\r
-    <ClCompile Include="mixer\gpu\host_buffer.cpp">\r
-      <Filter>source\mixer\gpu</Filter>\r
-    </ClCompile>\r
-    <ClCompile Include="mixer\gpu\shader.cpp">\r
-      <Filter>source\mixer\gpu</Filter>\r
-    </ClCompile>\r
-    <ClCompile Include="mixer\gpu\image\image_shader.cpp">\r
-      <Filter>source\mixer\gpu\image</Filter>\r
-    </ClCompile>\r
-    <ClCompile Include="mixer\gpu\image\image_mixer.cpp">\r
-      <Filter>source\mixer\gpu\image</Filter>\r
-    </ClCompile>\r
-    <ClCompile Include="mixer\gpu\image\image_kernel.cpp">\r
-      <Filter>source\mixer\gpu\image</Filter>\r
-    </ClCompile>\r
     <ClCompile Include="mixer\image\blend_modes.cpp">\r
       <Filter>source\mixer\image</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="mixer\gpu\accelerator.cpp">\r
-      <Filter>source\mixer\gpu</Filter>\r
-    </ClCompile>\r
     <ClCompile Include="frame\frame_transform.cpp">\r
       <Filter>source\frame</Filter>\r
     </ClCompile>\r
     <ClCompile Include="frame\data_frame.cpp">\r
       <Filter>source\frame</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="mixer\gpu\write_frame.cpp">\r
-      <Filter>source\mixer\gpu</Filter>\r
-    </ClCompile>\r
     <ClCompile Include="consumer\cadence_guard.cpp">\r
       <Filter>source\consumer</Filter>\r
     </ClCompile>\r
index 608d04000653675d22d19f39a8c24fbf77f3c4b9..928a691e76277249b752a4cb1c4eab603570c856 100644 (file)
@@ -23,7 +23,7 @@
 \r
 #include "audio_mixer.h"\r
 \r
-#include <core/mixer/gpu/write_frame.h>\r
+#include <core/frame/write_frame.h>\r
 #include <core/frame/frame_transform.h>\r
 #include <common/diagnostics/graph.h>\r
 \r
index 0cac66c2ed0a430efe536ce108b6e616373027aa..28aa655b7a3b45c42de790c452652f78587cf06e 100644 (file)
 \r
 #include <core/frame/frame_visitor.h>\r
 \r
+#include <boost/range.hpp>\r
+\r
+#include <stdint.h>\r
+\r
 FORWARD1(boost, template<typename> class unique_future);\r
 FORWARD2(caspar, core, struct write_frame);\r
 FORWARD2(caspar, core, struct pixel_format_desc);\r
@@ -46,7 +50,7 @@ struct image_mixer : public frame_visitor
        virtual void end_layer() = 0;\r
                \r
        virtual boost::unique_future<boost::iterator_range<const uint8_t*>> operator()(const struct video_format_desc& format_desc) = 0;\r
-       virtual spl::shared_ptr<core::write_frame> create_frame(const void* tag, const core::pixel_format_desc& desc) = 0;\r
+       virtual spl::shared_ptr<core::write_frame> create_frame(const void* tag, const struct pixel_format_desc& desc) = 0;\r
 };\r
 \r
 }}
\ No newline at end of file
index 9c8cd5d35f1976bd40afb56b2f313621f9bc9645..2eb94c2d90d3cfb0a064890e17bce59cd435834c 100644 (file)
 #include "audio/audio_mixer.h"\r
 #include "image/image_mixer.h"\r
 \r
-#include "gpu/image/image_mixer.h"\r
-#include "gpu/accelerator.h"\r
-#include "gpu/write_frame.h"\r
-\r
 #include <common/env.h>\r
 #include <common/concurrency/executor.h>\r
 #include <common/diagnostics/graph.h>\r
@@ -123,21 +119,18 @@ public:
 };\r
                \r
 struct mixer::impl : boost::noncopyable\r
-{                      \r
-       spl::shared_ptr<gpu::accelerator>                       ogl_;\r
-       \r
+{                              \r
        audio_mixer                                                     audio_mixer_;\r
-       spl::shared_ptr<image_mixer>                            image_mixer_;\r
+       spl::shared_ptr<image_mixer>            image_mixer_;\r
        \r
        std::unordered_map<int, blend_mode>     blend_modes_;\r
                        \r
        executor executor_;\r
 \r
 public:\r
-       impl(const spl::shared_ptr<gpu::accelerator>& ogl) \r
-               : ogl_(ogl)\r
-               , audio_mixer_()\r
-               , image_mixer_(spl::make_shared<gpu::image_mixer>(ogl_))\r
+       impl(spl::shared_ptr<image_mixer> image_mixer) \r
+               : audio_mixer_()\r
+               , image_mixer_(std::move(image_mixer))\r
                , executor_(L"mixer")\r
        {                       \r
        }       \r
@@ -192,8 +185,8 @@ public:
        }\r
 };\r
        \r
-mixer::mixer(const spl::shared_ptr<gpu::accelerator>& ogl\r
-       : impl_(new impl(ogl)){}\r
+mixer::mixer(spl::shared_ptr<image_mixer> image_mixer\r
+       : impl_(new impl(std::move(image_mixer))){}\r
 void mixer::set_blend_mode(int index, blend_mode value){impl_->set_blend_mode(index, value);}\r
 boost::unique_future<boost::property_tree::wptree> mixer::info() const{return impl_->info();}\r
 spl::shared_ptr<const data_frame> mixer::operator()(std::map<int, spl::shared_ptr<draw_frame>> frames, const struct video_format_desc& format_desc){return (*impl_)(std::move(frames), format_desc);}\r
index 3929ae703ea6b2d7260a677b7c0b6ffac0c32f68..0d4879fe8f719220d2ee5812198526d123c0b963 100644 (file)
 \r
 FORWARD1(boost, template<typename> class unique_future);\r
 FORWARD2(caspar, diagnostics, class graph);\r
-FORWARD3(caspar, core, gpu, class accelerator);\r
-FORWARD2(caspar, core, struct write_frame);\r
-FORWARD2(caspar, core, struct pixel_format_desc);\r
 \r
 namespace caspar { namespace core {\r
        \r
 class mixer sealed : boost::noncopyable\r
 {\r
 public:        \r
-       explicit mixer(const spl::shared_ptr<gpu::accelerator>& ogl);\r
+       explicit mixer(spl::shared_ptr<struct image_mixer> image_mixer);\r
                                        \r
        spl::shared_ptr<const struct data_frame> operator()(std::map<int, spl::shared_ptr<class draw_frame>> frames, const struct video_format_desc& format_desc);\r
        \r
@@ -51,7 +48,7 @@ public:
 \r
        boost::unique_future<boost::property_tree::wptree> info() const;\r
 \r
-       spl::shared_ptr<core::write_frame> create_frame(const void* tag, const core::pixel_format_desc& desc);\r
+       spl::shared_ptr<struct write_frame> create_frame(const void* tag, const struct pixel_format_desc& desc);\r
 private:\r
        struct impl;\r
        spl::shared_ptr<impl> impl_;\r
index 02ccba68ceea3676442fd5418f291400cdc396a0..e6e7115a8e114f92756f73c0bc93098506ac92a5 100644 (file)
@@ -27,7 +27,7 @@
 #include <core/frame/draw_frame.h>\r
 #include <core/frame/frame_factory.h>\r
 #include <core/frame/pixel_format.h>\r
-#include <core/mixer/gpu/write_frame.h>\r
+#include <core/frame/write_frame.h>\r
 \r
 #include <common/except.h>\r
 \r
index fdb1043e23462ac78b116641e9213cf4e3a26ea9..f3078c7266b76602c6110ca0d0bbc30fb6810953 100644 (file)
 \r
 #include "video_format.h"\r
 \r
-#include "consumer/output.h"\r
+#include "producer/stage.h"\r
 #include "mixer/mixer.h"\r
-#include "mixer/gpu/write_frame.h"\r
-#include "mixer/gpu/accelerator.h"\r
+#include "consumer/output.h"\r
 #include "frame/data_frame.h"\r
-#include "producer/stage.h"\r
 #include "frame/frame_factory.h"\r
 \r
 #include <common/diagnostics/graph.h>\r
 #include <common/env.h>\r
 #include <common/concurrency/lock.h>\r
+#include <common/concurrency/executor.h>\r
 \r
 #include <tbb/spin_mutex.h>\r
 \r
@@ -48,31 +47,30 @@ namespace caspar { namespace core {
 struct video_channel::impl sealed : public frame_factory\r
 {\r
        reactive::basic_subject<spl::shared_ptr<const data_frame>> frame_subject_;\r
-       const int                                                               index_;\r
 \r
-       mutable tbb::spin_mutex                                 format_desc_mutex_;\r
-       video_format_desc                                               format_desc_;\r
+       const int                                                                               index_;\r
+\r
+       mutable tbb::spin_mutex                                                 format_desc_mutex_;\r
+       video_format_desc                                                               format_desc_;\r
        \r
-       const spl::shared_ptr<gpu::accelerator>         ogl_;\r
        const spl::shared_ptr<diagnostics::graph>               graph_;\r
 \r
-       const spl::shared_ptr<caspar::core::output>     output_;\r
+       const spl::shared_ptr<caspar::core::output>             output_;\r
        const spl::shared_ptr<caspar::core::mixer>              mixer_;\r
        const spl::shared_ptr<caspar::core::stage>              stage_; \r
 \r
-       boost::timer                                                    tick_timer_;\r
-       boost::timer                                                    produce_timer_;\r
-       boost::timer                                                    mix_timer_;\r
-       boost::timer                                                    consume_timer_;\r
+       boost::timer                                                                    tick_timer_;\r
+       boost::timer                                                                    produce_timer_;\r
+       boost::timer                                                                    mix_timer_;\r
+       boost::timer                                                                    consume_timer_;\r
 \r
-       executor                                                                executor_;\r
+       executor                                                                                executor_;\r
 public:\r
-       impl(int index, const video_format_desc& format_desc, const spl::shared_ptr<gpu::accelerator>& ogl)  \r
+       impl(int index, const video_format_desc& format_desc, spl::shared_ptr<image_mixer> image_mixer)  \r
                :  index_(index)\r
                , format_desc_(format_desc)\r
-               , ogl_(ogl)\r
                , output_(new caspar::core::output(format_desc, index))\r
-               , mixer_(new caspar::core::mixer(ogl))\r
+               , mixer_(new caspar::core::mixer(std::move(image_mixer)))\r
                , stage_(new caspar::core::stage())     \r
                , executor_(L"video_channel")\r
        {\r
@@ -142,7 +140,6 @@ public:
 \r
        void set_video_format_desc(const video_format_desc& format_desc)\r
        {\r
-               ogl_->gc();\r
                lock(format_desc_mutex_, [&]\r
                {\r
                        format_desc_ = format_desc;\r
@@ -171,7 +168,7 @@ public:
        }\r
 };\r
 \r
-video_channel::video_channel(int index, const video_format_desc& format_desc, const spl::shared_ptr<gpu::accelerator>& ogl) : impl_(new impl(index, format_desc, ogl)){}\r
+video_channel::video_channel(int index, const video_format_desc& format_desc, spl::shared_ptr<image_mixer> image_mixer) : impl_(new impl(index, format_desc, image_mixer)){}\r
 spl::shared_ptr<stage> video_channel::stage() { return impl_->stage_;} \r
 spl::shared_ptr<mixer> video_channel::mixer() { return impl_->mixer_;} \r
 spl::shared_ptr<frame_factory> video_channel::frame_factory() { return impl_;} \r
index 89e85c7ab17adec5d4715041a0e34bfdd433b84e..ab2308d744fe6acd66ff56fb7bb17662ab885371 100644 (file)
@@ -27,7 +27,7 @@
 \r
 #include <boost/property_tree/ptree_fwd.hpp>\r
 \r
-FORWARD3(caspar, core, gpu, class accelerator);\r
+FORWARD3(caspar, core, ogl, class accelerator);\r
 \r
 namespace caspar { namespace core {\r
        \r
@@ -36,7 +36,7 @@ class video_channel sealed : public reactive::observable<spl::shared_ptr<const s
        video_channel(const video_channel&);\r
        video_channel& operator=(const video_channel&);\r
 public:\r
-       explicit video_channel(int index, const struct video_format_desc& format_desc, const spl::shared_ptr<gpu::accelerator>& ogl);\r
+       explicit video_channel(int index, const struct video_format_desc& format_desc, spl::shared_ptr<struct image_mixer> image_mixer);\r
 \r
        spl::shared_ptr<class stage>                    stage();\r
        spl::shared_ptr<class mixer>                    mixer();\r
index 2774cbf9357127f0d0a800a4e0ebc7795923a9ef..42f9b8b8edbf28df247578880e02086c33b343d8 100644 (file)
@@ -37,7 +37,7 @@
 #include <common/log.h>\r
 #include <common/param.h>\r
 \r
-#include <core/mixer/gpu/write_frame.h>\r
+#include <core/frame/write_frame.h>\r
 #include <core/frame/frame_transform.h>\r
 #include <core/frame/frame_factory.h>\r
 \r
index 3198b7538d61b044ec0090ca6dd5d3ad5673f716..4a1e7f583f978fcb069b1697272d3db856158a25 100644 (file)
@@ -31,7 +31,7 @@
 #include <core/frame/frame_transform.h>\r
 #include <core/frame/pixel_format.h>\r
 #include <core/frame/frame_factory.h>\r
-#include <core/mixer/gpu/write_frame.h>\r
+#include <core/frame/write_frame.h>\r
 \r
 #include <common/env.h>\r
 #include <common/except.h>\r
index 9eb61fb8916811f95d5dbf331d952bbae5ef35d7..b4e647767f4de8dc077714309b68ae2df6709a6b 100644 (file)
@@ -34,7 +34,7 @@
 #include <core/frame/frame_transform.h>\r
 #include <core/frame/frame_factory.h>\r
 #include <core/producer/frame_producer.h>\r
-#include <core/mixer/gpu/write_frame.h>\r
+#include <core/frame/write_frame.h>\r
 \r
 #include <common/except.h>\r
 \r
index 4a974e4a8d49d921b8247842fc29692119041bfc..dac404547ffdd780d15a11b58192d12715c0be59 100644 (file)
@@ -774,7 +774,7 @@ HRESULT FlashAxContainer::CreateAxControl()
                        {\r
                                if(FAILED(spFlash->put_WMode(TEXT("Transparent"))))\r
                                        CASPAR_LOG(warning) << print_() << L" Failed to set flash container to transparent mode.";\r
-                               //spFlash->put_WMode(TEXT("GPU"));\r
+                               //spFlash->put_WMode(TEXT("ogl"));\r
                                hResultQuality = spFlash->put_Quality2(TEXT("Best"));\r
                        }\r
                        if(SUCCEEDED(DispEventAdvise(spFlash, &DIID__IShockwaveFlashEvents)))\r
index ec0b21f7eb3af4c4dec2af0edc821bf6783c1722..b968bc8dfb666eb2fd05eee8c670d5fe4f6ca2dc 100644 (file)
@@ -34,7 +34,7 @@
 #include <core/frame/draw_frame.h>\r
 #include <core/frame/frame_factory.h>\r
 #include <core/frame/pixel_format.h>\r
-#include <core/mixer/gpu/write_frame.h>\r
+#include <core/frame/write_frame.h>\r
 \r
 #include <common/env.h>\r
 #include <common/concurrency/executor.h>\r
index 0412218d11af4dcac04ce87151bbaffc6a8ce8db..2c78e718c3184c5aea8fac9189a54b741dd0b96e 100644 (file)
@@ -28,7 +28,7 @@
 #include <core/frame/draw_frame.h>\r
 #include <core/frame/frame_factory.h>\r
 #include <core/frame/pixel_format.h>\r
-#include <core/mixer/gpu/write_frame.h>\r
+#include <core/frame/write_frame.h>\r
 \r
 #include <common/env.h>\r
 #include <common/log.h>\r
index a25e2f6b08ece96c25a1958fefdbfb9e2e75ffcb..accdae3fa40cc131449f5407957f117fbb7dc946 100644 (file)
@@ -29,7 +29,7 @@
 #include <core/frame/frame_factory.h>\r
 #include <core/frame/frame_transform.h>\r
 #include <core/frame/pixel_format.h>\r
-#include <core/mixer/gpu/write_frame.h>\r
+#include <core/frame/write_frame.h>\r
 \r
 #include <common/env.h>\r
 #include <common/log.h>\r
index cd1fa24ec4d9433a6fe46528534000fc1b799a92..66957b2071562f81dde33212ca04839b8602f3b9 100644 (file)
@@ -27,7 +27,7 @@
 #include <core/frame/draw_frame.h>\r
 #include <core/frame/frame_factory.h>\r
 #include <core/frame/pixel_format.h>\r
-#include <core/mixer/gpu/write_frame.h>\r
+#include <core/frame/write_frame.h>\r
 #include <core/frame/data_frame.h>\r
 \r
 #include <common/except.h>\r
diff --git a/modules/screen/consumer/screen_consumer.cpp b/modules/screen/consumer/screen_consumer.cpp
new file mode 100644 (file)
index 0000000..48a9043
--- /dev/null
@@ -0,0 +1,575 @@
+/*\r
+* Copyright (c) 2011 Sveriges Television AB <info@casparcg.com>\r
+*\r
+* This file is part of CasparCG (www.casparcg.com).\r
+*\r
+* CasparCG is free software: you can redistribute it and/or modify\r
+* it under the terms of the GNU General Public License as published by\r
+* the Free Software Foundation, either version 3 of the License, or\r
+* (at your option) any later version.\r
+*\r
+* CasparCG is distributed in the hope that it will be useful,\r
+* but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+* GNU General Public License for more details.\r
+*\r
+* You should have received a copy of the GNU General Public License\r
+* along with CasparCG. If not, see <http://www.gnu.org/licenses/>.\r
+*\r
+* Author: Robert Nagy, ronag89@gmail.com\r
+*/\r
+\r
+#include "screen_consumer.h"\r
+\r
+#include <GL/glew.h>\r
+#include <SFML/Window.hpp>\r
+\r
+#include <common/diagnostics/graph.h>\r
+#include <common/gl/gl_check.h>\r
+#include <common/log.h>\r
+#include <common/spl/memory.h>\r
+#include <common/memory/memshfl.h>\r
+#include <common/utf.h>\r
+\r
+#include <ffmpeg/producer/filter/filter.h>\r
+\r
+#include <core/video_format.h>\r
+#include <core/frame/data_frame.h>\r
+#include <core/consumer/frame_consumer.h>\r
+\r
+#include <boost/timer.hpp>\r
+#include <boost/circular_buffer.hpp>\r
+#include <boost/foreach.hpp>\r
+#include <boost/thread.hpp>\r
+#include <boost/property_tree/ptree.hpp>\r
+\r
+#include <tbb/atomic.h>\r
+#include <tbb/concurrent_queue.h>\r
+\r
+#include <boost/assign.hpp>\r
+\r
+#include <asmlib.h>\r
+\r
+#include <algorithm>\r
+#include <vector>\r
+\r
+#if defined(_MSC_VER)\r
+#pragma warning (push)\r
+#pragma warning (disable : 4244)\r
+#endif\r
+extern "C" \r
+{\r
+       #define __STDC_CONSTANT_MACROS\r
+       #define __STDC_LIMIT_MACROS\r
+       #include <libavcodec/avcodec.h>\r
+       #include <libavutil/imgutils.h>\r
+}\r
+#if defined(_MSC_VER)\r
+#pragma warning (pop)\r
+#endif\r
+\r
+namespace caspar { namespace screen {\r
+               \r
+enum stretch\r
+{\r
+       none,\r
+       uniform,\r
+       fill,\r
+       uniform_to_fill\r
+};\r
+\r
+struct configuration\r
+{\r
+       enum aspect_ratio\r
+       {\r
+               aspect_4_3 = 0,\r
+               aspect_16_9,\r
+               aspect_invalid,\r
+       };\r
+               \r
+       std::wstring    name;\r
+       int                             screen_index;\r
+       stretch                 stretch;\r
+       bool                    windowed;\r
+       bool                    auto_deinterlace;\r
+       bool                    key_only;\r
+       aspect_ratio    aspect; \r
+       bool                    vsync;\r
+\r
+       configuration()\r
+               : name(L"ogl")\r
+               , screen_index(0)\r
+               , stretch(fill)\r
+               , windowed(true)\r
+               , auto_deinterlace(true)\r
+               , key_only(false)\r
+               , aspect(aspect_invalid)\r
+               , vsync(false)\r
+       {\r
+       }\r
+};\r
+\r
+struct screen_consumer : boost::noncopyable\r
+{              \r
+       const configuration             config_;\r
+       core::video_format_desc format_desc_;\r
+       int                                             channel_index_;\r
+\r
+       GLuint                                  texture_;\r
+       std::vector<GLuint>             pbos_;\r
+                       \r
+       float                                   width_;\r
+       float                                   height_;        \r
+       unsigned int                    screen_x_;\r
+       unsigned int                    screen_y_;\r
+       unsigned int                    screen_width_;\r
+       unsigned int                    screen_height_;\r
+       int                                             square_width_;\r
+       int                                             square_height_;                         \r
+       \r
+       sf::Window                              window_;\r
+       \r
+       spl::shared_ptr<diagnostics::graph>     graph_;\r
+       boost::timer                                    perf_timer_;\r
+       boost::timer                                    tick_timer_;\r
+\r
+       tbb::concurrent_bounded_queue<std::shared_ptr<const core::data_frame>>  frame_buffer_;\r
+\r
+       boost::thread                   thread_;\r
+       tbb::atomic<bool>               is_running_;\r
+       \r
+       ffmpeg::filter                  filter_;\r
+public:\r
+       screen_consumer(const configuration& config, const core::video_format_desc& format_desc, int channel_index) \r
+               : config_(config)\r
+               , format_desc_(format_desc)\r
+               , channel_index_(channel_index)\r
+               , texture_(0)\r
+               , pbos_(2, 0)   \r
+               , screen_width_(format_desc.width)\r
+               , screen_height_(format_desc.height)\r
+               , square_width_(format_desc.square_width)\r
+               , square_height_(format_desc.square_height)\r
+               , filter_(format_desc.field_mode == core::field_mode::progressive || !config.auto_deinterlace ? L"" : L"YADIF=0:-1", boost::assign::list_of(PIX_FMT_BGRA))\r
+       {               \r
+               if(format_desc_.format == core::video_format::ntsc && config_.aspect == configuration::aspect_4_3)\r
+               {\r
+                       // Use default values which are 4:3.\r
+               }\r
+               else\r
+               {\r
+                       if(config_.aspect == configuration::aspect_16_9)\r
+                               square_width_ = (format_desc.height*16)/9;\r
+                       else if(config_.aspect == configuration::aspect_4_3)\r
+                               square_width_ = (format_desc.height*4)/3;\r
+               }\r
+\r
+               frame_buffer_.set_capacity(2);\r
+               \r
+               graph_->set_color("tick-time", diagnostics::color(0.0f, 0.6f, 0.9f));   \r
+               graph_->set_color("frame-time", diagnostics::color(0.1f, 1.0f, 0.1f));\r
+               graph_->set_color("dropped-frame", diagnostics::color(0.3f, 0.6f, 0.3f));\r
+               graph_->set_text(print());\r
+               diagnostics::register_graph(graph_);\r
+                                                                       \r
+               DISPLAY_DEVICE d_device = {sizeof(d_device), 0};                        \r
+               std::vector<DISPLAY_DEVICE> displayDevices;\r
+               for(int n = 0; EnumDisplayDevices(NULL, n, &d_device, NULL); ++n)\r
+                       displayDevices.push_back(d_device);\r
+\r
+               if(config_.screen_index >= displayDevices.size())\r
+                       CASPAR_LOG(warning) << print() << L" Invalid screen-index: " << config_.screen_index;\r
+               \r
+               DEVMODE devmode = {};\r
+               if(!EnumDisplaySettings(displayDevices[config_.screen_index].DeviceName, ENUM_CURRENT_SETTINGS, &devmode))\r
+                       CASPAR_LOG(warning) << print() << L" Could not find display settings for screen-index: " << config_.screen_index;\r
+               \r
+               screen_x_               = devmode.dmPosition.x;\r
+               screen_y_               = devmode.dmPosition.y;\r
+               screen_width_   = config_.windowed ? square_width_ : devmode.dmPelsWidth;\r
+               screen_height_  = config_.windowed ? square_height_ : devmode.dmPelsHeight;\r
+               \r
+               is_running_ = true;\r
+               thread_ = boost::thread([this]{run();});\r
+       }\r
+       \r
+       ~screen_consumer()\r
+       {\r
+               is_running_ = false;\r
+               frame_buffer_.try_push(core::data_frame::empty());\r
+               thread_.join();\r
+       }\r
+\r
+       void init()\r
+       {\r
+               if(!GLEW_VERSION_2_1)\r
+                       BOOST_THROW_EXCEPTION(not_supported() << msg_info("Missing OpenGL 2.1 support."));\r
+\r
+               window_.Create(sf::VideoMode(screen_width_, screen_height_, 32), u8(print()), config_.windowed ? sf::Style::Resize | sf::Style::Close : sf::Style::Fullscreen);\r
+               window_.ShowMouseCursor(false);\r
+               window_.SetPosition(screen_x_, screen_y_);\r
+               window_.SetSize(screen_width_, screen_height_);\r
+               window_.SetActive();\r
+\r
+               GL(glEnable(GL_TEXTURE_2D));\r
+               GL(glDisable(GL_DEPTH_TEST));           \r
+               GL(glClearColor(0.0, 0.0, 0.0, 0.0));\r
+               GL(glViewport(0, 0, format_desc_.width, format_desc_.height));\r
+               GL(glLoadIdentity());\r
+                               \r
+               calculate_aspect();\r
+                       \r
+               GL(glGenTextures(1, &texture_));\r
+               GL(glBindTexture(GL_TEXTURE_2D, texture_));\r
+               GL(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR));\r
+               GL(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR));\r
+               GL(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP));\r
+               GL(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP));\r
+               GL(glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, format_desc_.width, format_desc_.height, 0, GL_BGRA, GL_UNSIGNED_BYTE, 0));\r
+               GL(glBindTexture(GL_TEXTURE_2D, 0));\r
+                                       \r
+               GL(glGenBuffers(2, pbos_.data()));\r
+                       \r
+               glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, pbos_[0]);\r
+               glBufferDataARB(GL_PIXEL_UNPACK_BUFFER_ARB, format_desc_.size, 0, GL_STREAM_DRAW_ARB);\r
+               glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, pbos_[1]);\r
+               glBufferDataARB(GL_PIXEL_UNPACK_BUFFER_ARB, format_desc_.size, 0, GL_STREAM_DRAW_ARB);\r
+               glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0);\r
+               \r
+               if(config_.vsync)\r
+               {\r
+                       auto wglSwapIntervalEXT = reinterpret_cast<void(APIENTRY*)(int)>(wglGetProcAddress("wglSwapIntervalEXT"));\r
+                       if(wglSwapIntervalEXT)\r
+                       {\r
+                               wglSwapIntervalEXT(1);\r
+                               CASPAR_LOG(info) << print() << " Successfully enabled vsync.";\r
+                       }\r
+                       else\r
+                               CASPAR_LOG(info) << print() << " Failed to enable vsync.";\r
+               }\r
+\r
+               CASPAR_LOG(info) << print() << " Successfully Initialized.";\r
+       }\r
+\r
+       void uninit()\r
+       {               \r
+               if(texture_)\r
+                       glDeleteTextures(1, &texture_);\r
+\r
+               BOOST_FOREACH(auto& pbo, pbos_)\r
+               {\r
+                       if(pbo)\r
+                               glDeleteBuffers(1, &pbo);\r
+               }\r
+       }\r
+\r
+       void run()\r
+       {\r
+               try\r
+               {\r
+                       init();\r
+\r
+                       while(is_running_)\r
+                       {                       \r
+                               try\r
+                               {\r
+                                       sf::Event e;            \r
+                                       while(window_.GetEvent(e))\r
+                                       {\r
+                                               if(e.Type == sf::Event::Resized)\r
+                                                       calculate_aspect();\r
+                                               else if(e.Type == sf::Event::Closed)\r
+                                                       is_running_ = false;\r
+                                       }\r
+                       \r
+                                       std::shared_ptr<const core::data_frame> frame;\r
+                                       frame_buffer_.pop(frame);\r
+                                       \r
+                                       perf_timer_.restart();\r
+                                       render(spl::make_shared_ptr(frame));\r
+                                       graph_->set_value("frame-time", perf_timer_.elapsed()*format_desc_.fps*0.5);    \r
+\r
+                                       window_.Display();\r
+                                       \r
+                                       graph_->set_value("tick-time", tick_timer_.elapsed()*format_desc_.fps*0.5);     \r
+                                       tick_timer_.restart();\r
+                               }\r
+                               catch(...)\r
+                               {\r
+                                       CASPAR_LOG_CURRENT_EXCEPTION();\r
+                                       is_running_ = false;\r
+                               }\r
+                       }\r
+\r
+                       uninit();\r
+               }\r
+               catch(...)\r
+               {\r
+                       CASPAR_LOG_CURRENT_EXCEPTION();\r
+               }\r
+       }\r
+       \r
+       spl::shared_ptr<AVFrame> get_av_frame()\r
+       {               \r
+               spl::shared_ptr<AVFrame> av_frame(avcodec_alloc_frame(), av_free);      \r
+               avcodec_get_frame_defaults(av_frame.get());\r
+                                               \r
+               av_frame->linesize[0]           = format_desc_.width*4;                 \r
+               av_frame->format                        = PIX_FMT_BGRA;\r
+               av_frame->width                         = format_desc_.width;\r
+               av_frame->height                        = format_desc_.height;\r
+               av_frame->interlaced_frame      = format_desc_.field_mode != core::field_mode::progressive;\r
+               av_frame->top_field_first       = format_desc_.field_mode == core::field_mode::upper ? 1 : 0;\r
+\r
+               return av_frame;\r
+       }\r
+\r
+       void render(const spl::shared_ptr<const core::data_frame>& frame)\r
+       {                       \r
+               if(static_cast<int>(frame->image_data().size()) != format_desc_.size)\r
+                       return;\r
+                                       \r
+               auto av_frame = get_av_frame();\r
+               av_frame->data[0] = const_cast<uint8_t*>(frame->image_data().begin());\r
+\r
+               filter_.push(av_frame);\r
+               auto frames = filter_.poll_all();\r
+\r
+               if(frames.empty())\r
+                       return;\r
+\r
+               av_frame = frames[0];\r
+\r
+               if(av_frame->linesize[0] != static_cast<int>(format_desc_.width*4))\r
+               {\r
+                       const uint8_t *src_data[4] = {0};\r
+                       A_memcpy(const_cast<uint8_t**>(&src_data[0]), av_frame->data, 4);\r
+                       const int src_linesizes[4] = {0};\r
+                       A_memcpy(const_cast<int*>(&src_linesizes[0]), av_frame->linesize, 4);\r
+\r
+                       auto av_frame2 = get_av_frame();\r
+                       av_image_alloc(av_frame2->data, av_frame2->linesize, av_frame2->width, av_frame2->height, PIX_FMT_BGRA, 16);\r
+                       av_frame = spl::shared_ptr<AVFrame>(av_frame2.get(), [=](AVFrame*)\r
+                       {\r
+                               av_freep(&av_frame2->data[0]);\r
+                       });\r
+\r
+                       av_image_copy(av_frame2->data, av_frame2->linesize, src_data, src_linesizes, PIX_FMT_BGRA, av_frame2->width, av_frame2->height);\r
+               }\r
+\r
+               glBindTexture(GL_TEXTURE_2D, texture_);\r
+\r
+               glBindBuffer(GL_PIXEL_UNPACK_BUFFER, pbos_[0]);\r
+               glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, format_desc_.width, format_desc_.height, GL_BGRA, GL_UNSIGNED_BYTE, 0);\r
+\r
+               glBindBuffer(GL_PIXEL_UNPACK_BUFFER, pbos_[1]);\r
+               glBufferData(GL_PIXEL_UNPACK_BUFFER, format_desc_.size, 0, GL_STREAM_DRAW);\r
+\r
+               auto ptr = glMapBuffer(GL_PIXEL_UNPACK_BUFFER, GL_WRITE_ONLY);\r
+               if(ptr)\r
+               {\r
+                       if(config_.key_only)\r
+                               aligned_memshfl(reinterpret_cast<char*>(ptr), av_frame->data[0], frame->image_data().size(), 0x0F0F0F0F, 0x0B0B0B0B, 0x07070707, 0x03030303);\r
+                       else\r
+                               A_memcpy(reinterpret_cast<char*>(ptr), av_frame->data[0], frame->image_data().size());\r
+\r
+                       glUnmapBuffer(GL_PIXEL_UNPACK_BUFFER); // release the mapped buffer\r
+               }\r
+\r
+               glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);\r
+                               \r
+               GL(glClear(GL_COLOR_BUFFER_BIT));                       \r
+               glBegin(GL_QUADS);\r
+                               glTexCoord2f(0.0f,        1.0f);        glVertex2f(-width_, -height_);\r
+                               glTexCoord2f(1.0f,        1.0f);        glVertex2f( width_, -height_);\r
+                               glTexCoord2f(1.0f,        0.0f);        glVertex2f( width_,  height_);\r
+                               glTexCoord2f(0.0f,        0.0f);        glVertex2f(-width_,  height_);\r
+               glEnd();\r
+               \r
+               glBindTexture(GL_TEXTURE_2D, 0);\r
+\r
+               std::rotate(pbos_.begin(), pbos_.begin() + 1, pbos_.end());\r
+       }\r
+\r
+       bool send(const spl::shared_ptr<const core::data_frame>& frame)\r
+       {\r
+               if(!frame_buffer_.try_push(frame))\r
+                       graph_->set_tag("dropped-frame");\r
+               return is_running_;\r
+       }\r
+               \r
+       std::wstring print() const\r
+       {       \r
+               return config_.name + L"[" + boost::lexical_cast<std::wstring>(channel_index_) + L"|" + format_desc_.name + L"]";\r
+       }\r
+       \r
+       void calculate_aspect()\r
+       {\r
+               if(config_.windowed)\r
+               {\r
+                       screen_height_ = window_.GetHeight();\r
+                       screen_width_ = window_.GetWidth();\r
+               }\r
+               \r
+               GL(glViewport(0, 0, screen_width_, screen_height_));\r
+\r
+               std::pair<float, float> target_ratio = None();\r
+               if(config_.stretch == fill)\r
+                       target_ratio = Fill();\r
+               else if(config_.stretch == uniform)\r
+                       target_ratio = Uniform();\r
+               else if(config_.stretch == uniform_to_fill)\r
+                       target_ratio = UniformToFill();\r
+\r
+               width_ = target_ratio.first;\r
+               height_ = target_ratio.second;\r
+       }\r
+               \r
+       std::pair<float, float> None()\r
+       {\r
+               float width = static_cast<float>(square_width_)/static_cast<float>(screen_width_);\r
+               float height = static_cast<float>(square_height_)/static_cast<float>(screen_height_);\r
+\r
+               return std::make_pair(width, height);\r
+       }\r
+\r
+       std::pair<float, float> Uniform()\r
+       {\r
+               float aspect = static_cast<float>(square_width_)/static_cast<float>(square_height_);\r
+               float width = std::min(1.0f, static_cast<float>(screen_height_)*aspect/static_cast<float>(screen_width_));\r
+               float height = static_cast<float>(screen_width_*width)/static_cast<float>(screen_height_*aspect);\r
+\r
+               return std::make_pair(width, height);\r
+       }\r
+\r
+       std::pair<float, float> Fill()\r
+       {\r
+               return std::make_pair(1.0f, 1.0f);\r
+       }\r
+\r
+       std::pair<float, float> UniformToFill()\r
+       {\r
+               float wr = static_cast<float>(square_width_)/static_cast<float>(screen_width_);\r
+               float hr = static_cast<float>(square_height_)/static_cast<float>(screen_height_);\r
+               float r_inv = 1.0f/std::min(wr, hr);\r
+\r
+               float width = wr*r_inv;\r
+               float height = hr*r_inv;\r
+\r
+               return std::make_pair(width, height);\r
+       }\r
+};\r
+\r
+\r
+struct screen_consumer_proxy : public core::frame_consumer\r
+{\r
+       const configuration config_;\r
+       std::unique_ptr<screen_consumer> consumer_;\r
+\r
+public:\r
+\r
+       screen_consumer_proxy(const configuration& config)\r
+               : config_(config){}\r
+       \r
+       ~screen_consumer_proxy()\r
+       {\r
+               if(consumer_)\r
+               {\r
+                       auto str = print();\r
+                       consumer_.reset();\r
+                       CASPAR_LOG(info) << str << L" Successfully Uninitialized.";     \r
+               }\r
+       }\r
+\r
+       // frame_consumer\r
+\r
+       virtual void initialize(const core::video_format_desc& format_desc, int channel_index) override\r
+       {\r
+               consumer_.reset();\r
+               consumer_.reset(new screen_consumer(config_, format_desc, channel_index));\r
+               CASPAR_LOG(info) << print() << L" Successfully Initialized.";   \r
+       }\r
+       \r
+       virtual bool send(const spl::shared_ptr<const core::data_frame>& frame) override\r
+       {\r
+               return consumer_->send(frame);\r
+       }\r
+       \r
+       virtual std::wstring print() const override\r
+       {\r
+               return consumer_ ? consumer_->print() : L"[screen_consumer]";\r
+       }\r
+\r
+       virtual boost::property_tree::wptree info() const override\r
+       {\r
+               boost::property_tree::wptree info;\r
+               info.add(L"type", L"ogl-consumer");\r
+               info.add(L"key-only", config_.key_only);\r
+               info.add(L"windowed", config_.windowed);\r
+               info.add(L"auto-deinterlace", config_.auto_deinterlace);\r
+               return info;\r
+       }\r
+\r
+       virtual bool has_synchronization_clock() const override\r
+       {\r
+               return false;\r
+       }\r
+       \r
+       virtual int buffer_depth() const override\r
+       {\r
+               return 1;\r
+       }\r
+\r
+       virtual int index() const override\r
+       {\r
+               return 600;\r
+       }\r
+};     \r
+\r
+spl::shared_ptr<core::frame_consumer> create_consumer(const std::vector<std::wstring>& params)\r
+{\r
+       if(params.size() < 1 || params[0] != L"SCREEN")\r
+               return core::frame_consumer::empty();\r
+       \r
+       configuration config;\r
+               \r
+       auto device_it = std::find(params.begin(), params.end(), L"DEVICE");\r
+       if(device_it != params.end() && ++device_it != params.end())\r
+               config.screen_index = boost::lexical_cast<int>(*device_it);\r
+               \r
+       config.key_only = std::find(params.begin(), params.end(), L"WINDOWED") != params.end();\r
+       config.key_only = std::find(params.begin(), params.end(), L"KEY_ONLY") != params.end();\r
+\r
+       auto name_it    = std::find(params.begin(), params.end(), L"NAME");\r
+       if(name_it != params.end() && ++name_it != params.end())\r
+               config.name = *name_it;\r
+\r
+       return spl::make_shared<screen_consumer_proxy>(config);\r
+}\r
+\r
+spl::shared_ptr<core::frame_consumer> create_consumer(const boost::property_tree::wptree& ptree) \r
+{\r
+       configuration config;\r
+       config.name                             = ptree.get(L"name",     config.name);\r
+       config.screen_index             = ptree.get(L"device",   config.screen_index+1)-1;\r
+       config.windowed                 = ptree.get(L"windowed", config.windowed);\r
+       config.key_only                 = ptree.get(L"key-only", config.key_only);\r
+       config.auto_deinterlace = ptree.get(L"auto-deinterlace", config.auto_deinterlace);\r
+       config.vsync                    = ptree.get(L"vsync", config.vsync);\r
+       \r
+       auto stretch_str = ptree.get(L"stretch", L"default");\r
+       if(stretch_str == L"uniform")\r
+               config.stretch = stretch::uniform;\r
+       else if(stretch_str == L"uniform_to_fill")\r
+               config.stretch = stretch::uniform_to_fill;\r
+\r
+       auto aspect_str = ptree.get(L"aspect-ratio", L"default");\r
+       if(aspect_str == L"16:9")\r
+               config.aspect = configuration::aspect_16_9;\r
+       else if(aspect_str == L"4:3")\r
+               config.aspect = configuration::aspect_4_3;\r
+       \r
+       return spl::make_shared<screen_consumer_proxy>(config);\r
+}\r
+\r
+}}
\ No newline at end of file
diff --git a/modules/screen/consumer/screen_consumer.h b/modules/screen/consumer/screen_consumer.h
new file mode 100644 (file)
index 0000000..6e67312
--- /dev/null
@@ -0,0 +1,41 @@
+/*\r
+* Copyright (c) 2011 Sveriges Television AB <info@casparcg.com>\r
+*\r
+* This file is part of CasparCG (www.casparcg.com).\r
+*\r
+* CasparCG is free software: you can redistribute it and/or modify\r
+* it under the terms of the GNU General Public License as published by\r
+* the Free Software Foundation, either version 3 of the License, or\r
+* (at your option) any later version.\r
+*\r
+* CasparCG is distributed in the hope that it will be useful,\r
+* but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+* GNU General Public License for more details.\r
+*\r
+* You should have received a copy of the GNU General Public License\r
+* along with CasparCG. If not, see <http://www.gnu.org/licenses/>.\r
+*\r
+* Author: Robert Nagy, ronag89@gmail.com\r
+*/\r
+\r
+#pragma once\r
+\r
+#include <common/spl/memory.h>\r
+\r
+#include <vector>\r
+#include <boost/property_tree/ptree.hpp>\r
+\r
+namespace caspar { \r
+       \r
+namespace core {\r
+       struct frame_consumer;\r
+}\r
+\r
+namespace screen {\r
+\r
+\r
+spl::shared_ptr<core::frame_consumer> create_consumer(const std::vector<std::wstring>& params);\r
+spl::shared_ptr<core::frame_consumer> create_consumer(const boost::property_tree::wptree& ptree);\r
+\r
+}}
\ No newline at end of file
diff --git a/modules/screen/screen.cpp b/modules/screen/screen.cpp
new file mode 100644 (file)
index 0000000..bec6d52
--- /dev/null
@@ -0,0 +1,35 @@
+/*\r
+* Copyright (c) 2011 Sveriges Television AB <info@casparcg.com>\r
+*\r
+* This file is part of CasparCG (www.casparcg.com).\r
+*\r
+* CasparCG is free software: you can redistribute it and/or modify\r
+* it under the terms of the GNU General Public License as published by\r
+* the Free Software Foundation, either version 3 of the License, or\r
+* (at your option) any later version.\r
+*\r
+* CasparCG is distributed in the hope that it will be useful,\r
+* but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+* GNU General Public License for more details.\r
+*\r
+* You should have received a copy of the GNU General Public License\r
+* along with CasparCG. If not, see <http://www.gnu.org/licenses/>.\r
+*\r
+* Author: Robert Nagy, ronag89@gmail.com\r
+*/\r
+\r
+#include "screen.h"\r
+\r
+#include "consumer/screen_consumer.h"\r
+\r
+#include <core/consumer/frame_consumer.h>\r
+\r
+namespace caspar { namespace screen {\r
+\r
+void init()\r
+{\r
+       caspar::core::register_consumer_factory([](const std::vector<std::wstring>& params){return create_consumer(params);});\r
+}\r
+\r
+}}
\ No newline at end of file
diff --git a/modules/screen/screen.h b/modules/screen/screen.h
new file mode 100644 (file)
index 0000000..d144b75
--- /dev/null
@@ -0,0 +1,28 @@
+/*\r
+* Copyright (c) 2011 Sveriges Television AB <info@casparcg.com>\r
+*\r
+* This file is part of CasparCG (www.casparcg.com).\r
+*\r
+* CasparCG is free software: you can redistribute it and/or modify\r
+* it under the terms of the GNU General Public License as published by\r
+* the Free Software Foundation, either version 3 of the License, or\r
+* (at your option) any later version.\r
+*\r
+* CasparCG is distributed in the hope that it will be useful,\r
+* but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+* GNU General Public License for more details.\r
+*\r
+* You should have received a copy of the GNU General Public License\r
+* along with CasparCG. If not, see <http://www.gnu.org/licenses/>.\r
+*\r
+* Author: Robert Nagy, ronag89@gmail.com\r
+*/\r
+\r
+#pragma once\r
+\r
+namespace caspar { namespace screen {\r
+\r
+void init();\r
+\r
+}}
\ No newline at end of file
diff --git a/modules/screen/screen.vcxproj b/modules/screen/screen.vcxproj
new file mode 100644 (file)
index 0000000..b3447c4
--- /dev/null
@@ -0,0 +1,150 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project DefaultTargets="Build" ToolsVersion="4.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="Release|x64">\r
+      <Configuration>Release</Configuration>\r
+      <Platform>x64</Platform>\r
+    </ProjectConfiguration>\r
+  </ItemGroup>\r
+  <PropertyGroup Label="Globals">\r
+    <ProjectGuid>{88F974F0-D09F-4788-8CF8-F563209E60C1}</ProjectGuid>\r
+    <RootNamespace>screen</RootNamespace>\r
+    <Keyword>Win32Proj</Keyword>\r
+    <ProjectName>screen</ProjectName>\r
+  </PropertyGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">\r
+    <ConfigurationType>StaticLibrary</ConfigurationType>\r
+    <CharacterSet>Unicode</CharacterSet>\r
+    <WholeProgramOptimization>true</WholeProgramOptimization>\r
+    <UseDebugLibraries>false</UseDebugLibraries>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">\r
+    <ConfigurationType>StaticLibrary</ConfigurationType>\r
+    <CharacterSet>Unicode</CharacterSet>\r
+    <UseDebugLibraries>true</UseDebugLibraries>\r
+  </PropertyGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
+  <ImportGroup Label="ExtensionSettings">\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />\r
+  </ImportGroup>\r
+  <PropertyGroup Label="UserMacros" />\r
+  <PropertyGroup>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectDir)tmp\$(Configuration)\</IntDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectDir)tmp\$(Configuration)\</IntDir>\r
+    <IncludePath Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\;..\..\dependencies64\bluefish\include\;..\..\dependencies64\boost\;..\..\dependencies64\tbb\include\;..\..\dependencies64\glew\include\;..\..\dependencies64\sfml\include\;..\..\dependencies64\ffmpeg\include\;..\..\dependencies64\asmlib\;$(IncludePath)</IncludePath>\r
+    <IncludePath Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\;..\..\dependencies64\bluefish\include\;..\..\dependencies64\boost\;..\..\dependencies64\tbb\include\;..\..\dependencies64\glew\include\;..\..\dependencies64\sfml\include\;..\..\dependencies64\ffmpeg\include\;..\..\dependencies64\asmlib\;$(IncludePath)</IncludePath>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectDir)bin\$(Configuration)\</OutDir>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectDir)bin\$(Configuration)\</OutDir>\r
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectName)</TargetName>\r
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectName)</TargetName>\r
+  </PropertyGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">\r
+    <PreBuildEvent>\r
+      <Command>\r
+      </Command>\r
+    </PreBuildEvent>\r
+    <ClCompile>\r
+      <Optimization>Disabled</Optimization>\r
+      <AdditionalIncludeDirectories>../;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <MinimalRebuild>false</MinimalRebuild>\r
+      <ExceptionHandling>Async</ExceptionHandling>\r
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
+      <SmallerTypeCheck>false</SmallerTypeCheck>\r
+      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>\r
+      <EnableEnhancedInstructionSet>NotSet</EnableEnhancedInstructionSet>\r
+      <RuntimeTypeInfo>true</RuntimeTypeInfo>\r
+      <PrecompiledHeader>Use</PrecompiledHeader>\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
+      <TreatWarningAsError>true</TreatWarningAsError>\r
+      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r
+      <FloatingPointModel>Fast</FloatingPointModel>\r
+      <ForcedIncludeFiles>common/compiler/vs/disable_silly_warnings.h</ForcedIncludeFiles>\r
+    </ClCompile>\r
+    <PostBuildEvent>\r
+      <Command>\r
+      </Command>\r
+    </PostBuildEvent>\r
+    <Lib />\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">\r
+    <PreBuildEvent>\r
+      <Command>\r
+      </Command>\r
+    </PreBuildEvent>\r
+    <ClCompile>\r
+      <Optimization>MaxSpeed</Optimization>\r
+      <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>\r
+      <IntrinsicFunctions>true</IntrinsicFunctions>\r
+      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>\r
+      <AdditionalIncludeDirectories>../;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <ExceptionHandling>Async</ExceptionHandling>\r
+      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\r
+      <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</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
+      <WholeProgramOptimization>true</WholeProgramOptimization>\r
+      <TreatWarningAsError>true</TreatWarningAsError>\r
+      <OmitFramePointers>true</OmitFramePointers>\r
+      <FloatingPointModel>Fast</FloatingPointModel>\r
+      <ForcedIncludeFiles>common/compiler/vs/disable_silly_warnings.h</ForcedIncludeFiles>\r
+    </ClCompile>\r
+    <PreLinkEvent>\r
+      <Command>\r
+      </Command>\r
+    </PreLinkEvent>\r
+    <PostBuildEvent>\r
+      <Command>\r
+      </Command>\r
+    </PostBuildEvent>\r
+    <Lib>\r
+      <LinkTimeCodeGeneration>true</LinkTimeCodeGeneration>\r
+    </Lib>\r
+  </ItemDefinitionGroup>\r
+  <ItemGroup>\r
+    <ProjectReference Include="..\..\common\common.vcxproj">\r
+      <Project>{02308602-7fe0-4253-b96e-22134919f56a}</Project>\r
+    </ProjectReference>\r
+    <ProjectReference Include="..\..\core\core.vcxproj">\r
+      <Project>{79388c20-6499-4bf6-b8b9-d8c33d7d4ddd}</Project>\r
+    </ProjectReference>\r
+    <ProjectReference Include="..\ffmpeg\ffmpeg.vcxproj">\r
+      <Project>{f6223af3-be0b-4b61-8406-98922ce521c2}</Project>\r
+    </ProjectReference>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ClCompile Include="consumer\screen_consumer.cpp">\r
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NotUsing</PrecompiledHeader>\r
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NotUsing</PrecompiledHeader>\r
+    </ClCompile>\r
+    <ClCompile Include="screen.cpp">\r
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NotUsing</PrecompiledHeader>\r
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NotUsing</PrecompiledHeader>\r
+    </ClCompile>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ClInclude Include="consumer\screen_consumer.h" />\r
+    <ClInclude Include="screen.h" />\r
+  </ItemGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
+  <ImportGroup Label="ExtensionTargets">\r
+  </ImportGroup>\r
+</Project>
\ No newline at end of file
diff --git a/modules/screen/screen.vcxproj.filters b/modules/screen/screen.vcxproj.filters
new file mode 100644 (file)
index 0000000..dedfe74
--- /dev/null
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+  <ItemGroup>\r
+    <Filter Include="source">\r
+      <UniqueIdentifier>{17d30d8e-4f28-410d-b8f9-ce880259b11a}</UniqueIdentifier>\r
+    </Filter>\r
+    <Filter Include="source\consumer">\r
+      <UniqueIdentifier>{013ef3ed-0241-481f-b887-a54e4749045f}</UniqueIdentifier>\r
+    </Filter>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ClCompile Include="consumer\screen_consumer.cpp">\r
+      <Filter>source\consumer</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="screen.cpp">\r
+      <Filter>source</Filter>\r
+    </ClCompile>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ClInclude Include="consumer\screen_consumer.h">\r
+      <Filter>source\consumer</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="screen.h">\r
+      <Filter>source</Filter>\r
+    </ClInclude>\r
+  </ItemGroup>\r
+</Project>
\ No newline at end of file
index 8c5c37d5bef0c87a50b34787c14ad49ed33041be..3336630086ede317b6418ef8b790986717547da6 100644 (file)
@@ -53,7 +53,7 @@
 #include <modules/flash/producer/cg_producer.h>\r
 #include <modules/ffmpeg/producer/util/util.h>\r
 #include <modules/image/image.h>\r
-#include <modules/ogl/ogl.h>\r
+#include <modules/screen/screen.h>\r
 #include <modules/reroute/producer/reroute_producer.h>\r
 \r
 #include <algorithm>\r
index 1027168aac5c77e3c694cbabe332f57ce97d9d80..2d2a9969fa711f81a1ead78500b3e7852bc3944a 100644 (file)
 \r
 #include "server.h"\r
 \r
+#include <accelerator/ogl/context.h>\r
+#include <accelerator/image/image_mixer.h>\r
+\r
 #include <common/env.h>\r
 #include <common/except.h>\r
 #include <common/utf.h>\r
 \r
-#include <core/mixer/gpu/accelerator.h>\r
 #include <core/video_channel.h>\r
 #include <core/video_format.h>\r
 #include <core/producer/stage.h>\r
 #include <modules/ffmpeg/ffmpeg.h>\r
 #include <modules/flash/flash.h>\r
 #include <modules/oal/oal.h>\r
-#include <modules/ogl/ogl.h>\r
+#include <modules/screen/screen.h>\r
 #include <modules/image/image.h>\r
 \r
 #include <modules/oal/consumer/oal_consumer.h>\r
 #include <modules/bluefish/consumer/bluefish_consumer.h>\r
 #include <modules/decklink/consumer/decklink_consumer.h>\r
-#include <modules/ogl/consumer/ogl_consumer.h>\r
+#include <modules/screen/consumer/screen_consumer.h>\r
 #include <modules/ffmpeg/consumer/ffmpeg_consumer.h>\r
 \r
 #include <protocol/amcp/AMCPProtocolStrategy.h>\r
@@ -64,12 +66,12 @@ using namespace protocol;
 \r
 struct server::impl : boost::noncopyable\r
 {\r
-       spl::shared_ptr<gpu::accelerator>                                       ogl_;\r
-       std::vector<spl::shared_ptr<IO::AsyncEventServer>> async_servers_;      \r
-       std::vector<spl::shared_ptr<video_channel>>             channels_;\r
+       spl::shared_ptr<accelerator::ogl::context>                      ogl_;\r
+       std::vector<spl::shared_ptr<IO::AsyncEventServer>>      async_servers_; \r
+       std::vector<spl::shared_ptr<video_channel>>                     channels_;\r
 \r
        impl()          \r
-               : ogl_(gpu::accelerator::create())\r
+               : ogl_(accelerator::ogl::context::create())\r
        {                       \r
                ffmpeg::init();\r
                CASPAR_LOG(info) << L"Initialized ffmpeg module.";\r
@@ -83,7 +85,7 @@ struct server::impl : boost::noncopyable
                oal::init();              \r
                CASPAR_LOG(info) << L"Initialized oal module.";\r
                                                          \r
-               ogl::init();              \r
+               screen::init();           \r
                CASPAR_LOG(info) << L"Initialized ogl module.";\r
 \r
                image::init();            \r
@@ -117,7 +119,7 @@ struct server::impl : boost::noncopyable
                        if(format_desc.format == video_format::invalid)\r
                                BOOST_THROW_EXCEPTION(caspar_exception() << msg_info("Invalid video-mode."));\r
                        \r
-                       channels_.push_back(spl::make_shared<video_channel>(static_cast<int>(channels_.size()+1), format_desc, ogl_));\r
+                       channels_.push_back(spl::make_shared<video_channel>(static_cast<int>(channels_.size()+1), format_desc, spl::make_shared<accelerator::ogl::image_mixer>(ogl_)));\r
                        \r
                        BOOST_FOREACH(auto& xml_consumer, xml_channel.second.get_child(L"consumers"))\r
                        {\r
@@ -125,7 +127,7 @@ struct server::impl : boost::noncopyable
                                {\r
                                        auto name = xml_consumer.first;\r
                                        if(name == L"screen")\r
-                                               channels_.back()->output()->add(ogl::create_consumer(xml_consumer.second));                                     \r
+                                               channels_.back()->output()->add(caspar::screen::create_consumer(xml_consumer.second));                                  \r
                                        if(name == L"bluefish")                                 \r
                                                channels_.back()->output()->add(bluefish::create_consumer(xml_consumer.second));                                        \r
                                        else if(name == L"decklink")                                    \r
@@ -146,7 +148,7 @@ struct server::impl : boost::noncopyable
 \r
                // Dummy diagnostics channel\r
                if(env::properties().get(L"configuration.channel-grid", false))\r
-                       channels_.push_back(spl::make_shared<video_channel>(static_cast<int>(channels_.size()+1), core::video_format_desc(core::video_format::x576p2500), ogl_));\r
+                       channels_.push_back(spl::make_shared<video_channel>(static_cast<int>(channels_.size()+1), core::video_format_desc(core::video_format::x576p2500), spl::make_shared<accelerator::ogl::image_mixer>(ogl_)));\r
        }\r
                \r
        void setup_controllers(const boost::property_tree::wptree& pt)\r
index 02cfa0f675aa9bee25703c078ef95cb4d5b03f88..1b2e3df097dbff1e19b5a29de9d1472db1b5d2e2 100644 (file)
@@ -25,6 +25,9 @@
     </ClCompile>\r
   </ItemGroup>\r
   <ItemGroup>\r
+    <ProjectReference Include="..\accelerator\accelerator.vcxproj">\r
+      <Project>{8493d01a-f642-454c-8c44-88b38e2a3ef8}</Project>\r
+    </ProjectReference>\r
     <ProjectReference Include="..\common\common.vcxproj">\r
       <Project>{02308602-7fe0-4253-b96e-22134919f56a}</Project>\r
     </ProjectReference>\r
     <ProjectReference Include="..\modules\oal\oal.vcxproj">\r
       <Project>{82ed7ed6-8a15-40ec-a8af-f5e712e0da68}</Project>\r
     </ProjectReference>\r
-    <ProjectReference Include="..\modules\ogl\ogl.vcxproj">\r
-      <Project>{88f974f0-d09f-4788-8cf8-f563209e60c1}</Project>\r
-    </ProjectReference>\r
     <ProjectReference Include="..\modules\reroute\reroute.vcxproj">\r
       <Project>{7d58bd57-fdd5-46e6-a23b-ed14b5314a0e}</Project>\r
     </ProjectReference>\r
+    <ProjectReference Include="..\modules\screen\screen.vcxproj">\r
+      <Project>{88f974f0-d09f-4788-8cf8-f563209e60c1}</Project>\r
+    </ProjectReference>\r
     <ProjectReference Include="..\protocol\protocol.vcxproj">\r
       <Project>{2040b361-1fb6-488e-84a5-38a580da90de}</Project>\r
     </ProjectReference>\r