<ClInclude Include="concurrency\lock.h" />\r
<ClInclude Include="concurrency\target.h" />\r
<ClInclude Include="diagnostics\graph.h" />\r
+ <ClInclude Include="no_copy.h" />\r
<ClInclude Include="exception\exceptions.h" />\r
<ClInclude Include="exception\win32_exception.h" />\r
+ <ClInclude Include="forward.h" />\r
<ClInclude Include="gl\gl_check.h" />\r
- <ClInclude Include="log\log.h" />\r
+ <ClInclude Include="log.h" />\r
<ClInclude Include="memory\memshfl.h" />\r
<ClInclude Include="memory\page_locked_allocator.h" />\r
<ClInclude Include="memory\safe_ptr.h" />\r
<ClInclude Include="env.h" />\r
<ClInclude Include="os\windows\current_version.h" />\r
<ClInclude Include="os\windows\system_info.h" />\r
+ <ClInclude Include="enum_class.h" />\r
<ClInclude Include="stdafx.h" />\r
- <ClInclude Include="utility\assert.h" />\r
+ <ClInclude Include="utf.h" />\r
+ <ClInclude Include="prec_timer.h" />\r
<ClInclude Include="utility\move_on_copy.h" />\r
<ClInclude Include="utility\param.h" />\r
- <ClInclude Include="utility\string.h" />\r
- <ClInclude Include="utility\timer.h" />\r
<ClInclude Include="utility\tweener.h" />\r
</ItemGroup>\r
<ItemGroup>\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="log\log.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="log.cpp" />\r
<ClCompile Include="env.cpp" />\r
<ClCompile Include="stdafx.cpp">\r
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>\r
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Profile|x64'">Create</PrecompiledHeader>\r
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Develop|x64'">Create</PrecompiledHeader>\r
</ClCompile>\r
- <ClCompile Include="utility\string.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="utf.cpp" />\r
+ <ClCompile Include="prec_timer.cpp" />\r
<ClCompile Include="utility\tweener.cpp">\r
- <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">../StdAfx.h</PrecompiledHeaderFile>\r
- <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|x64'">../StdAfx.h</PrecompiledHeaderFile>\r
+ <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">../stdafx.h</PrecompiledHeaderFile>\r
+ <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|x64'">../stdafx.h</PrecompiledHeaderFile>\r
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Use</PrecompiledHeader>\r
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Develop|x64'">Use</PrecompiledHeader>\r
+ <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Develop|x64'">../stdafx.h</PrecompiledHeaderFile>\r
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Profile|x64'">Use</PrecompiledHeader>\r
+ <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Profile|x64'">../stdafx.h</PrecompiledHeaderFile>\r
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Use</PrecompiledHeader>\r
</ClCompile>\r
</ItemGroup>\r
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
<Filter Include="source\memory">\r
<UniqueIdentifier>{9259676d-c225-4422-a50e-30d152d78dc2}</UniqueIdentifier>\r
</Filter>\r
- <Filter Include="source\log">\r
- <UniqueIdentifier>{3b529e9b-c729-4c8a-8166-0cb8d8030973}</UniqueIdentifier>\r
- </Filter>\r
<Filter Include="source\gl">\r
<UniqueIdentifier>{0d94bbc2-e196-4618-a90b-19392a3a0a8e}</UniqueIdentifier>\r
</Filter>\r
<ClCompile Include="exception\win32_exception.cpp">\r
<Filter>source\exception</Filter>\r
</ClCompile>\r
- <ClCompile Include="log\log.cpp">\r
- <Filter>source\log</Filter>\r
- </ClCompile>\r
<ClCompile Include="diagnostics\graph.cpp">\r
<Filter>source\diagnostics</Filter>\r
</ClCompile>\r
<ClCompile Include="stdafx.cpp" />\r
- <ClCompile Include="utility\string.cpp">\r
- <Filter>source\utility</Filter>\r
- </ClCompile>\r
<ClCompile Include="gl\gl_check.cpp">\r
<Filter>source\gl</Filter>\r
</ClCompile>\r
<ClCompile Include="utility\tweener.cpp">\r
<Filter>source\utility</Filter>\r
</ClCompile>\r
+ <ClCompile Include="utf.cpp">\r
+ <Filter>source</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="prec_timer.cpp">\r
+ <Filter>source</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="log.cpp">\r
+ <Filter>source</Filter>\r
+ </ClCompile>\r
</ItemGroup>\r
<ItemGroup>\r
<ClInclude Include="exception\exceptions.h">\r
<ClInclude Include="concurrency\executor.h">\r
<Filter>source\concurrency</Filter>\r
</ClInclude>\r
- <ClInclude Include="log\log.h">\r
- <Filter>source\log</Filter>\r
- </ClInclude>\r
<ClInclude Include="gl\gl_check.h">\r
<Filter>source\gl</Filter>\r
</ClInclude>\r
<Filter>source\diagnostics</Filter>\r
</ClInclude>\r
<ClInclude Include="stdafx.h" />\r
- <ClInclude Include="utility\assert.h">\r
- <Filter>source\utility</Filter>\r
- </ClInclude>\r
- <ClInclude Include="utility\string.h">\r
- <Filter>source\utility</Filter>\r
- </ClInclude>\r
- <ClInclude Include="utility\timer.h">\r
- <Filter>source\utility</Filter>\r
- </ClInclude>\r
<ClInclude Include="utility\tweener.h">\r
<Filter>source\utility</Filter>\r
</ClInclude>\r
<ClInclude Include="concurrency\lock.h">\r
<Filter>source\concurrency</Filter>\r
</ClInclude>\r
+ <ClInclude Include="utf.h">\r
+ <Filter>source</Filter>\r
+ </ClInclude>\r
+ <ClInclude Include="prec_timer.h">\r
+ <Filter>source</Filter>\r
+ </ClInclude>\r
+ <ClInclude Include="log.h">\r
+ <Filter>source</Filter>\r
+ </ClInclude>\r
+ <ClInclude Include="forward.h">\r
+ <Filter>source</Filter>\r
+ </ClInclude>\r
+ <ClInclude Include="no_copy.h">\r
+ <Filter>source</Filter>\r
+ </ClInclude>\r
+ <ClInclude Include="enum_class.h">\r
+ <Filter>source</Filter>\r
+ </ClInclude>\r
</ItemGroup>\r
</Project>
\ No newline at end of file
\r
#include "executor.h"\r
\r
-#include "../log/log.h"\r
+#include "../log.h"\r
#include "../exception/exceptions.h"\r
\r
#define NOMINMAX\r
#pragma once\r
\r
#include "../exception/win32_exception.h"\r
-#include "../exception/exceptions.h"\r
-#include "../utility/string.h"\r
#include "../utility/move_on_copy.h"\r
-#include "../log/log.h"\r
+#include "../log.h"\r
+\r
+#include <Windows.h>\r
\r
#include <tbb/atomic.h>\r
#include <tbb/concurrent_queue.h>\r
#pragma once\r
\r
#include "../memory/safe_ptr.h"\r
+#include "../no_copy.h"\r
\r
#include <string>\r
#include <tuple>\r
\r
class graph\r
{\r
+ CASPAR_NO_COPY(graph);\r
+\r
friend void register_graph(const safe_ptr<graph>& graph);\r
public:\r
graph();\r
--- /dev/null
+#pragma once\r
+\r
+namespace caspar {\r
+\r
+template<typename def, typename inner = typename def::type>\r
+class enum_class : public def\r
+{\r
+ typedef typename def::type type;\r
+ inner val_; \r
+public: \r
+ explicit enum_class(int v) : val_(static_cast<type>(v)) {}\r
+ enum_class(type v) : val_(v) {}\r
+ inner value() const { return val_; }\r
+ \r
+ bool operator==(const enum_class& s) const { return val_ == s.val_; }\r
+ bool operator!=(const enum_class& s) const { return val_ != s.val_; }\r
+ bool operator<(const enum_class& s) const { return val_ < s.val_; }\r
+ bool operator<=(const enum_class& s) const { return val_ <= s.val_; }\r
+ bool operator>(const enum_class& s) const { return val_ > s.val_; }\r
+ bool operator>=(const enum_class& s) const { return val_ >= s.val_; }\r
+\r
+ enum_class operator&(const enum_class& s) const\r
+ {\r
+ return enum_class(static_cast<type>(val_ & s.val_));\r
+ }\r
+\r
+ enum_class operator|(const enum_class& s) const\r
+ {\r
+ return enum_class(static_cast<type>(val_ | s.val_));\r
+ }\r
+\r
+ //operator inner()\r
+ //{\r
+ // return val_;\r
+ //}\r
+};\r
+\r
+#define CASPAR_ENUM_CLASS_DEF(name) name ## _def\r
+#define CASPAR_BEGIN_ENUM_CLASS typedef struct { enum type \r
+#define CASPAR_END_ENUM_CLASS(name) ;} CASPAR_ENUM_CLASS_DEF(name); typedef enum_class<CASPAR_ENUM_CLASS_DEF(name)> name;\r
+\r
+}
\ No newline at end of file
\r
#include "../version.h"\r
\r
-#include "log/log.h"\r
+#include "log.h"\r
#include "exception/exceptions.h"\r
-#include "utility/string.h"\r
+#include "string.h"\r
\r
#include <boost/property_tree/ptree.hpp>\r
#include <boost/property_tree/xml_parser.hpp>\r
\r
#pragma once\r
\r
+#include "../utf.h"\r
+\r
#include <exception>\r
#include <boost/exception/all.hpp>\r
#include <boost/exception/error_info.hpp>\r
#include <boost/throw_exception.hpp>\r
\r
-#include "../utility/string.h"\r
-\r
namespace caspar {\r
\r
typedef boost::error_info<struct tag_arg_name_info, std::string> arg_name_info;\r
\r
#include "win32_exception.h"\r
\r
-#include "../log/log.h"\r
+#include <windows.h>\r
\r
namespace caspar {\r
\r
\r
#include "exceptions.h"\r
\r
-#define NOMINMAX\r
-#define WIN32_LEAN_AND_MEAN\r
+#include "../no_copy.h"\r
\r
-#include <windows.h>\r
+struct _EXCEPTION_RECORD;\r
+struct _EXCEPTION_POINTERS;\r
+\r
+typedef _EXCEPTION_RECORD EXCEPTION_RECORD;\r
+typedef _EXCEPTION_POINTERS EXCEPTION_POINTERS;\r
\r
namespace caspar {\r
\r
class win32_exception : public std::exception\r
{\r
+ //CASPAR_NO_COPY(win32_exception);\r
public:\r
typedef const void* address;\r
static void install_handler();\r
\r
class win32_access_violation : public win32_exception\r
{\r
+ //CASPAR_NO_COPY(win32_access_violation);\r
+\r
mutable char messageBuffer_[256];\r
\r
public:\r
--- /dev/null
+#pragma once\r
+\r
+#define FORWARD0(expr) expr\r
+#define FORWARD1(a1, expr) namespace a1 { expr; }\r
+#define FORWARD2(a1, a2, expr) namespace a1 { namespace a2 { expr; }}\r
+#define FORWARD3(a1, a2, a3, expr) namespace a1 { namespace a2 { namespace a3 { expr; } }}
\ No newline at end of file
\r
#include "gl_check.h"\r
\r
-#include <GL/glew.h>\r
-\r
-#include "../exception/exceptions.h"\r
-#include "../log/log.h"\r
+#include "../log.h"\r
\r
-#include <boost/lexical_cast.hpp>\r
+#include <GL/glew.h>\r
\r
namespace caspar { namespace gl { \r
\r
* Author: Robert Nagy, ronag89@gmail.com\r
*/\r
\r
-#include "../stdafx.h"\r
+#include "stdafx.h"\r
\r
#if defined(_MSC_VER)\r
#pragma warning (disable : 4100) // 'identifier' : unreferenced formal parameter\r
\r
#include "log.h"\r
\r
-#include "../exception/exceptions.h"\r
-#include "../utility/string.h"\r
+#include "utf.h"\r
+\r
+#include "exception/exceptions.h"\r
+\r
#include <ios>\r
#include <string>\r
#include <ostream>\r
#pragma warning (disable : 4996) // _CRT_SECURE_NO_WARNINGS\r
#endif\r
\r
-#include "../utility/string.h"\r
-\r
#include <boost/log/detail/prologue.hpp>\r
#include <boost/log/keywords/severity.hpp>\r
#include <boost/log/sources/global_logger_storage.hpp>\r
\r
#include <intrin.h>\r
\r
-#include <assert.h>\r
-\r
-#include <tbb/parallel_for.h>\r
-\r
namespace caspar {\r
\r
static void* aligned_memshfl(void* dest, const void* source, size_t count, int m1, int m2, int m3, int m4)\r
--- /dev/null
+#pragma once\r
+\r
+#define CASPAR_NO_COPY(TypeName) \\r
+ TypeName(const TypeName&); \\r
+ void operator=(const TypeName&)\r
--- /dev/null
+/*\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"\r
+\r
+#include "prec_timer.h"\r
+\r
+#define NOMINMAX\r
+\r
+#include <windows.h>\r
+#include <Mmsystem.h>\r
+\r
+namespace caspar {\r
+ \r
+prec_timer::prec_timer()\r
+ : time_(0)\r
+{\r
+}\r
+\r
+// Author: Ryan M. Geiss\r
+// http://www.geisswerks.com/ryan/FAQS/timing.html\r
+void prec_timer::tick(double interval)\r
+{ \r
+ auto t = ::timeGetTime();\r
+\r
+ if (time_ != 0)\r
+ {\r
+ auto ticks_to_wait = static_cast<DWORD>(interval*1000.0);\r
+ bool done = 0;\r
+ do\r
+ { \r
+ auto ticks_passed = t - time_;\r
+ auto ticks_left = ticks_to_wait - ticks_passed;\r
+\r
+ if (t < time_) // time wrap\r
+ done = 1;\r
+ if (ticks_passed >= ticks_to_wait)\r
+ done = 1;\r
+ \r
+ if (!done)\r
+ {\r
+ // if > 0.002s left, do Sleep(1), which will actually sleep some \r
+ // steady amount, probably 1-2 ms,\r
+ // and do so in a nice way (cpu meter drops; laptop battery spared).\r
+ // otherwise, do a few Sleep(0)'s, which just give up the timeslice,\r
+ // but don't really save cpu or battery, but do pass a tiny\r
+ // amount of time.\r
+ if (ticks_left > 2)\r
+ Sleep(1);\r
+ else \r
+ for (int i = 0; i < 10; ++i) \r
+ Sleep(0); // causes thread to give up its timeslice\r
+ }\r
+\r
+ t = ::timeGetTime();\r
+ }\r
+ while (!done); \r
+ }\r
+\r
+ time_ = t;\r
+} \r
+\r
+}
\ No newline at end of file
\r
#pragma once\r
\r
-#include "../log/log.h"\r
+namespace caspar {\r
+ \r
+class prec_timer\r
+{\r
+public:\r
+ prec_timer();\r
\r
-#ifdef _MSC_VER\r
-#define _CASPAR_DBG_BREAK _CrtDbgBreak()\r
-#else\r
-#define _CASPAR_DBG_BREAK\r
-#endif\r
+ // Author: Ryan M. Geiss\r
+ // http://www.geisswerks.com/ryan/FAQS/timing.html\r
+ void tick(double interval);\r
\r
-#define CASPAR_VERIFY_EXPR_STR(str) #str\r
+private: \r
+ DWORD time_;\r
+};\r
\r
-#define CASPAR_VERIFY(expr) do{if(!(expr)){ CASPAR_LOG(warning) << "Assertion Failed: " << \\r
- CASPAR_VERIFY_EXPR_STR(expr) << " " \\r
- << "file:" << __FILE__ << " " \\r
- << "line:" << __LINE__ << " "; \\r
- _CASPAR_DBG_BREAK;\\r
- }}while(0);\r
\r
-#ifdef _DEBUG\r
-#define CASPAR_ASSERT(expr) CASPAR_VERIFY(expr)\r
-#else\r
-#define CASPAR_ASSERT(expr)\r
-#endif
\ No newline at end of file
+}
\ No newline at end of file
\r
#define NOMINMAX\r
#define WIN32_LEAN_AND_MEAN\r
+\r
+#include <windows.h>
\ No newline at end of file
* Author: Robert Nagy, ronag89@gmail.com\r
*/\r
\r
-#include "../stdafx.h"\r
+#include "stdafx.h"\r
+\r
+#include "utf.h"\r
\r
#pragma warning(push, 1)\r
\r
std::string u8(const std::wstring& str); \r
std::string u8(const std::string& str);\r
\r
-template <typename T>\r
-inline T lexical_cast_or_default(const std::wstring str, T fail_value = T())\r
-{\r
- try\r
- {\r
- return boost::lexical_cast<T>(str);\r
- }\r
- catch(boost::bad_lexical_cast&)\r
- {\r
- return fail_value;\r
- }\r
-}\r
-\r
}
\ No newline at end of file
+++ /dev/null
-/*\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
-#define NOMINMAX\r
-\r
-#include <windows.h>\r
-#include <Mmsystem.h>\r
-\r
-namespace caspar {\r
- \r
-class high_prec_timer\r
-{\r
-public:\r
- high_prec_timer()\r
- : time_(0)\r
- {\r
- }\r
-\r
- // Author: Ryan M. Geiss\r
- // http://www.geisswerks.com/ryan/FAQS/timing.html\r
- void tick(double interval)\r
- { \r
- auto t = ::timeGetTime();\r
-\r
- if (time_ != 0)\r
- {\r
- auto ticks_to_wait = static_cast<DWORD>(interval*1000.0);\r
- bool done = 0;\r
- do\r
- { \r
- auto ticks_passed = t - time_;\r
- auto ticks_left = ticks_to_wait - ticks_passed;\r
-\r
- if (t < time_) // time wrap\r
- done = 1;\r
- if (ticks_passed >= ticks_to_wait)\r
- done = 1;\r
- \r
- if (!done)\r
- {\r
- // if > 0.002s left, do Sleep(1), which will actually sleep some \r
- // steady amount, probably 1-2 ms,\r
- // and do so in a nice way (cpu meter drops; laptop battery spared).\r
- // otherwise, do a few Sleep(0)'s, which just give up the timeslice,\r
- // but don't really save cpu or battery, but do pass a tiny\r
- // amount of time.\r
- if (ticks_left > 2)\r
- Sleep(1);\r
- else \r
- for (int i = 0; i < 10; ++i) \r
- Sleep(0); // causes thread to give up its timeslice\r
- }\r
-\r
- t = ::timeGetTime();\r
- }\r
- while (!done); \r
- }\r
-\r
- time_ = t;\r
- } \r
-private: \r
- DWORD time_;\r
-};\r
-\r
-\r
-}
\ No newline at end of file
#endif\r
\r
#define NOMINMAX\r
+#define WIN32_LEAN_AND_MEAN\r
\r
#include <GL/glew.h>\r
\r
#include <tbb/concurrent_queue.h>\r
#include <tbb/concurrent_unordered_map.h>\r
\r
+#include <boost/assert.hpp>\r
#include <boost/assign.hpp>\r
#include <boost/circular_buffer.hpp>\r
#include <boost/timer.hpp>\r
#include <boost/property_tree/ptree.hpp>\r
#include <boost/property_tree/xml_parser.hpp>\r
\r
-#include <common/utility/string.h>\r
+#include <common/utf.h>\r
#include <common/memory/safe_ptr.h>\r
//#include "../common/concurrency/executor.h" // Can't include this due to MSVC lambda bug\r
\r
-#include <common/log/log.h>\r
+#include <common/log.h>\r
#include <common/exception/exceptions.h>\r
#include <common/exception/win32_exception.h>\r
-#include <common/utility/assert.h>\r
\r
#pragma once\r
\r
+#include <common/no_copy.h>\r
#include <common/memory/safe_ptr.h>\r
\r
-#include <boost/noncopyable.hpp>\r
#include <boost/property_tree/ptree_fwd.hpp>\r
\r
#include <functional>\r
\r
namespace caspar { namespace core {\r
\r
-class read_frame;\r
-struct video_format_desc;\r
-\r
-struct frame_consumer : boost::noncopyable\r
+struct frame_consumer\r
{\r
+ CASPAR_NO_COPY(frame_consumer);\r
+\r
+ frame_consumer(){}\r
virtual ~frame_consumer() {}\r
\r
- virtual bool send(const safe_ptr<read_frame>& frame) = 0;\r
- virtual void initialize(const video_format_desc& format_desc, int channel_index) = 0;\r
+ virtual bool send(const safe_ptr<class read_frame>& frame) = 0;\r
+ virtual void initialize(const struct video_format_desc& format_desc, int channel_index) = 0;\r
virtual std::wstring print() const = 0;\r
virtual boost::property_tree::wptree info() const = 0;\r
virtual bool has_synchronization_clock() const {return true;}\r
\r
safe_ptr<frame_consumer> create_consumer_cadence_guard(const safe_ptr<frame_consumer>& consumer);\r
\r
-typedef std::function<safe_ptr<core::frame_consumer>(const std::vector<std::wstring>&)> consumer_factory_t;\r
+typedef std::function<safe_ptr<frame_consumer>(const std::vector<std::wstring>&)> consumer_factory_t;\r
\r
void register_consumer_factory(const consumer_factory_t& factory);\r
-safe_ptr<core::frame_consumer> create_consumer(const std::vector<std::wstring>& params);\r
+safe_ptr<frame_consumer> create_consumer(const std::vector<std::wstring>& params);\r
\r
}}
\ No newline at end of file
\r
#include "output.h"\r
\r
+#include "frame_consumer.h"\r
+\r
#include "../video_format.h"\r
#include "../mixer/gpu/ogl_device.h"\r
#include "../mixer/read_frame.h"\r
\r
#include <common/concurrency/executor.h>\r
-#include <common/utility/assert.h>\r
-#include <common/utility/timer.h>\r
+#include <common/diagnostics/graph.h>\r
+#include <common/prec_timer.h>\r
#include <common/memory/memshfl.h>\r
#include <common/env.h>\r
\r
+#include <boost/assert.hpp>\r
#include <boost/circular_buffer.hpp>\r
#include <boost/timer.hpp>\r
#include <boost/range/algorithm.hpp>\r
\r
std::map<int, safe_ptr<frame_consumer>> consumers_;\r
\r
- high_prec_timer sync_timer_;\r
+ prec_timer sync_timer_;\r
\r
boost::circular_buffer<safe_ptr<read_frame>> frames_;\r
\r
return info;\r
}, high_priority));\r
}\r
-\r
- bool empty()\r
- {\r
- return executor_.invoke([this]\r
- {\r
- return consumers_.empty();\r
- });\r
- }\r
};\r
\r
output::output(const safe_ptr<diagnostics::graph>& graph, const video_format_desc& format_desc, int channel_index) : impl_(new impl(graph, format_desc, channel_index)){}\r
void output::send(const std::pair<safe_ptr<read_frame>, std::shared_ptr<void>>& frame) {impl_->send(frame); }\r
void output::set_video_format_desc(const video_format_desc& format_desc){impl_->set_video_format_desc(format_desc);}\r
boost::unique_future<boost::property_tree::wptree> output::info() const{return impl_->info();}\r
-bool output::empty() const{return impl_->empty();}\r
}}
\ No newline at end of file
\r
#pragma once\r
\r
-#include "../consumer/frame_consumer.h"\r
-\r
+#include <common/forward.h>\r
+#include <common/no_copy.h>\r
#include <common/memory/safe_ptr.h>\r
#include <common/concurrency/target.h>\r
-#include <common/diagnostics/graph.h>\r
\r
-#include <boost/noncopyable.hpp>\r
#include <boost/property_tree/ptree_fwd.hpp>\r
-#include <boost/thread/future.hpp>\r
+\r
+FORWARD1(boost, template<typename> class unique_future)\r
+FORWARD2(caspar, diagnostics, class graph);\r
\r
namespace caspar { namespace core {\r
\r
-class output sealed : public target<std::pair<safe_ptr<read_frame>, std::shared_ptr<void>>>\r
- , boost::noncopyable\r
+class output sealed : public target<std::pair<safe_ptr<class read_frame>, std::shared_ptr<void>>>\r
{\r
+ CASPAR_NO_COPY(output);\r
public:\r
- explicit output(const safe_ptr<diagnostics::graph>& graph, const video_format_desc& format_desc, int channel_index);\r
+ explicit output(const safe_ptr<diagnostics::graph>& graph, const struct video_format_desc& format_desc, int channel_index);\r
\r
// target\r
\r
- virtual void send( const std::pair<safe_ptr<read_frame>, std::shared_ptr<void>>& frame) override;\r
+ virtual void send(const std::pair<safe_ptr<class read_frame>, std::shared_ptr<void>>& frame) override;\r
\r
// output\r
\r
- void add(const safe_ptr<frame_consumer>& consumer);\r
- void add(int index, const safe_ptr<frame_consumer>& consumer);\r
- void remove(const safe_ptr<frame_consumer>& consumer);\r
+ void add(const safe_ptr<struct frame_consumer>& consumer);\r
+ void add(int index, const safe_ptr<struct frame_consumer>& consumer);\r
+ void remove(const safe_ptr<struct frame_consumer>& consumer);\r
void remove(int index);\r
\r
- void set_video_format_desc(const video_format_desc& format_desc);\r
+ void set_video_format_desc(const struct video_format_desc& format_desc);\r
\r
boost::unique_future<boost::property_tree::wptree> info() const;\r
-\r
- bool empty() const;\r
private:\r
struct impl;\r
safe_ptr<impl> impl_;\r
<ClInclude Include="mixer\audio\audio_mixer.h">\r
<Filter>source\mixer\audio</Filter>\r
</ClInclude>\r
- <ClInclude Include="producer\separated\separated_producer.h">\r
- <Filter>source\producer\separated</Filter>\r
- </ClInclude>\r
<ClInclude Include="mixer\read_frame.h">\r
<Filter>source\mixer</Filter>\r
</ClInclude>\r
<ClInclude Include="producer\channel\channel_producer.h">\r
<Filter>source\producer\channel</Filter>\r
</ClInclude>\r
+ <ClInclude Include="producer\separated\separated_producer.h">\r
+ <Filter>source\producer\separated</Filter>\r
+ </ClInclude>\r
</ItemGroup>\r
<ItemGroup>\r
<ClCompile Include="producer\transition\transition_producer.cpp">\r
#include <core/producer/frame/frame_transform.h>\r
#include <common/diagnostics/graph.h>\r
\r
-#include <tbb/cache_aligned_allocator.h>\r
-\r
#include <boost/range/adaptors.hpp>\r
#include <boost/range/distance.hpp>\r
\r
\r
#pragma once\r
\r
+#include <common/forward.h>\r
+#include <common/no_copy.h>\r
#include <common/memory/safe_ptr.h>\r
\r
#include <core/producer/frame/frame_visitor.h>\r
\r
-#include <boost/noncopyable.hpp>\r
-\r
#include <tbb/cache_aligned_allocator.h>\r
\r
#include <vector>\r
\r
-namespace caspar {\r
- \r
-namespace diagnostics {\r
- \r
-class graph;\r
-\r
-}\r
-\r
-namespace core {\r
+FORWARD2(caspar, diagnostics, class graph);\r
\r
-struct video_format_desc;\r
- \r
+namespace caspar { namespace core {\r
+ \r
typedef std::vector<int32_t, tbb::cache_aligned_allocator<int32_t>> audio_buffer;\r
\r
-class audio_mixer sealed : public core::frame_visitor, boost::noncopyable\r
+class audio_mixer sealed : public frame_visitor\r
{\r
+ CASPAR_NO_COPY(audio_mixer);\r
public:\r
audio_mixer(const safe_ptr<diagnostics::graph>& graph);\r
\r
virtual void visit(core::write_frame& frame);\r
virtual void end();\r
\r
- audio_buffer operator()(const video_format_desc& format_desc);\r
+ audio_buffer operator()(const struct video_format_desc& format_desc);\r
\r
private:\r
struct impl;\r
\r
#include <algorithm>\r
#include <vector>\r
-\r
#include <stdint.h>\r
\r
#include <tbb/cache_aligned_allocator.h>\r
namespace caspar { namespace core {\r
\r
template<typename T>\r
-static std::vector<int8_t, tbb::cache_aligned_allocator<int8_t>> audio_32_to_24(const T& audio_data)\r
+std::vector<int8_t, tbb::cache_aligned_allocator<int8_t>> audio_32_to_24(const T& audio_data)\r
{ \r
auto size = std::distance(std::begin(audio_data), std::end(audio_data));\r
auto input8 = reinterpret_cast<const int8_t*>(&(*std::begin(audio_data)));\r
}\r
\r
template<typename T>\r
-static std::vector<int16_t, tbb::cache_aligned_allocator<int16_t>> audio_32_to_16(const T& audio_data)\r
+std::vector<int16_t, tbb::cache_aligned_allocator<int16_t>> audio_32_to_16(const T& audio_data)\r
{ \r
auto size = std::distance(std::begin(audio_data), std::end(audio_data));\r
auto input32 = &(*std::begin(audio_data));\r
const int stride_;\r
\r
fence fence_;\r
-\r
public:\r
impl(int width, int height, int stride) \r
: width_(width)\r
\r
#pragma once\r
\r
+#include <common/no_copy.h>\r
#include <common/memory/safe_ptr.h>\r
\r
-#include <boost/noncopyable.hpp>\r
-\r
-#include <memory>\r
-\r
namespace caspar { namespace core {\r
\r
-class device_buffer : boost::noncopyable\r
+class device_buffer\r
{\r
-public:\r
- \r
+ CASPAR_NO_COPY(device_buffer);\r
+public: \r
int stride() const; \r
int width() const;\r
int height() const;\r
\r
namespace caspar { namespace core {\r
\r
-class ogl_device;\r
-\r
// Used to avoid blocking ogl thread for async operations. \r
// This is imported when several objects use the same ogl context.\r
// Based on http://www.opengl.org/registry/specs/ARB/sync.txt.\r
fence();\r
void set();\r
bool ready() const;\r
- void wait(ogl_device& ogl);\r
+ void wait(class ogl_device& ogl);\r
private:\r
struct impl;\r
std::shared_ptr<impl> impl_;\r
\r
#pragma once\r
\r
-#include <boost/noncopyable.hpp>\r
-\r
+#include <common/no_copy.h>\r
#include <common/memory/safe_ptr.h>\r
\r
namespace caspar { namespace core {\r
-\r
-class ogl_device;\r
- \r
-class host_buffer : boost::noncopyable\r
+ \r
+class host_buffer\r
{\r
+ CASPAR_NO_COPY(host_buffer);\r
public:\r
enum usage_t\r
{\r
\r
void begin_read(int width, int height, unsigned int format);\r
bool ready() const;\r
- void wait(ogl_device& ogl);\r
+ void wait(class ogl_device& ogl);\r
private:\r
friend class ogl_device;\r
host_buffer(int size, usage_t usage);\r
#include "shader.h"\r
\r
#include <common/exception/exceptions.h>\r
-#include <common/utility/assert.h>\r
#include <common/gl/gl_check.h>\r
\r
+#include <boost/assert.hpp>\r
#include <boost/foreach.hpp>\r
\r
#include <gl/glew.h>\r
\r
safe_ptr<device_buffer> ogl_device::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
+ BOOST_VERIFY(stride > 0 && stride < 5);\r
+ BOOST_VERIFY(width > 0 && height > 0);\r
auto& pool = device_pools_[stride-1][((width << 16) & 0xFFFF0000) | (height & 0x0000FFFF)];\r
std::shared_ptr<device_buffer> buffer;\r
if(!pool->items.try_pop(buffer)) \r
\r
safe_ptr<host_buffer> ogl_device::create_host_buffer(int size, host_buffer::usage_t usage)\r
{\r
- CASPAR_VERIFY(usage == host_buffer::write_only || usage == host_buffer::read_only);\r
- CASPAR_VERIFY(size > 0);\r
+ BOOST_VERIFY(usage == host_buffer::write_only || usage == host_buffer::read_only);\r
+ BOOST_VERIFY(size > 0);\r
auto& pool = host_pools_[usage][size];\r
std::shared_ptr<host_buffer> buffer;\r
if(!pool->items.try_pop(buffer)) \r
#include "host_buffer.h"\r
#include "device_buffer.h"\r
\r
+#include <common/forward.h>\r
+#include <common/no_copy.h>\r
#include <common/concurrency/executor.h>\r
#include <common/memory/safe_ptr.h>\r
\r
#include <tbb/concurrent_unordered_map.h>\r
#include <tbb/concurrent_queue.h>\r
\r
-#include <boost/noncopyable.hpp>\r
-#include <boost/thread/future.hpp>\r
-\r
#include <array>\r
#include <unordered_map>\r
\r
+FORWARD1(boost, template<typename> class unique_future);\r
+\r
namespace caspar { namespace core {\r
\r
class shader;\r
template<typename T>\r
struct buffer_pool\r
{\r
+ CASPAR_NO_COPY(buffer_pool);\r
+\r
tbb::atomic<int> usage_count;\r
tbb::atomic<int> flush_count;\r
tbb::concurrent_bounded_queue<std::shared_ptr<T>> items;\r
}\r
};\r
\r
-class ogl_device : public std::enable_shared_from_this<ogl_device>, boost::noncopyable\r
+class ogl_device : public std::enable_shared_from_this<ogl_device>\r
{ \r
+ CASPAR_NO_COPY(ogl_device);\r
+\r
std::unordered_map<GLenum, bool> caps_;\r
std::array<int, 4> viewport_;\r
std::array<int, 4> scissor_;\r
\r
struct shader::impl : boost::noncopyable\r
{\r
+ CASPAR_NO_COPY(impl);\r
+\r
GLuint program_;\r
std::unordered_map<std::string, GLint> locations_;\r
public:\r
\r
#pragma once\r
\r
-#include <string>\r
-\r
+#include <common/no_copy.h>\r
#include <common/memory/safe_ptr.h>\r
\r
-#include <boost/noncopyable.hpp>\r
+#include <string>\r
\r
namespace caspar { namespace core {\r
\r
-class shader : boost::noncopyable\r
+class shader\r
{\r
+ CASPAR_NO_COPY(shader);\r
public:\r
shader(const std::string& vertex_source_str, const std::string& fragment_source_str);\r
void set(const std::string& name, bool value);\r
\r
namespace caspar { namespace core {\r
\r
-blend_mode::type get_blend_mode(const std::wstring& str)\r
+blend_mode get_blend_mode(const std::wstring& str)\r
{\r
if(boost::iequals(str, L"normal"))\r
return blend_mode::normal;\r
\r
#pragma once\r
\r
+#include <common/enum_class.h>\r
+\r
namespace caspar { namespace core {\r
\r
-struct blend_mode\r
+CASPAR_BEGIN_ENUM_CLASS\r
{\r
- enum type \r
- {\r
- normal = 0,\r
- lighten,\r
- darken,\r
- multiply,\r
- average,\r
- add,\r
- subtract,\r
- difference,\r
- negation,\r
- exclusion,\r
- screen,\r
- overlay,\r
- soft_light,\r
- hard_light,\r
- color_dodge,\r
- color_burn,\r
- linear_dodge,\r
- linear_burn,\r
- linear_light,\r
- vivid_light,\r
- pin_light,\r
- hard_mix,\r
- reflect,\r
- glow,\r
- phoenix,\r
- contrast,\r
- saturation,\r
- color,\r
- luminosity,\r
- mix,\r
- blend_mode_count \r
- };\r
-};\r
+ normal = 0,\r
+ lighten,\r
+ darken,\r
+ multiply,\r
+ average,\r
+ add,\r
+ subtract,\r
+ difference,\r
+ negation,\r
+ exclusion,\r
+ screen,\r
+ overlay,\r
+ soft_light,\r
+ hard_light,\r
+ color_dodge,\r
+ color_burn,\r
+ linear_dodge,\r
+ linear_burn,\r
+ linear_light,\r
+ vivid_light,\r
+ pin_light,\r
+ hard_mix,\r
+ reflect,\r
+ glow,\r
+ phoenix,\r
+ contrast,\r
+ saturation,\r
+ color,\r
+ luminosity,\r
+ mix,\r
+ blend_mode_count \r
+}\r
+CASPAR_END_ENUM_CLASS(blend_mode)\r
\r
-blend_mode::type get_blend_mode(const std::wstring& str);\r
+blend_mode get_blend_mode(const std::wstring& str);\r
\r
}}
\ No newline at end of file
#include <core/producer/frame/pixel_format.h>\r
#include <core/producer/frame/frame_transform.h>\r
\r
-#include <boost/noncopyable.hpp>\r
+#include <boost/assert.hpp>\r
\r
namespace caspar { namespace core {\r
\r
\r
struct image_kernel::impl : boost::noncopyable\r
{ \r
+ CASPAR_NO_COPY(impl);\r
+\r
safe_ptr<ogl_device> ogl_;\r
safe_ptr<shader> shader_;\r
bool blend_modes_;\r
{\r
static const double epsilon = 0.001;\r
\r
- CASPAR_ASSERT(params.pix_desc.planes.size() == params.textures.size());\r
+ BOOST_ASSERT(params.pix_desc.planes.size() == params.textures.size());\r
\r
if(params.textures.empty() || !params.background)\r
return;\r
shader_->set("is_hd", params.pix_desc.planes.at(0).height > 700 ? 1 : 0);\r
shader_->set("has_local_key", params.local_key);\r
shader_->set("has_layer_key", params.layer_key);\r
- shader_->set("pixel_format", params.pix_desc.pix_fmt); \r
+ shader_->set("pixel_format", params.pix_desc.pix_fmt.value()); \r
shader_->set("opacity", params.transform.is_key ? 1.0 : params.transform.opacity); \r
\r
// Setup blend_func\r
params.background->bind(6);\r
\r
shader_->set("background", texture_id::background);\r
- shader_->set("blend_mode", params.blend_mode);\r
- shader_->set("keyer", params.keyer);\r
+ shader_->set("blend_mode", params.blend_mode.value());\r
+ shader_->set("keyer", params.keyer.value());\r
}\r
else\r
{\r
- switch(params.keyer)\r
+ switch(params.keyer.value())\r
{\r
case keyer::additive:\r
ogl_->blend_func(GL_ONE, GL_ONE); \r
\r
#include "blend_modes.h"\r
\r
+#include <common/no_copy.h>\r
+#include <common/enum_class.h>\r
#include <common/memory/safe_ptr.h>\r
\r
#include <core/producer/frame/pixel_format.h>\r
#include <core/producer/frame/frame_transform.h>\r
\r
-#include <boost/noncopyable.hpp>\r
-\r
namespace caspar { namespace core {\r
\r
-class device_buffer;\r
-class ogl_device;\r
-\r
-struct keyer\r
+CASPAR_BEGIN_ENUM_CLASS\r
{\r
- enum type\r
- {\r
- linear = 0,\r
- additive\r
- };\r
-};\r
+ linear = 0,\r
+ additive\r
+}\r
+CASPAR_END_ENUM_CLASS(keyer)\r
\r
-struct draw_params\r
+struct draw_params sealed\r
{\r
- pixel_format_desc pix_desc;\r
- std::vector<safe_ptr<device_buffer>> textures;\r
- frame_transform transform;\r
- blend_mode::type blend_mode;\r
- keyer::type keyer;\r
- std::shared_ptr<device_buffer> background;\r
- std::shared_ptr<device_buffer> local_key;\r
- std::shared_ptr<device_buffer> layer_key;\r
+ pixel_format_desc pix_desc;\r
+ std::vector<safe_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
\r
draw_params() \r
: blend_mode(blend_mode::normal)\r
}\r
};\r
\r
-class image_kernel sealed : boost::noncopyable\r
+class image_kernel sealed\r
{\r
+ CASPAR_NO_COPY(image_kernel);\r
public:\r
- image_kernel(const safe_ptr<ogl_device>& ogl);\r
+ image_kernel(const safe_ptr<class ogl_device>& ogl);\r
void draw(draw_params&& params);\r
private:\r
struct impl;\r
#include "../gpu/host_buffer.h"\r
#include "../gpu/device_buffer.h"\r
\r
-#include <common/exception/exceptions.h>\r
#include <common/gl/gl_check.h>\r
-#include <common/utility/move_on_copy.h>\r
\r
#include <core/producer/frame/frame_transform.h>\r
#include <core/producer/frame/pixel_format.h>\r
\r
#include <boost/foreach.hpp>\r
#include <boost/range/algorithm_ext/erase.hpp>\r
+#include <boost/thread/future.hpp>\r
\r
#include <algorithm>\r
-#include <deque>\r
+#include <vector>\r
\r
using namespace boost::assign;\r
\r
frame_transform transform;\r
};\r
\r
-typedef std::pair<blend_mode::type, std::vector<item>> layer;\r
+typedef std::pair<blend_mode, std::vector<item>> layer;\r
\r
class image_renderer\r
{\r
BOOST_FOREACH(auto& layer, upper)\r
{\r
BOOST_FOREACH(auto& item, layer.second)\r
- item.transform.field_mode = static_cast<field_mode::type>(item.transform.field_mode & field_mode::upper);\r
+ item.transform.field_mode = static_cast<field_mode>(item.transform.field_mode & 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::type>(item.transform.field_mode & field_mode::lower);\r
+ item.transform.field_mode = static_cast<field_mode>(item.transform.field_mode & field_mode::lower);\r
}\r
\r
draw(std::move(upper), draw_buffer, format_desc);\r
\r
void draw_mixer_buffer(safe_ptr<device_buffer>& draw_buffer, \r
std::shared_ptr<device_buffer>&& source_buffer, \r
- blend_mode::type blend_mode = blend_mode::normal)\r
+ blend_mode blend_mode = blend_mode::normal)\r
{\r
if(!source_buffer)\r
return;\r
{\r
}\r
\r
- void begin_layer(blend_mode::type blend_mode)\r
+ void begin_layer(blend_mode blend_mode)\r
{\r
layers_.push_back(std::make_pair(blend_mode, std::vector<item>()));\r
}\r
void image_mixer::visit(write_frame& frame){impl_->visit(frame);}\r
void image_mixer::end(){impl_->end();}\r
boost::unique_future<safe_ptr<host_buffer>> image_mixer::operator()(const video_format_desc& format_desc){return impl_->render(format_desc);}\r
-void image_mixer::begin_layer(blend_mode::type blend_mode){impl_->begin_layer(blend_mode);}\r
+void image_mixer::begin_layer(blend_mode blend_mode){impl_->begin_layer(blend_mode);}\r
void image_mixer::end_layer(){impl_->end_layer();}\r
\r
}}
\ No newline at end of file
\r
#include "blend_modes.h"\r
\r
+#include <common/forward.h>\r
+#include <common/no_copy.h>\r
#include <common/memory/safe_ptr.h>\r
\r
#include <core/producer/frame/frame_visitor.h>\r
\r
-#include <boost/noncopyable.hpp>\r
-\r
-#include <boost/thread/future.hpp>\r
+FORWARD1(boost, template<typename> class unique_future);\r
\r
namespace caspar { namespace core {\r
-\r
-class write_frame;\r
-class host_buffer;\r
-class ogl_device;\r
-struct video_format_desc;\r
-struct pixel_format_desc;\r
-\r
-class image_mixer sealed : public core::frame_visitor, boost::noncopyable\r
+ \r
+class image_mixer sealed : public frame_visitor\r
{\r
+ CASPAR_NO_COPY(image_mixer);\r
public:\r
- image_mixer(const safe_ptr<ogl_device>& ogl);\r
+ image_mixer(const safe_ptr<class ogl_device>& ogl);\r
\r
- virtual void begin(core::basic_frame& frame);\r
- virtual void visit(core::write_frame& frame);\r
+ virtual void begin(class basic_frame& frame);\r
+ virtual void visit(class write_frame& frame);\r
virtual void end();\r
\r
- void begin_layer(blend_mode::type blend_mode);\r
+ void begin_layer(blend_mode blend_mode);\r
void end_layer();\r
\r
- boost::unique_future<safe_ptr<host_buffer>> operator()(const video_format_desc& format_desc);\r
+ boost::unique_future<safe_ptr<class host_buffer>> operator()(const struct video_format_desc& format_desc);\r
\r
private:\r
struct impl;\r
#include "image/image_mixer.h"\r
\r
#include <common/env.h>\r
+#include <common/no_copy.h>\r
#include <common/concurrency/executor.h>\r
+#include <common/diagnostics/graph.h>\r
#include <common/exception/exceptions.h>\r
#include <common/gl/gl_check.h>\r
#include <common/utility/tweener.h>\r
#include <core/producer/frame/frame_factory.h>\r
#include <core/producer/frame/frame_transform.h>\r
#include <core/producer/frame/pixel_format.h>\r
-\r
#include <core/video_format.h>\r
\r
#include <boost/foreach.hpp>\r
\r
struct mixer::impl : boost::noncopyable\r
{ \r
- safe_ptr<mixer::target_t> target_;\r
+ CASPAR_NO_COPY(impl);\r
+\r
+ safe_ptr<mixer::target_t> target_;\r
\r
- safe_ptr<diagnostics::graph> graph_;\r
- boost::timer mix_timer_; \r
+ safe_ptr<diagnostics::graph> graph_;\r
+ boost::timer mix_timer_; \r
\r
- video_format_desc format_desc_;\r
- safe_ptr<ogl_device> ogl_;\r
+ video_format_desc format_desc_;\r
+ safe_ptr<ogl_device> ogl_;\r
\r
- audio_mixer audio_mixer_;\r
- image_mixer image_mixer_;\r
+ audio_mixer audio_mixer_;\r
+ image_mixer image_mixer_;\r
\r
- std::unordered_map<int, blend_mode::type> blend_modes_;\r
+ std::unordered_map<int, blend_mode> blend_modes_;\r
\r
executor executor_;\r
\r
}); \r
}\r
\r
- void set_blend_mode(int index, blend_mode::type value)\r
+ void set_blend_mode(int index, blend_mode value)\r
{\r
executor_.begin_invoke([=]\r
{\r
- blend_modes_[index] = value;\r
+ auto it = blend_modes_.find(index);\r
+ if(it == blend_modes_.end())\r
+ blend_modes_.insert(std::make_pair(index, value));\r
+ else\r
+ it->second = value;\r
}, high_priority);\r
}\r
\r
mixer::mixer(const safe_ptr<target_t>& target, const safe_ptr<diagnostics::graph>& graph, const video_format_desc& format_desc, const safe_ptr<ogl_device>& ogl) \r
: impl_(new impl(target, graph, format_desc, ogl)){}\r
void mixer::send(const std::pair<std::map<int, safe_ptr<core::basic_frame>>, std::shared_ptr<void>>& frames){ impl_->send(frames);}\r
-void mixer::set_blend_mode(int index, blend_mode::type value){impl_->set_blend_mode(index, value);}\r
+void mixer::set_blend_mode(int index, blend_mode value){impl_->set_blend_mode(index, value);}\r
void mixer::set_video_format_desc(const video_format_desc& format_desc){impl_->set_video_format_desc(format_desc);}\r
boost::unique_future<boost::property_tree::wptree> mixer::info() const{return impl_->info();}\r
}}
\ No newline at end of file
\r
#include "image/blend_modes.h"\r
\r
-#include "../producer/frame/frame_factory.h"\r
-\r
+#include <common/no_copy.h>\r
+#include <common/forward.h>\r
#include <common/memory/safe_ptr.h>\r
#include <common/concurrency/target.h>\r
-#include <common/diagnostics/graph.h>\r
\r
#include <boost/property_tree/ptree_fwd.hpp>\r
-#include <boost/thread/future.hpp>\r
\r
#include <map>\r
\r
-namespace caspar { \r
+FORWARD2(caspar, diagnostics, class graph);\r
+FORWARD1(boost, template<typename> class unique_future);\r
\r
-class executor;\r
+namespace caspar { namespace core {\r
\r
-namespace core {\r
-\r
-class read_frame;\r
-class write_frame;\r
-class basic_frame;\r
-class ogl_device;\r
-struct frame_transform;\r
-struct pixel_format;\r
-\r
-class mixer sealed : public target<std::pair<std::map<int, safe_ptr<core::basic_frame>>, std::shared_ptr<void>>>\r
+class mixer sealed : public target<std::pair<std::map<int, safe_ptr<class basic_frame>>, std::shared_ptr<void>>>\r
{\r
+ CASPAR_NO_COPY(mixer);\r
public: \r
- typedef target<std::pair<safe_ptr<read_frame>, std::shared_ptr<void>>> target_t;\r
+ typedef target<std::pair<safe_ptr<class read_frame>, std::shared_ptr<void>>> target_t;\r
\r
- explicit mixer(const safe_ptr<target_t>& target, const safe_ptr<diagnostics::graph>& graph, const video_format_desc& format_desc, const safe_ptr<ogl_device>& ogl);\r
+ explicit mixer(const safe_ptr<target_t>& target, const safe_ptr<diagnostics::graph>& graph, const struct video_format_desc& format_desc, const safe_ptr<class ogl_device>& ogl);\r
\r
// target\r
\r
- virtual void send(const std::pair<std::map<int, safe_ptr<basic_frame>>, std::shared_ptr<void>>& frames) override; \r
+ virtual void send(const std::pair<std::map<int, safe_ptr<class basic_frame>>, std::shared_ptr<void>>& frames) override; \r
\r
// mixer\r
\r
- void set_video_format_desc(const video_format_desc& format_desc);\r
+ void set_video_format_desc(const struct video_format_desc& format_desc);\r
\r
- void set_blend_mode(int index, blend_mode::type value);\r
+ void set_blend_mode(int index, blend_mode value);\r
\r
boost::unique_future<boost::property_tree::wptree> info() const;\r
\r
\r
struct read_frame::impl : boost::noncopyable\r
{\r
+ CASPAR_NO_COPY(impl);\r
+\r
safe_ptr<ogl_device> ogl_;\r
int width_;\r
int height_;\r
// auto height = 720;\r
// auto width4 = frame->image_data().size()/height;\r
//\r
-// CASPAR_ASSERT(frame->image_data().size() % height == 0);\r
+// BOOST_ASSERT(frame->image_data().size() % height == 0);\r
// \r
// tbb::affinity_partitioner ap;\r
// tbb::parallel_for(tbb::blocked_range<int>(0, height), [&](tbb::blocked_range<int>& r)\r
\r
#pragma once\r
\r
+#include <common/no_copy.h>\r
#include <common/memory/safe_ptr.h>\r
\r
#include <core/mixer/audio/audio_mixer.h>\r
\r
-#include <boost/noncopyable.hpp>\r
#include <boost/range/iterator_range.hpp>\r
\r
-#include <cstdint>\r
+#include <stdint.h>\r
#include <memory>\r
#include <vector>\r
\r
namespace caspar { namespace core {\r
\r
-class host_buffer;\r
-class ogl_device;\r
-\r
-class read_frame sealed : boost::noncopyable\r
+class read_frame sealed\r
{\r
+ CASPAR_NO_COPY(read_frame);\r
public:\r
read_frame();\r
- read_frame(const safe_ptr<ogl_device>& ogl, int width, int height, safe_ptr<host_buffer>&& image_data, audio_buffer&& audio_data);\r
+ read_frame(const safe_ptr<class ogl_device>& ogl, int width, int height, safe_ptr<class host_buffer>&& image_data, audio_buffer&& audio_data);\r
\r
const boost::iterator_range<const uint8_t*> image_data();\r
const boost::iterator_range<const int32_t*> audio_data();\r
#include "gpu/host_buffer.h"\r
#include "gpu/device_buffer.h"\r
\r
+#include <common/no_copy.h>\r
+\r
#include <core/producer/frame/frame_visitor.h>\r
#include <core/producer/frame/pixel_format.h>\r
\r
namespace caspar { namespace core {\r
\r
struct write_frame::impl\r
-{ \r
+{ \r
std::shared_ptr<ogl_device> ogl_;\r
std::vector<std::shared_ptr<host_buffer>> buffers_;\r
std::vector<safe_ptr<device_buffer>> textures_;\r
audio_buffer audio_data_;\r
const core::pixel_format_desc desc_;\r
const void* tag_;\r
- core::field_mode::type mode_;\r
+ core::field_mode mode_;\r
\r
impl(const void* tag)\r
: tag_(tag)\r
+ , mode_(core::field_mode::empty)\r
{\r
}\r
\r
const std::vector<safe_ptr<device_buffer>>& write_frame::get_textures() const{return impl_->textures_;}\r
void write_frame::commit(int plane_index){impl_->commit(plane_index);}\r
void write_frame::commit(){impl_->commit();}\r
-void write_frame::set_type(const field_mode::type& mode){impl_->mode_ = mode;}\r
-core::field_mode::type write_frame::get_type() const{return impl_->mode_;}\r
+void write_frame::set_type(const field_mode& mode){impl_->mode_ = mode;}\r
+core::field_mode write_frame::get_type() const{return impl_->mode_;}\r
void write_frame::accept(core::frame_visitor& visitor){impl_->accept(*this, visitor);}\r
\r
}}
\ No newline at end of file
#include <core/video_format.h>\r
#include <core/mixer/audio/audio_mixer.h>\r
\r
-#include <boost/noncopyable.hpp>\r
#include <boost/range/iterator_range.hpp>\r
\r
-#include <cstdint>\r
+#include <stdint.h>\r
#include <vector>\r
\r
namespace caspar { namespace core {\r
-\r
-class device_buffer;\r
-struct frame_visitor;\r
-struct pixel_format_desc;\r
-class ogl_device; \r
-\r
-class write_frame sealed : public core::basic_frame, boost::noncopyable\r
+ \r
+class write_frame sealed : public core::basic_frame\r
{\r
public: \r
explicit write_frame(const void* tag);\r
- explicit write_frame(const safe_ptr<ogl_device>& ogl, const void* tag, const core::pixel_format_desc& desc);\r
+ explicit write_frame(const safe_ptr<class ogl_device>& ogl, const void* tag, const struct pixel_format_desc& desc);\r
\r
write_frame(const write_frame& other);\r
write_frame(write_frame&& other);\r
\r
// basic_frame\r
\r
- virtual void accept(frame_visitor& visitor) override;\r
+ virtual void accept(struct frame_visitor& visitor) override;\r
\r
// write _frame\r
\r
void commit(int plane_index);\r
void commit();\r
\r
- void set_type(const field_mode::type& mode);\r
- field_mode::type get_type() const;\r
+ void set_type(const field_mode& mode);\r
+ field_mode get_type() const;\r
\r
const void* tag() const;\r
\r
- const core::pixel_format_desc& get_pixel_format_desc() const;\r
+ const struct pixel_format_desc& get_pixel_format_desc() const;\r
\r
private:\r
friend class image_mixer;\r
\r
- const std::vector<safe_ptr<device_buffer>>& get_textures() const;\r
+ const std::vector<safe_ptr<class device_buffer>>& get_textures() const;\r
\r
struct impl;\r
safe_ptr<impl> impl_;\r
#include "../../consumer/output.h"\r
#include "../../video_channel.h"\r
\r
+#include "../frame_producer.h"\r
#include "../frame/basic_frame.h"\r
#include "../frame/frame_factory.h"\r
#include "../frame/pixel_format.h"\r
#include "../../mixer/read_frame.h"\r
\r
#include <common/exception/exceptions.h>\r
+#include <common/no_copy.h>\r
\r
#include <asmlib.h>\r
\r
\r
class channel_consumer : public frame_consumer\r
{ \r
+ CASPAR_NO_COPY(channel_consumer);\r
+\r
tbb::concurrent_bounded_queue<std::shared_ptr<read_frame>> frame_buffer_;\r
core::video_format_desc format_desc_;\r
int channel_index_;\r
\r
class channel_producer : public frame_producer\r
{\r
+ CASPAR_NO_COPY(channel_producer);\r
+\r
const safe_ptr<frame_factory> frame_factory_;\r
const safe_ptr<channel_consumer> consumer_;\r
\r
}\r
};\r
\r
-safe_ptr<frame_producer> create_channel_producer(const safe_ptr<core::frame_factory>& frame_factory, const safe_ptr<video_channel>& channel)\r
+safe_ptr<core::frame_producer> create_channel_producer(const safe_ptr<core::frame_factory>& frame_factory, const safe_ptr<core::video_channel>& channel)\r
{\r
return create_producer_print_proxy(\r
make_safe<channel_producer>(frame_factory, channel));\r
\r
#pragma once\r
\r
-#include "../frame_producer.h"\r
+#include "../../video_channel.h"\r
+\r
+#include <common/memory/safe_ptr.h>\r
\r
#include <string>\r
#include <vector>\r
\r
namespace caspar { namespace core {\r
-\r
-class video_channel;\r
-struct frame_factory;\r
-\r
-safe_ptr<frame_producer> create_channel_producer(const safe_ptr<core::frame_factory>& frame_factory, const safe_ptr<video_channel>& channel);\r
+ \r
+safe_ptr<struct frame_producer> create_channel_producer(const safe_ptr<struct frame_factory>& frame_factory, const safe_ptr<video_channel>& channel);\r
\r
}}\r
#include "../frame/pixel_format.h"\r
#include "../../mixer/write_frame.h"\r
\r
+#include <common/no_copy.h>\r
#include <common/exception/exceptions.h>\r
\r
#include <boost/algorithm/string.hpp>\r
\r
class color_producer : public frame_producer\r
{\r
+ CASPAR_NO_COPY(color_producer);\r
+\r
safe_ptr<basic_frame> frame_;\r
const std::wstring color_str_;\r
\r
return str;\r
}\r
\r
-safe_ptr<frame_producer> create_color_producer(const safe_ptr<core::frame_factory>& frame_factory, const std::vector<std::wstring>& params)\r
+safe_ptr<frame_producer> create_color_producer(const safe_ptr<frame_factory>& frame_factory, const std::vector<std::wstring>& params)\r
{\r
if(params.size() < 0)\r
return core::frame_producer::empty();\r
return create_producer_print_proxy(\r
make_safe<color_producer>(frame_factory, color2));\r
}\r
-safe_ptr<core::write_frame> create_color_frame(void* tag, const safe_ptr<core::frame_factory>& frame_factory, const std::wstring& color)\r
+safe_ptr<write_frame> create_color_frame(void* tag, const safe_ptr<frame_factory>& frame_factory, const std::wstring& color)\r
{\r
auto color2 = get_hex_color(color);\r
if(color2.length() != 9 || color2[0] != '#')\r
\r
#pragma once\r
\r
+#include <common/memory/safe_ptr.h>\r
+\r
#include <string>\r
#include <vector>\r
\r
namespace caspar { namespace core {\r
-\r
-class write_frame;\r
-struct frame_factory;\r
-struct frame_producer;\r
-\r
-safe_ptr<frame_producer> create_color_producer(const safe_ptr<core::frame_factory>& frame_factory, const std::vector<std::wstring>& params);\r
-safe_ptr<core::write_frame> create_color_frame(void* tag, const safe_ptr<core::frame_factory>& frame_factory, const std::wstring& color);\r
+ \r
+safe_ptr<struct frame_producer> create_color_producer(const safe_ptr<struct frame_factory>& frame_factory, const std::vector<std::wstring>& params);\r
+safe_ptr<class write_frame> create_color_frame(void* tag, const safe_ptr<struct frame_factory>& frame_factory, const std::wstring& color);\r
\r
}}\r
#include "basic_frame.h"\r
\r
#include "frame_transform.h"\r
-#include "../../video_format.h"\r
\r
#include <boost/foreach.hpp>\r
\r
{ \r
std::vector<safe_ptr<basic_frame>> frames_;\r
\r
- frame_transform frame_transform_; \r
- \r
+ frame_transform frame_transform_; \r
public:\r
impl(const std::vector<safe_ptr<basic_frame>>& frames) : frames_(frames) \r
{\r
}\r
+\r
impl(std::vector<safe_ptr<basic_frame>>&& frames) : frames_(std::move(frames))\r
{\r
}\r
+\r
impl(safe_ptr<basic_frame>&& frame) \r
{\r
frames_.push_back(std::move(frame));\r
}\r
+\r
impl(const safe_ptr<basic_frame>& frame) \r
{ \r
frames_.push_back(frame);\r
frame_transform& basic_frame::get_frame_transform() { return impl_->frame_transform_;}\r
void basic_frame::accept(frame_visitor& visitor){impl_->accept(*this, visitor);}\r
\r
-safe_ptr<basic_frame> basic_frame::interlace(const safe_ptr<basic_frame>& frame1, const safe_ptr<basic_frame>& frame2, field_mode::type mode)\r
+safe_ptr<basic_frame> basic_frame::interlace(const safe_ptr<basic_frame>& frame1, const safe_ptr<basic_frame>& frame2, field_mode mode)\r
{ \r
if(frame1 == basic_frame::eof() || frame2 == basic_frame::eof())\r
return basic_frame::eof();\r
\r
#include <common/memory/safe_ptr.h>\r
\r
-namespace caspar { namespace core {\r
-\r
-struct frame_transform;\r
+#include <vector>\r
\r
+namespace caspar { namespace core {\r
+ \r
class basic_frame\r
{\r
public:\r
\r
void swap(basic_frame& other);\r
\r
- const frame_transform& get_frame_transform() const;\r
- frame_transform& get_frame_transform();\r
+ const struct frame_transform& get_frame_transform() const;\r
+ struct frame_transform& get_frame_transform();\r
\r
- static safe_ptr<basic_frame> interlace(const safe_ptr<basic_frame>& frame1, const safe_ptr<basic_frame>& frame2, field_mode::type mode);\r
+ static safe_ptr<basic_frame> interlace(const safe_ptr<basic_frame>& frame1, const safe_ptr<basic_frame>& frame2, field_mode mode);\r
static safe_ptr<basic_frame> combine(const safe_ptr<basic_frame>& frame1, const safe_ptr<basic_frame>& frame2);\r
static safe_ptr<basic_frame> fill_and_key(const safe_ptr<basic_frame>& fill, const safe_ptr<basic_frame>& key);\r
\r
\r
#pragma once\r
\r
+#include <common/no_copy.h>\r
#include <common/memory/safe_ptr.h>\r
\r
-#include <boost/noncopyable.hpp>\r
-\r
namespace caspar { namespace core {\r
- \r
-class write_frame;\r
-struct pixel_format_desc;\r
-struct video_format_desc;\r
- \r
-struct frame_factory : boost::noncopyable\r
+ \r
+struct frame_factory\r
{\r
- virtual safe_ptr<write_frame> create_frame(const void* video_stream_tag, const pixel_format_desc& desc) = 0; \r
- \r
- virtual video_format_desc get_video_format_desc() const = 0; // nothrow\r
+ CASPAR_NO_COPY(frame_factory);\r
+\r
+ frame_factory(){}\r
+\r
+ virtual safe_ptr<class write_frame> create_frame(const void* video_stream_tag, const struct pixel_format_desc& desc) = 0; \r
+ virtual struct video_format_desc get_video_format_desc() const = 0; // nothrow\r
};\r
\r
}}
\ No newline at end of file
\r
#include "frame_transform.h"\r
\r
-#include <common/utility/assert.h>\r
+#include <algorithm>\r
\r
namespace caspar { namespace core {\r
\r
levels.min_output = std::max(levels.min_output, other.levels.min_output);\r
levels.max_output = std::min(levels.max_output, other.levels.max_output);\r
levels.gamma *= other.levels.gamma;\r
- field_mode = static_cast<field_mode::type>(field_mode & other.field_mode);\r
+ field_mode = static_cast<core::field_mode>(field_mode & other.field_mode);\r
is_key |= other.is_key;\r
is_mix |= other.is_mix;\r
return *this;\r
result.levels.max_output = do_tween(time, source.levels.max_output, dest.levels.max_output, duration, tweener);\r
result.levels.min_output = do_tween(time, source.levels.min_output, dest.levels.min_output, duration, tweener);\r
result.levels.gamma = do_tween(time, source.levels.gamma, dest.levels.gamma, duration, tweener);\r
- result.field_mode = static_cast<field_mode::type>(source.field_mode & dest.field_mode);\r
+ result.field_mode = static_cast<field_mode>(source.field_mode & dest.field_mode);\r
result.is_key = source.is_key | dest.is_key;\r
result.is_mix = source.is_mix | dest.is_mix;\r
\r
#include <boost/array.hpp>\r
\r
namespace caspar { namespace core {\r
-\r
-struct pixel_format_desc;\r
- \r
+ \r
struct levels sealed\r
{\r
levels() \r
boost::array<double, 2> clip_scale; \r
levels levels;\r
\r
- field_mode::type field_mode;\r
+ field_mode field_mode;\r
bool is_key;\r
bool is_mix;\r
\r
#pragma once\r
\r
namespace caspar { namespace core {\r
-\r
-class basic_frame;\r
-class write_frame;\r
-\r
+ \r
struct frame_visitor\r
{\r
- virtual void begin(basic_frame& frame) = 0;\r
+ virtual void begin(class basic_frame& frame) = 0;\r
virtual void end() = 0;\r
- virtual void visit(write_frame& frame) = 0;\r
+ virtual void visit(class write_frame& frame) = 0;\r
};\r
\r
}}
\ No newline at end of file
\r
#pragma once\r
\r
+#include <common/enum_class.h>\r
+\r
#include <vector>\r
\r
namespace caspar { namespace core {\r
\r
-struct pixel_format\r
+CASPAR_BEGIN_ENUM_CLASS\r
{\r
- enum type\r
- {\r
- gray = 0,\r
- bgra,\r
- rgba,\r
- argb,\r
- abgr,\r
- ycbcr,\r
- ycbcra,\r
- luma,\r
- count,\r
- invalid\r
- };\r
-};\r
+ gray = 0,\r
+ bgra,\r
+ rgba,\r
+ argb,\r
+ abgr,\r
+ ycbcr,\r
+ ycbcra,\r
+ luma,\r
+ count,\r
+ invalid\r
+}\r
+CASPAR_END_ENUM_CLASS(pixel_format)\r
\r
struct pixel_format_desc sealed\r
{\r
{\r
}\r
\r
- pixel_format::type pix_fmt;\r
- std::vector<plane> planes;\r
+ pixel_format pix_fmt;\r
+ std::vector<plane> planes;\r
};\r
\r
}}
\ No newline at end of file
#include <common/utility/move_on_copy.h>\r
\r
namespace caspar { namespace core {\r
+\r
+boost::unique_future<std::wstring> frame_producer::call(const std::wstring&) \r
+{\r
+ BOOST_THROW_EXCEPTION(not_supported());\r
+}\r
\r
std::vector<const producer_factory_t> g_factories;\r
\r
\r
#pragma once\r
\r
+#include <common/no_copy.h>\r
+#include <common/forward.h>\r
#include <common/memory/safe_ptr.h>\r
-#include <common/exception/exceptions.h>\r
+#include <common/enum_class.h>\r
\r
-#include <boost/noncopyable.hpp>\r
-\r
-#include <algorithm>\r
#include <stdint.h>\r
#include <limits>\r
#include <functional>\r
#include <string>\r
#include <vector>\r
\r
-#include <boost/thread/future.hpp>\r
#include <boost/property_tree/ptree_fwd.hpp>\r
\r
-namespace caspar { \r
- \r
-class executor;\r
- \r
-namespace core {\r
-\r
-class basic_frame;\r
-struct frame_factory;\r
+FORWARD1(caspar, class executor);\r
+FORWARD1(boost, template<typename T> class unique_future);\r
\r
-struct frame_producer : boost::noncopyable\r
+namespace caspar { namespace core {\r
+ \r
+struct frame_producer\r
{\r
+ CASPAR_NO_COPY(frame_producer);\r
public:\r
- enum flags\r
+ CASPAR_BEGIN_ENUM_CLASS\r
{\r
- NO_FLAG = 0,\r
- ALPHA_ONLY_FLAG = 1,\r
- DEINTERLACE_FLAG\r
- };\r
+ none = 0,\r
+ alpha_only = 2,\r
+ deinterlace = 4, \r
+ }\r
+ CASPAR_END_ENUM_CLASS(flags)\r
\r
+ frame_producer(){}\r
virtual ~frame_producer(){} \r
\r
virtual std::wstring print() const = 0; // nothrow\r
virtual boost::property_tree::wptree info() const = 0;\r
\r
- virtual boost::unique_future<std::wstring> call(const std::wstring&) \r
- {\r
- BOOST_THROW_EXCEPTION(not_supported());\r
- }\r
+ virtual boost::unique_future<std::wstring> call(const std::wstring&);\r
\r
virtual safe_ptr<frame_producer> get_following_producer() const {return frame_producer::empty();} // nothrow\r
virtual void set_leading_producer(const safe_ptr<frame_producer>&) {} // nothrow\r
\r
virtual uint32_t nb_frames() const {return std::numeric_limits<uint32_t>::max();}\r
\r
- virtual safe_ptr<basic_frame> receive(int flags) = 0;\r
- virtual safe_ptr<core::basic_frame> last_frame() const = 0;\r
+ virtual safe_ptr<class basic_frame> receive(int flags) = 0;\r
+ virtual safe_ptr<class basic_frame> last_frame() const = 0;\r
\r
static const safe_ptr<frame_producer>& empty(); // nothrow\r
};\r
\r
-safe_ptr<basic_frame> receive_and_follow(safe_ptr<frame_producer>& producer, int flags);\r
+safe_ptr<class basic_frame> receive_and_follow(safe_ptr<frame_producer>& producer, int flags);\r
\r
-typedef std::function<safe_ptr<core::frame_producer>(const safe_ptr<frame_factory>&, const std::vector<std::wstring>&)> producer_factory_t;\r
+typedef std::function<safe_ptr<core::frame_producer>(const safe_ptr<struct frame_factory>&, const std::vector<std::wstring>&)> producer_factory_t;\r
void register_producer_factory(const producer_factory_t& factory); // Not thread-safe.\r
safe_ptr<core::frame_producer> create_producer(const safe_ptr<frame_factory>&, const std::vector<std::wstring>& params);\r
safe_ptr<core::frame_producer> create_producer(const safe_ptr<frame_factory>&, const std::wstring& params);\r
#include "frame/frame_transform.h"\r
\r
#include <boost/optional.hpp>\r
-#include <boost/property_tree/ptree.hpp>\r
+#include <boost/thread/future.hpp>\r
\r
namespace caspar { namespace core {\r
\r
if(preview) // Play the first frame and pause.\r
{ \r
play();\r
- receive(frame_producer::NO_FLAG);\r
+ receive(frame_producer::flags::none);\r
pause();\r
}\r
}\r
\r
#pragma once\r
\r
+#include <common/forward.h>\r
#include <common/memory/safe_ptr.h>\r
\r
-#include <boost/noncopyable.hpp>\r
-#include <boost/thread/future.hpp>\r
#include <boost/property_tree/ptree_fwd.hpp>\r
\r
#include <string>\r
\r
-namespace caspar { namespace core {\r
-\r
-struct frame_producer;\r
-class basic_frame;\r
+FORWARD1(boost, template<typename T> class unique_future);\r
+FORWARD1(boost, template<typename T> class optional);\r
\r
-class layer sealed : boost::noncopyable\r
+namespace caspar { namespace core {\r
+ \r
+class layer sealed\r
{\r
public:\r
layer(); // nothrow\r
\r
void swap(layer& other); // nothrow \r
\r
- void load(const safe_ptr<frame_producer>& producer, bool preview, const boost::optional<int32_t>& auto_play_delta = nullptr); // nothrow\r
+ void load(const safe_ptr<struct frame_producer>& producer, bool preview, const boost::optional<int32_t>& auto_play_delta = nullptr); // nothrow\r
void play(); // nothrow\r
void pause(); // nothrow\r
void stop(); // nothrow\r
\r
bool empty() const;\r
\r
- safe_ptr<frame_producer> foreground() const; // nothrow\r
- safe_ptr<frame_producer> background() const; // nothrow\r
+ safe_ptr<struct frame_producer> foreground() const; // nothrow\r
+ safe_ptr<struct frame_producer> background() const; // nothrow\r
\r
- safe_ptr<basic_frame> receive(int flags); // nothrow\r
+ safe_ptr<class basic_frame> receive(int flags); // nothrow\r
\r
boost::property_tree::wptree info() const;\r
private:\r
\r
#pragma once\r
\r
+#include <common/memory/safe_ptr.h>\r
+\r
#include <string>\r
-#include <memory>\r
#include <vector>\r
\r
namespace caspar { namespace core {\r
- \r
-struct frame_factory;\r
-struct frame_producer;\r
- \r
-safe_ptr<frame_producer> create_playlist_producer(const safe_ptr<core::frame_factory>& frame_factory, const std::vector<std::wstring>& params);\r
+ \r
+safe_ptr<struct frame_producer> create_playlist_producer(const safe_ptr<struct frame_factory>& frame_factory, const std::vector<std::wstring>& params);\r
\r
}}
\ No newline at end of file
#include "../frame_producer.h"\r
#include "../frame/basic_frame.h"\r
\r
+#include <common/no_copy.h>\r
+\r
#include <tbb/parallel_invoke.h>\r
\r
namespace caspar { namespace core { \r
\r
struct separated_producer : public frame_producer\r
{ \r
+ CASPAR_NO_COPY(separated_producer);\r
+\r
safe_ptr<frame_producer> fill_producer_;\r
safe_ptr<frame_producer> key_producer_;\r
safe_ptr<basic_frame> fill_;\r
[&]\r
{\r
if(key_ == core::basic_frame::late())\r
- key_ = receive_and_follow(key_producer_, flags | ALPHA_ONLY_FLAG);\r
+ key_ = receive_and_follow(key_producer_, flags | frame_producer::flags::alpha_only);\r
});\r
\r
if(fill_ == basic_frame::eof() || key_ == basic_frame::eof())\r
\r
#pragma once\r
\r
+#include <common/memory/safe_ptr.h>\r
+\r
#include <string>\r
-#include <memory>\r
\r
namespace caspar { namespace core {\r
-\r
-struct frame_producer;\r
-\r
-safe_ptr<frame_producer> create_separated_producer(const safe_ptr<frame_producer>& fill, const safe_ptr<frame_producer>& key);\r
+ \r
+safe_ptr<struct frame_producer> create_separated_producer(const safe_ptr<struct frame_producer>& fill, const safe_ptr<struct frame_producer>& key);\r
\r
}}
\ No newline at end of file
#include "frame/frame_factory.h"\r
\r
#include <common/concurrency/executor.h>\r
+#include <common/diagnostics/graph.h>\r
\r
#include <core/producer/frame/frame_transform.h>\r
\r
{\r
auto transform = transforms_[layer.first].fetch_and_tick(1);\r
\r
- int flags = frame_producer::NO_FLAG;\r
+ int flags = frame_producer::flags::none;\r
if(format_desc_.field_mode != field_mode::progressive)\r
{\r
- flags |= std::abs(transform.fill_scale[1] - 1.0) > 0.0001 ? frame_producer::DEINTERLACE_FLAG : frame_producer::NO_FLAG;\r
- flags |= std::abs(transform.fill_translation[1]) > 0.0001 ? frame_producer::DEINTERLACE_FLAG : frame_producer::NO_FLAG;\r
+ flags |= std::abs(transform.fill_scale[1] - 1.0) > 0.0001 ? frame_producer::flags::deinterlace : frame_producer::flags::none;\r
+ flags |= std::abs(transform.fill_translation[1]) > 0.0001 ? frame_producer::flags::deinterlace : frame_producer::flags::none;\r
}\r
\r
if(transform.is_key)\r
- flags |= frame_producer::ALPHA_ONLY_FLAG;\r
+ flags |= frame_producer::flags::alpha_only;\r
\r
auto frame = layer.second.receive(flags); \r
\r
}\r
};\r
\r
-stage::stage(const safe_ptr<stage::target_t>& target,const safe_ptr<diagnostics::graph>& graph, const video_format_desc& format_desc) : impl_(new impl(target, graph, format_desc)){}\r
+stage::stage(const safe_ptr<stage::target_t>& target, const safe_ptr<diagnostics::graph>& graph, const struct video_format_desc& format_desc) : impl_(new impl(target, graph, format_desc)){}\r
void stage::set_frame_transform(int index, const core::frame_transform& transform, unsigned int mix_duration, const std::wstring& tween){impl_->set_transform(index, transform, mix_duration, tween);}\r
void stage::apply_frame_transform(int index, const std::function<core::frame_transform(core::frame_transform)>& transform, unsigned int mix_duration, const std::wstring& tween){impl_->apply_transform(index, transform, mix_duration, tween);}\r
void stage::clear_transforms(int index){impl_->clear_transforms(index);}\r
\r
#include "frame_producer.h"\r
\r
+#include <common/no_copy.h>\r
+#include <common/forward.h>\r
#include <common/memory/safe_ptr.h>\r
#include <common/concurrency/target.h>\r
-#include <common/diagnostics/graph.h>\r
\r
-#include <boost/noncopyable.hpp>\r
#include <boost/property_tree/ptree_fwd.hpp>\r
#include <boost/thread/future.hpp>\r
\r
#include <functional>\r
\r
-namespace caspar { namespace core {\r
-\r
-struct video_format_desc;\r
-struct frame_transform;\r
+FORWARD2(caspar, diagnostics, class graph);\r
\r
-class stage sealed : boost::noncopyable\r
+namespace caspar { namespace core {\r
+ \r
+class stage sealed\r
{\r
+ CASPAR_NO_COPY(stage);\r
public:\r
- typedef target<std::pair<std::map<int, safe_ptr<basic_frame>>, std::shared_ptr<void>>> target_t;\r
+ typedef target<std::pair<std::map<int, safe_ptr<class basic_frame>>, std::shared_ptr<void>>> target_t;\r
\r
- explicit stage(const safe_ptr<target_t>& target, const safe_ptr<diagnostics::graph>& graph, const video_format_desc& format_desc);\r
+ stage(const safe_ptr<target_t>& target, const safe_ptr<diagnostics::graph>& graph, const struct video_format_desc& format_desc);\r
\r
// stage\r
\r
- void set_frame_transform(int index, const frame_transform& transform, unsigned int mix_duration = 0, const std::wstring& tween = L"linear");\r
- void apply_frame_transform(int index, const std::function<frame_transform(frame_transform)>& transform, unsigned int mix_duration = 0, const std::wstring& tween = L"linear");\r
+ void set_frame_transform(int index, const struct frame_transform& transform, unsigned int mix_duration = 0, const std::wstring& tween = L"linear");\r
+ void apply_frame_transform(int index, const std::function<struct frame_transform(struct frame_transform)>& transform, unsigned int mix_duration = 0, const std::wstring& tween = L"linear");\r
void clear_transforms(int index);\r
void clear_transforms();\r
\r
void spawn_token();\r
\r
- void load(int index, const safe_ptr<frame_producer>& producer, bool preview = false, int auto_play_delta = -1);\r
+ void load(int index, const safe_ptr<struct frame_producer>& producer, bool preview = false, int auto_play_delta = -1);\r
void pause(int index);\r
void play(int index);\r
void stop(int index);\r
void swap_layer(int index, int other_index);\r
void swap_layer(int index, int other_index, const safe_ptr<stage>& other);\r
\r
- boost::unique_future<std::wstring> call(int index, bool foreground, const std::wstring& param);\r
- boost::unique_future<safe_ptr<frame_producer>> foreground(int index);\r
- boost::unique_future<safe_ptr<frame_producer>> background(int index);\r
+ boost::unique_future<std::wstring> call(int index, bool foreground, const std::wstring& param);\r
+ boost::unique_future<safe_ptr<struct frame_producer>> foreground(int index);\r
+ boost::unique_future<safe_ptr<struct frame_producer>> background(int index);\r
\r
boost::unique_future<boost::property_tree::wptree> info() const;\r
boost::unique_future<boost::property_tree::wptree> info(int layer) const;\r
\r
- void set_video_format_desc(const video_format_desc& format_desc);\r
+ void set_video_format_desc(const struct video_format_desc& format_desc);\r
\r
private:\r
struct impl;\r
#include "../frame/basic_frame.h"\r
#include "../frame/frame_transform.h"\r
\r
+#include <common/no_copy.h>\r
+\r
#include <tbb/parallel_invoke.h>\r
\r
#include <boost/assign.hpp>\r
\r
struct transition_producer : public frame_producer\r
{ \r
- const field_mode::type mode_;\r
+ CASPAR_NO_COPY(transition_producer);\r
+\r
+ const field_mode mode_;\r
unsigned int current_frame_;\r
\r
const transition_info info_;\r
\r
safe_ptr<basic_frame> last_frame_;\r
\r
- explicit transition_producer(const field_mode::type& mode, const safe_ptr<frame_producer>& dest, const transition_info& info) \r
+ explicit transition_producer(const field_mode& mode, const safe_ptr<frame_producer>& dest, const transition_info& info) \r
: mode_(mode)\r
, current_frame_(0)\r
, info_(info)\r
}\r
};\r
\r
-safe_ptr<frame_producer> create_transition_producer(const field_mode::type& mode, const safe_ptr<frame_producer>& destination, const transition_info& info)\r
+safe_ptr<frame_producer> create_transition_producer(const field_mode& mode, const safe_ptr<frame_producer>& destination, const transition_info& info)\r
{\r
return create_producer_print_proxy(\r
make_safe<transition_producer>(mode, destination, info));\r
\r
#include "../../video_format.h"\r
\r
+#include <common/memory/safe_ptr.h>\r
+#include <common/enum_class.h>\r
#include <common/utility/tweener.h>\r
\r
#include <string>\r
-#include <memory>\r
\r
namespace caspar { namespace core {\r
-\r
-struct frame_producer;\r
-\r
-struct transition\r
+ \r
+CASPAR_BEGIN_ENUM_CLASS\r
{\r
- enum type\r
- {\r
-\r
- cut = 1,\r
- mix,\r
- push,\r
- slide,\r
- wipe\r
- };\r
-};\r
-\r
-struct transition_direction\r
+ cut, \r
+ mix, \r
+ push, \r
+ slide, \r
+ wipe,\r
+ count\r
+}\r
+CASPAR_END_ENUM_CLASS(transition)\r
+ \r
+CASPAR_BEGIN_ENUM_CLASS\r
{\r
- enum type\r
- {\r
- from_left = 1,\r
- from_right\r
- };\r
-};\r
-\r
+ from_left,\r
+ from_right,\r
+ count\r
+}\r
+CASPAR_END_ENUM_CLASS(transition_direction)\r
+ \r
struct transition_info\r
{\r
transition_info() \r
, direction(transition_direction::from_left)\r
, tweener(get_tweener(L"linear")){}\r
\r
- size_t duration;\r
- transition_direction::type direction;\r
- transition::type type;\r
- tweener_t tweener;\r
+ size_t duration;\r
+ transition_direction direction;\r
+ transition type;\r
+ tweener_t tweener;\r
};\r
\r
-safe_ptr<frame_producer> create_transition_producer(const field_mode::type& mode, const safe_ptr<frame_producer>& destination, const transition_info& info);\r
+safe_ptr<struct frame_producer> create_transition_producer(const field_mode& mode, const safe_ptr<struct frame_producer>& destination, const transition_info& info);\r
\r
}}
\ No newline at end of file
#include "mixer/gpu/ogl_device.h"\r
#include "mixer/write_frame.h"\r
#include "producer/stage.h"\r
+#include "producer/frame/frame_factory.h"\r
\r
#include <common/diagnostics/graph.h>\r
#include <common/env.h>\r
#pragma once\r
\r
#include <common/memory/safe_ptr.h>\r
-\r
-#include <boost/noncopyable.hpp>\r
+#include <common/no_copy.h>\r
\r
#include <boost/property_tree/ptree_fwd.hpp>\r
\r
namespace caspar { namespace core {\r
\r
-class stage;\r
-class mixer;\r
-class output;\r
-class ogl_device;\r
-struct frame_factory;\r
-struct video_format_desc;\r
-\r
-class video_channel sealed : boost::noncopyable\r
+class video_channel sealed\r
{\r
+ CASPAR_NO_COPY(video_channel);\r
public:\r
- explicit video_channel(int index, const video_format_desc& format_desc, const safe_ptr<ogl_device>& ogl);\r
+ explicit video_channel(int index, const struct video_format_desc& format_desc, const safe_ptr<class ogl_device>& ogl);\r
\r
- safe_ptr<stage> stage();\r
- safe_ptr<mixer> mixer();\r
- safe_ptr<output> output();\r
- safe_ptr<frame_factory> frame_factory();\r
+ safe_ptr<class stage> stage();\r
+ safe_ptr<class mixer> mixer();\r
+ safe_ptr<class output> output();\r
+ safe_ptr<struct frame_factory> frame_factory();\r
\r
- video_format_desc get_video_format_desc() const;\r
- void set_video_format_desc(const video_format_desc& format_desc);\r
+ struct video_format_desc get_video_format_desc() const;\r
+ void set_video_format_desc(const struct video_format_desc& format_desc);\r
\r
boost::property_tree::wptree info() const;\r
\r
(video_format_desc(video_format::x1080p5000, 1920, 1080, 1920, 1080, field_mode::progressive, 50, 1, L"1080p5000", boost::assign::list_of<int>(1920) ))\r
(video_format_desc(video_format::invalid, 0, 0, 0, 0, field_mode::progressive, 1, 1, L"invalid", boost::assign::list_of<int>(1) ));\r
\r
-video_format_desc::video_format_desc(video_format::type format,\r
+video_format_desc::video_format_desc(video_format format,\r
int width,\r
int height,\r
int square_width,\r
int square_height,\r
- field_mode::type field_mode,\r
+ core::field_mode field_mode,\r
int time_scale,\r
int duration,\r
const std::wstring& name,\r
{\r
}\r
\r
-video_format_desc::video_format_desc(video_format::type format)\r
+video_format_desc::video_format_desc(video_format format)\r
+ : format(video_format::invalid)\r
+ , field_mode(field_mode::empty)\r
{\r
- *this = format_descs[format];\r
+ *this = format_descs.at(format.value());\r
}\r
\r
video_format_desc::video_format_desc(const std::wstring& name)\r
+ : format(video_format::invalid)\r
+ , field_mode(field_mode::empty)\r
{ \r
*this = video_format_desc(video_format::invalid);\r
for(auto it = std::begin(format_descs); it != std::end(format_descs)-1; ++it)\r
\r
#pragma once\r
\r
+#include <common/enum_class.h>\r
+\r
#include <vector>\r
#include <string>\r
\r
namespace caspar { namespace core {\r
\r
-struct video_format \r
-{ \r
- enum type\r
- {\r
- pal = 0,\r
- ntsc,\r
- x576p2500,\r
- x720p2500,\r
- x720p5000,\r
- x720p5994,\r
- x720p6000,\r
- x1080p2397,\r
- x1080p2400,\r
- x1080i5000,\r
- x1080i5994,\r
- x1080i6000,\r
- x1080p2500,\r
- x1080p2997,\r
- x1080p3000,\r
- x1080p5000,\r
- invalid,\r
- count\r
- };\r
-};\r
-\r
-struct field_mode \r
-{ \r
- enum type\r
- {\r
- empty = 0,\r
- lower = 1,\r
- upper = 2,\r
- progressive = 3 // NOTE: progressive == lower | upper;\r
- };\r
+CASPAR_BEGIN_ENUM_CLASS\r
+{\r
+ pal, \r
+ ntsc, \r
+ x576p2500, \r
+ x720p2500, \r
+ x720p5000, \r
+ x720p5994, \r
+ x720p6000, \r
+ x1080p2397, \r
+ x1080p2400, \r
+ x1080i5000, \r
+ x1080i5994, \r
+ x1080i6000, \r
+ x1080p2500, \r
+ x1080p2997, \r
+ x1080p3000, \r
+ x1080p5000, \r
+ invalid,\r
+ count\r
+}\r
+CASPAR_END_ENUM_CLASS(video_format);\r
\r
- static std::wstring print(field_mode::type value)\r
- {\r
- switch(value)\r
- {\r
- case progressive:\r
- return L"progressive"; \r
- case lower:\r
- return L"lower";\r
- case upper:\r
- return L"upper";\r
- default:\r
- return L"invalid";\r
- }\r
- }\r
-};\r
+CASPAR_BEGIN_ENUM_CLASS\r
+{\r
+ empty = 0,\r
+ lower = 1,\r
+ upper = 2,\r
+ progressive = 3, // NOTE: progressive == lower | upper;\r
+}\r
+CASPAR_END_ENUM_CLASS(field_mode);\r
\r
struct video_format_desc sealed\r
{\r
- video_format::type format; // video output format\r
+ video_format format; // video output format\r
\r
int width; // output frame width\r
int height; // output frame height\r
int square_width;\r
int square_height;\r
- field_mode::type field_mode; // progressive, interlaced upper field first, interlaced lower field first\r
+ field_mode field_mode; // progressive, interlaced upper field first, interlaced lower field first\r
double fps; // actual framerate, e.g. i50 = 25 fps, p50 = 50 fps\r
int time_scale;\r
int duration;\r
int audio_channels;\r
std::vector<int> audio_cadence;\r
\r
- video_format_desc(video_format::type format,\r
+ video_format_desc(video_format format,\r
int width,\r
int height,\r
int square_width,\r
int square_height,\r
- field_mode::type field_mode,\r
+ core::field_mode field_mode,\r
int time_scale,\r
int duration,\r
const std::wstring& name,\r
\r
video_format_desc& operator=(const video_format_desc& other);\r
\r
- video_format_desc(video_format::type format = video_format::invalid);\r
+ video_format_desc(video_format format = video_format::invalid);\r
video_format_desc(const std::wstring& name);\r
};\r
\r
#include <string>\r
#include <math.h>\r
\r
-#include <common/utility/string.h>\r
+#include <common/utf.h>\r
#include <common/memory/safe_ptr.h>\r
//#include "../common/concurrency/executor.h" // Can't include this due to MSVC lambda bug\r
\r
-#include <common/log/Log.h>\r
+#include <common/log.h>\r
#include <common/exception/exceptions.h>\r
\r
#include <assert.h>\r
\r
#include "util/blue_velvet.h"\r
\r
-#include <common/log/log.h>\r
-#include <common/utility/string.h>\r
+#include <common/log.h>\r
+#include <common/utf.h>\r
\r
#include <core/consumer/frame_consumer.h>\r
\r
#include <common/concurrency/executor.h>\r
#include <common/diagnostics/graph.h>\r
#include <common/memory/memshfl.h>\r
-#include <common/utility/timer.h>\r
-#include <common/utility/assert.h>\r
\r
#include <core/consumer/frame_consumer.h>\r
#include <core/mixer/audio/audio_util.h>\r
\r
#include <tbb/concurrent_queue.h>\r
\r
+#include <boost/assert.hpp>\r
+#include <boost/lexical_cast.hpp>\r
#include <boost/timer.hpp>\r
#include <boost/range/algorithm.hpp>\r
#include <boost/property_tree/ptree.hpp>\r
\r
virtual bool send(const safe_ptr<core::read_frame>& frame) override\r
{\r
- CASPAR_VERIFY(audio_cadence_.front() == static_cast<size_t>(frame->audio_data().size()));\r
+ BOOST_VERIFY(audio_cadence_.front() == static_cast<size_t>(frame->audio_data().size()));\r
boost::range::rotate(audio_cadence_, std::begin(audio_cadence_)+1);\r
\r
consumer_->send(frame);\r
if(params.size() < 1 || params[0] != L"BLUEFISH")\r
return core::frame_consumer::empty();\r
\r
- const auto device_index = params.size() > 1 ? lexical_cast_or_default<int>(params[1], 1) : 1;\r
+ const auto device_index = params.size() > 1 ? boost::lexical_cast<int>(params[1]) : 1;\r
\r
const auto embedded_audio = std::find(params.begin(), params.end(), L"EMBEDDED_AUDIO") != params.end();\r
const auto key_only = std::find(params.begin(), params.end(), L"KEY_ONLY") != params.end();\r
\r
#include "blue_velvet.h"\r
\r
-#include <common/utility/string.h>\r
+#include <common/utf.h>\r
\r
#include <core/video_format.h>\r
\r
blue_velvet_initialize();\r
}\r
\r
-EVideoMode vid_fmt_from_video_format(const core::video_format::type& fmt) \r
+EVideoMode vid_fmt_from_video_format(const core::video_format& fmt) \r
{\r
- switch(fmt)\r
+ switch(fmt.value())\r
{\r
case core::video_format::pal: return VID_FMT_PAL;\r
case core::video_format::ntsc: return VID_FMT_NTSC;\r
#endif\r
\r
#define NOMINMAX\r
+#define WIN32_LEAN_AND_MEAN\r
\r
#include <Windows.h>\r
\r
\r
\r
#include "../common/memory/safe_ptr.h"\r
-#include "../common/utility/string.h"\r
+#include "../common/utf.h"\r
#include "../common/exception/exceptions.h"\r
#include "../common/exception/win32_exception.h"\r
-#include "../common/log/Log.h"\r
+#include "../common/log.h"\r
#include <common/diagnostics/graph.h>\r
#include <common/exception/exceptions.h>\r
#include <common/memory/memshfl.h>\r
-#include <common/utility/assert.h>\r
\r
#include <core/consumer/frame_consumer.h>\r
\r
#include <tbb/concurrent_queue.h>\r
#include <tbb/cache_aligned_allocator.h>\r
\r
+#include <boost/assert.hpp>\r
+#include <boost/lexical_cast.hpp>\r
#include <boost/circular_buffer.hpp>\r
#include <boost/timer.hpp>\r
#include <boost/property_tree/ptree.hpp>\r
\r
virtual bool send(const safe_ptr<core::read_frame>& frame) override\r
{\r
- CASPAR_VERIFY(audio_cadence_.front() == static_cast<int>(frame->audio_data().size()));\r
+ BOOST_VERIFY(audio_cadence_.front() == static_cast<int>(frame->audio_data().size()));\r
boost::range::rotate(audio_cadence_, std::begin(audio_cadence_)+1);\r
\r
consumer_->send(frame);\r
configuration config;\r
\r
if(params.size() > 1)\r
- config.device_index = lexical_cast_or_default<int>(params[1], config.device_index);\r
+ config.device_index = boost::lexical_cast<int>(params[1]);\r
\r
config.internal_key = std::find(params.begin(), params.end(), L"INTERNAL_KEY") != params.end();\r
config.low_latency = std::find(params.begin(), params.end(), L"LOW_LATENCY") != params.end();\r
#include <common/concurrency/com_context.h>\r
#include <common/diagnostics/graph.h>\r
#include <common/exception/exceptions.h>\r
-#include <common/log/log.h>\r
+#include <common/log.h>\r
#include <common/utility/param.h>\r
\r
#include <core/mixer/write_frame.h>\r
#pragma once\r
\r
#include <common/exception/exceptions.h>\r
-#include <common/log/log.h>\r
+#include <common/log.h>\r
#include <core/video_format.h>\r
\r
#include "../interop/DeckLinkAPI_h.h"\r
\r
namespace caspar { namespace decklink {\r
\r
-static BMDDisplayMode get_decklink_video_format(core::video_format::type fmt) \r
+static BMDDisplayMode get_decklink_video_format(core::video_format fmt) \r
{\r
- switch(fmt)\r
+ switch(fmt.value())\r
{\r
case core::video_format::pal: return bmdModePAL;\r
case core::video_format::ntsc: return bmdModeNTSC;\r
}\r
}\r
\r
-static core::video_format::type get_caspar_video_format(BMDDisplayMode fmt) \r
+static core::video_format get_caspar_video_format(BMDDisplayMode fmt) \r
{\r
switch(fmt)\r
{\r
}\r
\r
template<typename T, typename F>\r
-static BMDDisplayMode get_display_mode(const T& device, core::video_format::type fmt, BMDPixelFormat pix_fmt, F flag)\r
+static BMDDisplayMode get_display_mode(const T& device, core::video_format fmt, BMDPixelFormat pix_fmt, F flag)\r
{ \r
return get_display_mode(device, get_decklink_video_format(fmt), pix_fmt, flag);\r
}\r
#endif\r
\r
#define NOMINMAX\r
+#define WIN32_LEAN_AND_MEAN\r
\r
#include <algorithm>\r
#include <array>\r
#include <common/concurrency/executor.h>\r
#include <common/diagnostics/graph.h>\r
#include <common/memory/safe_ptr.h>\r
-#include <common/utility/string.h>\r
+#include <common/utf.h>\r
#include <common/utility/param.h>\r
\r
#include <boost/algorithm/string.hpp>\r
#include "consumer/ffmpeg_consumer.h"\r
#include "producer/ffmpeg_producer.h"\r
\r
-#include <common/log/log.h>\r
+#include <common/log.h>\r
\r
#include <core/consumer/frame_consumer.h>\r
#include <core/producer/frame_producer.h>\r
*/\r
#include "ffmpeg_error.h"\r
\r
-#include <common/utility/string.h>\r
+#include <common/utf.h>\r
\r
#pragma warning(disable: 4146)\r
\r
\r
#include <core/video_format.h>\r
\r
-#include <common/log/log.h>\r
+#include <common/log.h>\r
\r
#include <tbb/cache_aligned_allocator.h>\r
\r
#include "audio_resampler.h"\r
\r
#include <common/exception/exceptions.h>\r
-#include <common/log/log.h>\r
+#include <common/log.h>\r
\r
#if defined(_MSC_VER)\r
#pragma warning (push)\r
#include "video/video_decoder.h"\r
\r
#include <common/env.h>\r
-#include <common/utility/assert.h>\r
+#include <common/log.h>\r
#include <common/utility/param.h>\r
#include <common/diagnostics/graph.h>\r
\r
#include <core/producer/frame/frame_transform.h>\r
\r
#include <boost/algorithm/string.hpp>\r
+#include <boost/assert.hpp>\r
#include <boost/assign.hpp>\r
#include <boost/timer.hpp>\r
#include <boost/foreach.hpp>\r
#include <boost/range/algorithm/find.hpp>\r
#include <boost/property_tree/ptree.hpp>\r
#include <boost/regex.hpp>\r
+#include <boost/thread/future.hpp>\r
\r
#include <tbb/parallel_invoke.h>\r
\r
\r
#include "parallel_yadif.h"\r
\r
-#include <common/log/log.h>\r
+#include <common/log.h>\r
\r
#if defined(_MSC_VER)\r
#pragma warning (push)\r
#include <common/concurrency/executor.h>\r
#include <common/exception/exceptions.h>\r
#include <common/exception/win32_exception.h>\r
-#include <common/log/log.h>\r
+#include <common/log.h>\r
\r
#include <core/video_format.h>\r
\r
\r
#include <core/video_format.h>\r
\r
+#include <ostream>\r
+\r
namespace caspar { namespace ffmpeg {\r
\r
-struct display_mode\r
+enum display_mode\r
{\r
- enum type\r
- {\r
- simple,\r
- duplicate,\r
- half,\r
- interlace,\r
- deinterlace_bob,\r
- deinterlace_bob_reinterlace,\r
- deinterlace,\r
- count,\r
- invalid\r
- };\r
+ simple,\r
+ duplicate,\r
+ half,\r
+ interlace,\r
+ deinterlace_bob,\r
+ deinterlace_bob_reinterlace,\r
+ deinterlace,\r
+ count,\r
+ invalid\r
+};\r
\r
- static std::wstring print(display_mode::type value)\r
+template< typename CharT, typename TraitsT >\r
+std::basic_ostream< CharT, TraitsT >& operator<< (std::basic_ostream<CharT, TraitsT>& o, display_mode value)\r
+{ \r
+ switch(value)\r
{\r
- switch(value)\r
- {\r
- case simple: return L"simple";\r
- case duplicate: return L"duplicate";\r
- case half: return L"half";\r
- case interlace: return L"interlace";\r
- case deinterlace_bob: return L"deinterlace_bob";\r
- case deinterlace_bob_reinterlace: return L"deinterlace_bob_reinterlace";\r
- case deinterlace: return L"deinterlace";\r
- default: return L"invalid";\r
- }\r
+ case simple: o << L"simple";\r
+ case duplicate: o << L"duplicate";\r
+ case half: o << L"half";\r
+ case interlace: o << L"interlace";\r
+ case deinterlace_bob: o << L"deinterlace_bob";\r
+ case deinterlace_bob_reinterlace: o << L"deinterlace_bob_reinterlace";\r
+ case deinterlace: o << L"deinterlace";\r
+ default: o << L"invalid";\r
}\r
-};\r
+ return o;\r
+}\r
+\r
\r
-static display_mode::type get_display_mode(const core::field_mode::type in_mode, double in_fps, const core::field_mode::type out_mode, double out_fps)\r
+static display_mode get_display_mode(const core::field_mode in_mode, double in_fps, const core::field_mode out_mode, double out_fps)\r
{ \r
static const auto epsilon = 2.0;\r
\r
\r
#include <common/env.h>\r
#include <common/exception/exceptions.h>\r
-#include <common/log/log.h>\r
-#include <common/utility/assert.h>\r
+#include <common/log.h>\r
\r
#if defined(_MSC_VER)\r
#pragma warning (push)\r
#pragma warning (pop)\r
#endif\r
\r
+#include <boost/assert.hpp>\r
#include <boost/foreach.hpp>\r
#include <boost/range/algorithm_ext/push_back.hpp>\r
#include <boost/algorithm/string/predicate.hpp>\r
std::queue<std::queue<safe_ptr<write_frame>>> video_streams_;\r
std::queue<core::audio_buffer> audio_streams_;\r
std::queue<safe_ptr<basic_frame>> frame_buffer_;\r
- display_mode::type display_mode_;\r
+ display_mode display_mode_;\r
const double in_fps_;\r
const video_format_desc format_desc_;\r
bool auto_transcode_;\r
}\r
else\r
{\r
- bool DEINTERLACE_FLAG = (flags & core::frame_producer::DEINTERLACE_FLAG) != 0;\r
+ bool DEINTERLACE_FLAG = (flags & core::frame_producer::flags::deinterlace) != 0;\r
\r
if(auto_deinterlace_ && force_deinterlacing_ != DEINTERLACE_FLAG)\r
{\r
if(display_mode_ == display_mode::invalid)\r
update_display_mode(video_frame, force_deinterlacing_);\r
\r
- if(flags & core::frame_producer::ALPHA_ONLY_FLAG)\r
+ if(flags & core::frame_producer::flags::alpha_only)\r
video_frame->format = make_alpha_format(video_frame->format);\r
\r
auto format = video_frame->format;\r
\r
core::audio_buffer pop_audio()\r
{\r
- CASPAR_VERIFY(audio_streams_.front().size() >= static_cast<size_t>(audio_cadence_.front()));\r
+ BOOST_VERIFY(audio_streams_.front().size() >= static_cast<size_t>(audio_cadence_.front()));\r
\r
auto begin = audio_streams_.front().begin();\r
auto end = begin + audio_cadence_.front();\r
video_streams_.back().push(make_write_frame(this, make_safe_ptr(av_frame), frame_factory_, 0));\r
}\r
filter_ = filter(filter_str);\r
- CASPAR_LOG(info) << L"[frame_muxer] " << display_mode::print(display_mode_) << L" " << print_mode(frame->width, frame->height, in_fps_, frame->interlaced_frame > 0);\r
+ CASPAR_LOG(info) << L"[frame_muxer] " << display_mode_ << L" " << print_mode(frame->width, frame->height, in_fps_, frame->interlaced_frame > 0);\r
}\r
}\r
\r
\r
#include "tbb_avcodec.h"\r
\r
-#include <common/log/log.h>\r
+#include <common/log.h>\r
#include <common/env.h>\r
-#include <common/utility/assert.h>\r
\r
#include <tbb/atomic.h>\r
#include <tbb/parallel_for.h>\r
tbb::atomic<int> counter; \r
counter = 0; \r
\r
- CASPAR_VERIFY(tbb::tbb_thread::hardware_concurrency() < 16);\r
+ BOOST_VERIFY(tbb::tbb_thread::hardware_concurrency() < 16);\r
// Note: this will probably only work when tbb::task_scheduler_init::num_threads() < 16.\r
tbb::parallel_for(tbb::blocked_range<int>(0, count, 2), [&](const tbb::blocked_range<int> &r) \r
{ \r
#include "flv.h"\r
\r
#include <common/exception/exceptions.h>\r
-#include <common/log/log.h>\r
+#include <common/log.h>\r
\r
#include <boost/filesystem.hpp>\r
\r
#include <core/mixer/write_frame.h>\r
\r
#include <common/exception/exceptions.h>\r
-#include <common/utility/assert.h>\r
\r
#include <tbb/parallel_for.h>\r
\r
+#include <boost/assert.hpp>\r
#include <boost/filesystem.hpp>\r
#include <boost/lexical_cast.hpp>\r
\r
return video;\r
}\r
\r
-core::field_mode::type get_mode(const AVFrame& frame)\r
+core::field_mode get_mode(const AVFrame& frame)\r
{\r
if(!frame.interlaced_frame)\r
return core::field_mode::progressive;\r
return frame.top_field_first ? core::field_mode::upper : core::field_mode::lower;\r
}\r
\r
-core::pixel_format::type get_pixel_format(PixelFormat pix_fmt)\r
+core::pixel_format get_pixel_format(PixelFormat pix_fmt)\r
{\r
switch(pix_fmt)\r
{\r
core::pixel_format_desc desc;\r
desc.pix_fmt = get_pixel_format(pix_fmt);\r
\r
- switch(desc.pix_fmt)\r
+ switch(desc.pix_fmt.value())\r
{\r
case core::pixel_format::gray:\r
case core::pixel_format::luma:\r
\r
int make_alpha_format(int format)\r
{\r
- switch(get_pixel_format(static_cast<PixelFormat>(format)))\r
+ switch(get_pixel_format(static_cast<PixelFormat>(format)).value())\r
{\r
case core::pixel_format::ycbcr:\r
case core::pixel_format::ycbcra:\r
const auto height = decoded_frame->height;\r
auto desc = get_pixel_format_desc(static_cast<PixelFormat>(decoded_frame->format), width, height);\r
\r
- if(flags & core::frame_producer::ALPHA_ONLY_FLAG)\r
+ if(flags & core::frame_producer::flags::alpha_only)\r
desc = get_pixel_format_desc(static_cast<PixelFormat>(make_alpha_format(decoded_frame->format)), width, height);\r
\r
std::shared_ptr<core::write_frame> write;\r
if(target_pix_fmt == PIX_FMT_BGRA)\r
{\r
auto size = avpicture_fill(reinterpret_cast<AVPicture*>(av_frame.get()), write->image_data().begin(), PIX_FMT_BGRA, width, height);\r
- CASPAR_VERIFY(size == write->image_data().size()); \r
+ BOOST_VERIFY(size == write->image_data().size()); \r
}\r
else\r
{\r
auto decoded = decoded_frame->data[n];\r
auto decoded_linesize = decoded_frame->linesize[n];\r
\r
- CASPAR_ASSERT(decoded);\r
- CASPAR_ASSERT(write->image_data(n).begin());\r
+ BOOST_ASSERT(decoded);\r
+ BOOST_ASSERT(write->image_data(n).begin());\r
\r
// Copy line by line since ffmpeg sometimes pads each line.\r
tbb::affinity_partitioner ap;\r
double closest_fps = 0.0;\r
for(int n = 0; n < core::video_format::count; ++n)\r
{\r
- auto format = core::video_format_desc(static_cast<core::video_format::type>(n));\r
+ auto format = core::video_format_desc(core::video_format(n));\r
\r
double diff1 = std::abs(format.fps - fps);\r
double diff2 = std::abs(closest_fps - fps);\r
\r
static const int CASPAR_PIX_FMT_LUMA = 10; // Just hijack some unual pixel format.\r
\r
-core::field_mode::type get_mode(const AVFrame& frame);\r
+core::field_mode get_mode(const AVFrame& frame);\r
int make_alpha_format(int format); // NOTE: Be careful about CASPAR_PIX_FMT_LUMA, change it to PIX_FMT_GRAY8 if you want to use the frame inside some ffmpeg function.\r
safe_ptr<core::write_frame> make_write_frame(const void* tag, const safe_ptr<AVFrame>& decoded_frame, const safe_ptr<core::frame_factory>& frame_factory, int flags);\r
\r
\r
#include "../../ffmpeg_error.h"\r
\r
-#include <common/log/log.h>\r
+#include <common/log.h>\r
#include <core/producer/frame/frame_transform.h>\r
#include <core/producer/frame/frame_factory.h>\r
\r
\r
#pragma once\r
\r
+#define NOMINMAX\r
+#define WIN32_LEAN_AND_MEAN\r
+\r
#include "../common/compiler/vs/disable_silly_warnings.h"\r
\r
#ifdef _DEBUG\r
#include <boost/regex.hpp>\r
#include <boost/property_tree/ptree.hpp>\r
\r
-#include "../common/utility/string.h"\r
+#include "../common/utf.h"\r
#include "../common/memory/safe_ptr.h"\r
//#include "../common/concurrency/executor.h" // Can't include this due to MSVC lambda bug\r
\r
-#include "../common/log/Log.h"\r
+#include "../common/log.h"\r
#include "../common/exception/exceptions.h"\r
#include "../common/exception/win32_exception.h"\r
#include "FlashAxContainer.h"\r
#include "../interop/TimerHelper.h"\r
\r
-#include <common/log/log.h>\r
+#include <common/log.h>\r
\r
#if defined(_MSC_VER)\r
#pragma warning (push, 2) // TODO\r
if(boost::filesystem::wpath(filename).extension() == L"")\r
filename += L".ft";\r
\r
- auto str = (boost::wformat(L"<invoke name=\"Add\" returntype=\"xml\"><arguments><number>%1%</number><string>%2%</string>%3%<string>%4%</string><string><![CDATA[%5%]]></string></arguments></invoke>") % layer % filename % (play_on_load?TEXT("<true/>"):TEXT("<false/>")) % label % data).str();\r
+ auto str = (boost::wformat(L"<invoke name=\"Add\" returntype=\"xml\"><arguments><number>%1%</number><string>%2%</string>%3%<string>%4%</string><string><![CDATA[%5%]]></string></arguments></invoke>") % layer % filename % (play_on_load?L"<true/>":L"<false/>") % label % data).str();\r
\r
CASPAR_LOG(info) << flash_producer_->print() << " Invoking add-command: " << str;\r
return flash_producer_->call(str);\r
\r
//cg_producer\r
\r
- void add(int layer, const std::wstring& template_name, bool play_on_load, const std::wstring& start_from_label = TEXT(""), const std::wstring& data = TEXT(""));\r
+ void add(int layer, const std::wstring& template_name, bool play_on_load, const std::wstring& start_from_label = L"", const std::wstring& data = L"");\r
void remove(int layer);\r
void play(int layer);\r
void stop(int layer, unsigned int mix_out_duration);\r
#include <common/concurrency/executor.h>\r
#include <common/concurrency/lock.h>\r
#include <common/diagnostics/graph.h>\r
-#include <common/utility/timer.h>\r
+#include <common/prec_timer.h>\r
\r
#include <boost/filesystem.hpp>\r
#include <boost/property_tree/ptree.hpp>\r
boost::timer frame_timer_;\r
boost::timer tick_timer_;\r
\r
- high_prec_timer timer_;\r
+ prec_timer timer_;\r
\r
const int width_;\r
const int height_;\r
\r
#include <common/exception/exceptions.h>\r
#include <common/env.h>\r
-#include <common/log/log.h>\r
-#include <common/utility/string.h>\r
+#include <common/log.h>\r
+#include <common/utf.h>\r
\r
#include <core/consumer/frame_consumer.h>\r
#include <core/video_format.h>\r
#include <core/producer/frame_producer.h>\r
#include <core/consumer/frame_consumer.h>\r
\r
-#include <common/utility/string.h>\r
+#include <common/utf.h>\r
\r
#include <FreeImage.h>\r
\r
#include <core/mixer/write_frame.h>\r
\r
#include <common/env.h>\r
-#include <common/log/log.h>\r
+#include <common/log.h>\r
\r
#include <boost/assign.hpp>\r
#include <boost/filesystem.hpp>\r
#include <core/mixer/write_frame.h>\r
\r
#include <common/env.h>\r
-#include <common/log/log.h>\r
+#include <common/log.h>\r
#include <common/exception/exceptions.h>\r
\r
#include <boost/assign.hpp>\r
#include "image_loader.h"\r
\r
#include <common/exception/Exceptions.h>\r
-#include <common/utility/string.h>\r
+#include <common/utf.h>\r
\r
#if defined(_MSC_VER)\r
#pragma warning (disable : 4714) // marked as __forceinline not inlined\r
\r
#include <common/exception/exceptions.h>\r
#include <common/diagnostics/graph.h>\r
-#include <common/log/log.h>\r
-#include <common/utility/timer.h>\r
-#include <common/utility/string.h>\r
+#include <common/log.h>\r
+#include <common/utf.h>\r
\r
#include <core/consumer/frame_consumer.h>\r
#include <core/mixer/audio/audio_util.h>\r
\r
#include <common/diagnostics/graph.h>\r
#include <common/gl/gl_check.h>\r
-#include <common/log/log.h>\r
+#include <common/log.h>\r
#include <common/memory/safe_ptr.h>\r
#include <common/memory/memshfl.h>\r
-#include <common/utility/timer.h>\r
-#include <common/utility/string.h>\r
+#include <common/utf.h>\r
\r
#include <ffmpeg/producer/filter/filter.h>\r
\r
#pragma once\r
\r
#define NOMINMAX\r
+#define WIN32_LEAN_AND_MEAN\r
\r
#if defined(_MSC_VER)\r
# ifndef _SCL_SECURE_NO_WARNINGS\r
#include <boost/foreach.hpp>\r
#include <boost/range/algorithm.hpp>\r
\r
-#include "../common/utility/string.h"\r
+#include "../common/utf.h"\r
#include "../common/memory/safe_ptr.h"\r
//#include "../common/concurrency/executor.h" // Can't include this due to MSVC lambda bug\r
\r
-#include "../common/log/Log.h"\r
+#include "../common/log.h"\r
#include "../common/exception/exceptions.h"\r
#include "../common/exception/win32_exception.h"\r
\r
\r
#include <common/env.h>\r
\r
-#include <common/log/log.h>\r
+#include <common/log.h>\r
#include <common/diagnostics/graph.h>\r
#include <common/os/windows/current_version.h>\r
#include <common/os/windows/system_info.h>\r
{ \r
if(_parameters[0] == L"KEYER" || _parameters[0] == L"IS_KEY")\r
{\r
- bool value = lexical_cast_or_default(_parameters.at(1), false);\r
+ bool value = boost::lexical_cast<int>(_parameters.at(1));\r
auto transform = [=](frame_transform transform) -> frame_transform\r
{\r
transform.is_key = value;\r
}\r
else if(_parameters[0] == L"OPACITY")\r
{\r
- int duration = _parameters.size() > 2 ? lexical_cast_or_default(_parameters[2], 0) : 0;\r
+ int duration = _parameters.size() > 2 ? boost::lexical_cast<int>(_parameters[2]) : 0;\r
std::wstring tween = _parameters.size() > 3 ? _parameters[3] : L"linear";\r
\r
double value = boost::lexical_cast<double>(_parameters.at(1));\r
}\r
else if(_parameters[0] == L"FILL" || _parameters[0] == L"FILL_RECT")\r
{\r
- int duration = _parameters.size() > 5 ? lexical_cast_or_default(_parameters[5], 0) : 0;\r
+ int duration = _parameters.size() > 5 ? boost::lexical_cast<int>(_parameters[5]) : 0;\r
std::wstring tween = _parameters.size() > 6 ? _parameters[6] : L"linear";\r
double x = boost::lexical_cast<double>(_parameters.at(1));\r
double y = boost::lexical_cast<double>(_parameters.at(2));\r
}\r
else if(_parameters[0] == L"CLIP" || _parameters[0] == L"CLIP_RECT")\r
{\r
- int duration = _parameters.size() > 5 ? lexical_cast_or_default(_parameters[5], 0) : 0;\r
+ int duration = _parameters.size() > 5 ? boost::lexical_cast<int>(_parameters[5]) : 0;\r
std::wstring tween = _parameters.size() > 6 ? _parameters[6] : L"linear";\r
double x = boost::lexical_cast<double>(_parameters.at(1));\r
double y = boost::lexical_cast<double>(_parameters.at(2));\r
}\r
else if(_parameters[0] == L"GRID")\r
{\r
- int duration = _parameters.size() > 2 ? lexical_cast_or_default(_parameters[2], 0) : 0;\r
+ int duration = _parameters.size() > 2 ? boost::lexical_cast<int>(_parameters[2]) : 0;\r
std::wstring tween = _parameters.size() > 3 ? _parameters[3] : L"linear";\r
int n = boost::lexical_cast<int>(_parameters.at(1));\r
double delta = 1.0/static_cast<double>(n);\r
else if(_parameters[0] == L"BRIGHTNESS")\r
{\r
auto value = boost::lexical_cast<double>(_parameters.at(1));\r
- int duration = _parameters.size() > 2 ? lexical_cast_or_default(_parameters[2], 0) : 0;\r
+ int duration = _parameters.size() > 2 ? boost::lexical_cast<int>(_parameters[2]) : 0;\r
std::wstring tween = _parameters.size() > 3 ? _parameters[3] : L"linear";\r
auto transform = [=](frame_transform transform) -> frame_transform\r
{\r
else if(_parameters[0] == L"SATURATION")\r
{\r
auto value = boost::lexical_cast<double>(_parameters.at(1));\r
- int duration = _parameters.size() > 2 ? lexical_cast_or_default(_parameters[2], 0) : 0;\r
+ int duration = _parameters.size() > 2 ? boost::lexical_cast<int>(_parameters[2]) : 0;\r
std::wstring tween = _parameters.size() > 3 ? _parameters[3] : L"linear";\r
auto transform = [=](frame_transform transform) -> frame_transform\r
{\r
else if(_parameters[0] == L"CONTRAST")\r
{\r
auto value = boost::lexical_cast<double>(_parameters.at(1));\r
- int duration = _parameters.size() > 2 ? lexical_cast_or_default(_parameters[2], 0) : 0;\r
+ int duration = _parameters.size() > 2 ? boost::lexical_cast<int>(_parameters[2]) : 0;\r
std::wstring tween = _parameters.size() > 3 ? _parameters[3] : L"linear";\r
auto transform = [=](frame_transform transform) -> frame_transform\r
{\r
value.gamma = boost::lexical_cast<double>(_parameters.at(3));\r
value.min_output = boost::lexical_cast<double>(_parameters.at(4));\r
value.max_output = boost::lexical_cast<double>(_parameters.at(5));\r
- int duration = _parameters.size() > 6 ? lexical_cast_or_default(_parameters[6], 0) : 0;\r
+ int duration = _parameters.size() > 6 ? boost::lexical_cast<int>(_parameters[6]) : 0;\r
std::wstring tween = _parameters.size() > 7 ? _parameters[7] : L"linear";\r
\r
auto transform = [=](frame_transform transform) -> frame_transform\r
}\r
else if(_parameters[0] == L"VOLUME")\r
{\r
- int duration = _parameters.size() > 2 ? lexical_cast_or_default(_parameters[2], 0) : 0;\r
+ int duration = _parameters.size() > 2 ? boost::lexical_cast<int>(_parameters[2]) : 0;\r
std::wstring tween = _parameters.size() > 3 ? _parameters[3] : L"linear";\r
double value = boost::lexical_cast<double>(_parameters[1]);\r
\r
if(boost::regex_match(message, what, expr))\r
{\r
auto transition = what["TRANSITION"].str();\r
- transitionInfo.duration = lexical_cast_or_default<size_t>(what["DURATION"].str());\r
+ transitionInfo.duration = boost::lexical_cast<size_t>(what["DURATION"].str());\r
auto direction = what["DIRECTION"].matched ? what["DIRECTION"].str() : L"";\r
auto tween = what["TWEEN"].matched ? what["TWEEN"].str() : L"";\r
transitionInfo.tweener = get_tweener(tween); \r
#include "AsyncEventServer.h"\r
#include "SocketInfo.h"\r
\r
-#include <common/log/log.h>\r
+#include <common/log.h>\r
#include <string>\r
#include <algorithm>\r
#include <boost/algorithm/string/replace.hpp>\r
<?xml version="1.0" encoding="utf-8"?>\r
<configuration>\r
<paths>\r
- <media-path>D:\casparcg\_media\</media-path>\r
- <log-path>D:\casparcg\_log\</log-path>\r
- <data-path>D:\casparcg\_data\</data-path>\r
- <template-path>D:\casparcg\_templates\</template-path>\r
+ <media-path>M:\caspar\_media\</media-path>\r
+ <log-path>M:\caspar\_log\</log-path>\r
+ <data-path>M:\caspar\_data\</data-path>\r
+ <template-path>M:\caspar\_templates\</template-path>\r
</paths>\r
<log-level>trace</log-level>\r
<channel-grid>true</channel-grid>\r
// Replace the standard memory allocation routines in Microsoft* C/C++ RTL \r
// (malloc/free, global new/delete, etc.) with the TBB memory allocator. \r
\r
+#include "stdafx.h"\r
+\r
#ifdef _DEBUG\r
#define _CRTDBG_MAP_ALLOC\r
#include <stdlib.h>\r
\r
#include "server.h"\r
\r
-#define NOMINMAX\r
-#define WIN32_LEAN_AND_MEAN\r
-\r
#include <windows.h>\r
#include <winnt.h>\r
#include <mmsystem.h>\r
#include <common/env.h>\r
#include <common/exception/win32_exception.h>\r
#include <common/exception/exceptions.h>\r
-#include <common/log/log.h>\r
+#include <common/log.h>\r
#include <common/gl/gl_check.h>\r
#include <common/os/windows/current_version.h>\r
#include <common/os/windows/system_info.h>\r
*\r
* Author: Robert Nagy, ronag89@gmail.com\r
*/\r
+#include "stdafx.h"\r
+\r
#include "server.h"\r
\r
#include <common/env.h>\r
#include <common/exception/exceptions.h>\r
-#include <common/utility/string.h>\r
+#include <common/utf.h>\r
\r
#include <core/mixer/gpu/ogl_device.h>\r
#include <core/video_channel.h>\r
</ItemGroup>\r
<ItemGroup>\r
<ClCompile Include="server.cpp">\r
- <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NotUsing</PrecompiledHeader>\r
- <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NotUsing</PrecompiledHeader>\r
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Use</PrecompiledHeader>\r
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Use</PrecompiledHeader>\r
</ClCompile>\r
<ClCompile Include="main.cpp">\r
- <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NotUsing</PrecompiledHeader>\r
- <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NotUsing</PrecompiledHeader>\r
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Use</PrecompiledHeader>\r
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Use</PrecompiledHeader>\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
<ItemGroup>\r
<ItemGroup>\r
<ClInclude Include="server.h" />\r
<ClInclude Include="resource.h" />\r
+ <ClInclude Include="stdafx.h" />\r
</ItemGroup>\r
<ItemGroup>\r
<ResourceCompile Include="shell.rc" />\r
<ClCompile Include="server.cpp">\r
<Filter>source</Filter>\r
</ClCompile>\r
+ <ClCompile Include="stdafx.cpp">\r
+ <Filter>stdafx</Filter>\r
+ </ClCompile>\r
</ItemGroup>\r
<ItemGroup>\r
<None Include="casparcg.config" />\r
<ClInclude Include="resource.h">\r
<Filter>source</Filter>\r
</ClInclude>\r
+ <ClInclude Include="stdafx.h">\r
+ <Filter>stdafx</Filter>\r
+ </ClInclude>\r
</ItemGroup>\r
<ItemGroup>\r
<Filter Include="source">\r
<UniqueIdentifier>{39e46848-dfec-441d-b0c0-f131380cdc6e}</UniqueIdentifier>\r
</Filter>\r
+ <Filter Include="stdafx">\r
+ <UniqueIdentifier>{d8384077-3b1f-45df-93e3-26aa9d97bdb3}</UniqueIdentifier>\r
+ </Filter>\r
</ItemGroup>\r
<ItemGroup>\r
<ResourceCompile Include="shell.rc">\r
--- /dev/null
+#include "stdafx.h"
\ No newline at end of file
--- /dev/null
+#pragma once\r
+\r
+#define NOMINMAX\r
+#define WIN32_LEAN_AND_MEAN
\ No newline at end of file