EndProject\r
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shell", "shell\shell.vcxproj", "{8C26C94F-8092-4769-8D84-DEA479721C5B}"\r
EndProject\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "protocol", "protocol\protocol.vcxproj", "{2040B361-1FB6-488E-84A5-38A580DA90DE}"\r
+EndProject\r
Global\r
GlobalSection(SubversionScc) = preSolution\r
Svn-Managed = True\r
{8C26C94F-8092-4769-8D84-DEA479721C5B}.Debug|Win32.Build.0 = Debug|Win32\r
{8C26C94F-8092-4769-8D84-DEA479721C5B}.Release|Win32.ActiveCfg = Release|Win32\r
{8C26C94F-8092-4769-8D84-DEA479721C5B}.Release|Win32.Build.0 = Release|Win32\r
+ {2040B361-1FB6-488E-84A5-38A580DA90DE}.Debug|Win32.ActiveCfg = Debug|Win32\r
+ {2040B361-1FB6-488E-84A5-38A580DA90DE}.Debug|Win32.Build.0 = Debug|Win32\r
+ {2040B361-1FB6-488E-84A5-38A580DA90DE}.Release|Win32.ActiveCfg = Release|Win32\r
+ {2040B361-1FB6-488E-84A5-38A580DA90DE}.Release|Win32.Build.0 = Release|Win32\r
EndGlobalSection\r
GlobalSection(SolutionProperties) = preSolution\r
HideSolutionNode = FALSE\r
<ProjectGuid>{02308602-7FE0-4253-B96E-22134919F56A}</ProjectGuid>\r
<Keyword>Win32Proj</Keyword>\r
<RootNamespace>common</RootNamespace>\r
+ <ProjectName>common</ProjectName>\r
</PropertyGroup>\r
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />\r
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">\r
<ItemGroup>\r
<ClInclude Include="compiler\vs\disable_silly_warnings.h" />\r
<ClInclude Include="concurrency\executor.h" />\r
- <ClInclude Include="concurrency\Thread.h" />\r
<ClInclude Include="exception\exceptions.h" />\r
<ClInclude Include="exception\win32_exception.h" />\r
<ClInclude Include="gl\gl_check.h" />\r
- <ClInclude Include="io\AsyncEventServer.h" />\r
- <ClInclude Include="io\ClientInfo.h" />\r
- <ClInclude Include="io\ProtocolStrategy.h" />\r
- <ClInclude Include="io\SocketInfo.h" />\r
<ClInclude Include="log\log.h" />\r
<ClInclude Include="memory\page_locked_allocator.h" />\r
<ClInclude Include="memory\safe_ptr.h" />\r
+ <ClInclude Include="env.h" />\r
<ClInclude Include="stdafx.h" />\r
<ClInclude Include="utility\string_convert.h" />\r
<ClInclude Include="utility\timer.h" />\r
</ItemGroup>\r
<ItemGroup>\r
- <ClCompile Include="concurrency\Thread.cpp">\r
- <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">../StdAfx.h</PrecompiledHeaderFile>\r
- <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">../StdAfx.h</PrecompiledHeaderFile>\r
- </ClCompile>\r
<ClCompile Include="exception\win32_exception.cpp">\r
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">../StdAfx.h</PrecompiledHeaderFile>\r
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">../StdAfx.h</PrecompiledHeaderFile>\r
</ClCompile>\r
- <ClCompile Include="io\AsyncEventServer.cpp">\r
- <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">../StdAfx.h</PrecompiledHeaderFile>\r
- <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">../StdAfx.h</PrecompiledHeaderFile>\r
- </ClCompile>\r
- <ClCompile Include="io\SocketInfo.cpp">\r
- <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">../StdAfx.h</PrecompiledHeaderFile>\r
- <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">../StdAfx.h</PrecompiledHeaderFile>\r
- </ClCompile>\r
<ClCompile Include="log\log.cpp">\r
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">../StdAfx.h</PrecompiledHeaderFile>\r
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">../StdAfx.h</PrecompiledHeaderFile>\r
</ClCompile>\r
+ <ClCompile Include="env.cpp" />\r
<ClCompile Include="stdafx.cpp">\r
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>\r
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>\r
<Filter Include="Source\compiler\vs">\r
<UniqueIdentifier>{28c25c8a-1277-4d2c-9e85-5af33f9938ea}</UniqueIdentifier>\r
</Filter>\r
- <Filter Include="Source\io">\r
- <UniqueIdentifier>{f4b0d63f-3cb3-4ab4-a6b9-3f249204dd3f}</UniqueIdentifier>\r
- </Filter>\r
<Filter Include="Afx">\r
<UniqueIdentifier>{9250809a-3410-418d-95ca-ff2dcb6f0578}</UniqueIdentifier>\r
</Filter>\r
</Filter>\r
</ItemGroup>\r
<ItemGroup>\r
- <ClCompile Include="io\SocketInfo.cpp">\r
- <Filter>Source\io</Filter>\r
- </ClCompile>\r
- <ClCompile Include="io\AsyncEventServer.cpp">\r
- <Filter>Source\io</Filter>\r
- </ClCompile>\r
<ClCompile Include="exception\win32_exception.cpp">\r
<Filter>Source\exception</Filter>\r
</ClCompile>\r
- <ClCompile Include="concurrency\Thread.cpp">\r
- <Filter>Source\io</Filter>\r
- </ClCompile>\r
<ClCompile Include="stdafx.cpp">\r
<Filter>Afx</Filter>\r
</ClCompile>\r
<ClCompile Include="log\log.cpp">\r
<Filter>Source\log</Filter>\r
</ClCompile>\r
+ <ClCompile Include="env.cpp">\r
+ <Filter>Source</Filter>\r
+ </ClCompile>\r
</ItemGroup>\r
<ItemGroup>\r
- <ClInclude Include="io\AsyncEventServer.h">\r
- <Filter>Source\io</Filter>\r
- </ClInclude>\r
- <ClInclude Include="io\ClientInfo.h">\r
- <Filter>Source\io</Filter>\r
- </ClInclude>\r
- <ClInclude Include="io\ProtocolStrategy.h">\r
- <Filter>Source\io</Filter>\r
- </ClInclude>\r
- <ClInclude Include="io\SocketInfo.h">\r
- <Filter>Source\io</Filter>\r
- </ClInclude>\r
<ClInclude Include="exception\exceptions.h">\r
<Filter>Source\exception</Filter>\r
</ClInclude>\r
<ClInclude Include="compiler\vs\disable_silly_warnings.h">\r
<Filter>Source\compiler\vs</Filter>\r
</ClInclude>\r
- <ClInclude Include="concurrency\Thread.h">\r
- <Filter>Source\io</Filter>\r
- </ClInclude>\r
<ClInclude Include="stdafx.h">\r
<Filter>Afx</Filter>\r
</ClInclude>\r
<ClInclude Include="memory\safe_ptr.h">\r
<Filter>Source\memory</Filter>\r
</ClInclude>\r
+ <ClInclude Include="env.h">\r
+ <Filter>Source</Filter>\r
+ </ClInclude>\r
</ItemGroup>\r
</Project>
\ No newline at end of file
--- /dev/null
+#include "stdafx.h"\r
+\r
+#include "env.h"\r
+\r
+#include "utility/string_convert.h"\r
+\r
+#include <boost/property_tree/ptree.hpp>\r
+#include <boost/property_tree/xml_parser.hpp>\r
+#include <boost/filesystem.hpp>\r
+#include <boost/thread/once.hpp>\r
+\r
+#include <functional>\r
+\r
+namespace caspar\r
+{\r
+\r
+std::wstring media;\r
+std::wstring log;\r
+std::wstring ftemplate;\r
+std::wstring data;\r
+boost::property_tree::ptree pt;\r
+\r
+void do_setup()\r
+{\r
+ std::string initialPath = boost::filesystem::initial_path().file_string();\r
+ \r
+ boost::property_tree::read_xml(initialPath + "\\caspar.config", pt);\r
+\r
+ auto paths = pt.get_child("configuration.paths");\r
+ media = widen(paths.get("media-path", initialPath + "\\media\\"));\r
+ log = widen(paths.get("log-path", initialPath + "\\log\\"));\r
+ ftemplate = widen(paths.get("template-path", initialPath + "\\template\\"));\r
+ data = widen(paths.get("data-path", initialPath + "\\data\\"));\r
+}\r
+\r
+void setup()\r
+{\r
+ static boost::once_flag setup_flag = BOOST_ONCE_INIT;\r
+ boost::call_once(do_setup, setup_flag); \r
+}\r
+ \r
+const std::wstring& env::media_folder()\r
+{\r
+ setup();\r
+ return media;\r
+}\r
+\r
+const std::wstring& env::log_folder()\r
+{\r
+ setup();\r
+ return log;\r
+}\r
+\r
+const std::wstring& env::template_folder()\r
+{\r
+ setup();\r
+ return ftemplate;\r
+}\r
+\r
+const std::wstring& env::data_folder()\r
+{\r
+ setup();\r
+ return data;\r
+}\r
+\r
+const std::wstring& env::version()\r
+{\r
+ static std::wstring ver = L"2.0.0.2";\r
+ return ver;\r
+}\r
+\r
+const std::wstring& env::version_tag()\r
+{\r
+ static std::wstring tag = L"Experimental";\r
+ return tag;\r
+}\r
+\r
+const boost::property_tree::ptree& env::properties()\r
+{\r
+ setup();\r
+ return pt;\r
+}\r
+\r
+}
\ No newline at end of file
--- /dev/null
+#pragma once\r
+\r
+#include <boost/property_tree/ptree.hpp>\r
+\r
+namespace caspar{\r
+\r
+struct env\r
+{\r
+ static const std::wstring& media_folder();\r
+ static const std::wstring& log_folder();\r
+ static const std::wstring& template_folder(); \r
+ static const std::wstring& data_folder();\r
+ static const std::wstring& version();\r
+ static const std::wstring& version_tag();\r
+\r
+ static const boost::property_tree::ptree& properties();\r
+};\r
+\r
+};
\ No newline at end of file
+++ /dev/null
-/*\r
-* copyright (c) 2010 Sveriges Television AB <info@casparcg.com>\r
-*\r
-* This file is part of CasparCG.\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
-*/\r
- \r
-#include "../StdAfx.h"\r
-\r
-#if defined(_MSC_VER)\r
-#pragma warning (push, 1) // TODO: Legacy code, just disable warnings, will replace with boost::asio in future\r
-#endif\r
-\r
-#include "SerialPort.h"\r
-\r
-#include "../log/log.h"\r
-\r
-#include <tchar.h>\r
-\r
-namespace caspar { namespace IO {\r
-\r
-using namespace common;\r
-\r
-void LogCommError(const std::wstring& msg, int errorCode);\r
-\r
-\r
-/* From winbase.h \r
-#define NOPARITY 0\r
-#define ODDPARITY 1\r
-#define EVENPARITY 2\r
-#define MARKPARITY 3\r
-#define SPACEPARITY 4\r
-\r
-#define ONESTOPBIT 0\r
-#define ONE5STOPBITS 1\r
-#define TWOSTOPBITS 2\r
-*/\r
-\r
-SerialPort::SerialPort(const ProtocolStrategyPtr& pProtocol, DWORD baudRate, BYTE parity, BYTE dataBits, BYTE stopBits, const std::wstring& portName, bool spy)\r
- : hPort_(0), portName_(portName), spy_(spy), pProtocolStrategy_(pProtocol)\r
-{\r
- pClientInfo_ = SerialPortClientInfoPtr(new SerialPortClientInfo(this));\r
- ZeroMemory(&commSettings_, sizeof(DCB));\r
- commSettings_.DCBlength = sizeof(commSettings_);\r
- commSettings_.BaudRate = baudRate;\r
- commSettings_.fBinary = TRUE;\r
- commSettings_.Parity = parity;\r
- if(parity != 0)\r
- commSettings_.fParity = TRUE;\r
-\r
- commSettings_.ByteSize = dataBits;\r
- commSettings_.StopBits = stopBits;\r
- commSettings_.fNull = TRUE;\r
-}\r
-\r
-SerialPort::~SerialPort() {\r
- Stop();\r
-}\r
-\r
-\r
-bool SerialPort::Start() {\r
- if(pProtocolStrategy_ == 0)\r
- return false;\r
-\r
- pListener_ = ListenerPtr(new Listener(this, pProtocolStrategy_));\r
-\r
- if(hPort_ == 0) {\r
-\r
- //Open the port\r
- HANDLE port = CreateFile(portName_.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0);\r
- if(port == INVALID_HANDLE_VALUE) {\r
- //TODO: Throw Win32ErrorException\r
- LogCommError(TEXT("Failed to open port. Error: "), GetLastError());\r
-\r
- return false;\r
- }\r
-\r
- //Setup port\r
- if(!SetCommState(port, &commSettings_)) {\r
- //TODO: Throw Win32ErrorException\r
- LogCommError(TEXT("Failed to set com-settings. Error: "), GetLastError());\r
-\r
- CloseHandle(port);\r
- return false;\r
- }\r
-\r
- COMMTIMEOUTS timeouts;\r
- ZeroMemory(&timeouts, sizeof(timeouts));\r
- timeouts.ReadIntervalTimeout = MAXDWORD;\r
- SetCommTimeouts(port, &timeouts);\r
-\r
- hPort_ = port;\r
-\r
- if(listenerThread_.Start(pListener_.get())) {\r
- if(spy_) {\r
- //don't send anything if we're spying, it would most likely trash the incomming data\r
- return true;\r
- }\r
- else {\r
- pWriter_ = WriterPtr(new Writer(hPort_));\r
- return writerThread_.Start(pWriter_.get());\r
- }\r
- }\r
- }\r
-\r
- return false;\r
-}\r
-\r
-void SerialPort::Stop() {\r
- if(hPort_ != 0) {\r
- if(listenerThread_.IsRunning())\r
- listenerThread_.Stop();\r
-\r
- if(writerThread_.IsRunning())\r
- writerThread_.Stop();\r
-\r
- CloseHandle(hPort_);\r
- hPort_ = 0;\r
- }\r
-}\r
-\r
-\r
-/// Listener\r
-//////////////\r
-const int SerialPort::Listener::WaitTimeout = 1000;\r
-const int SerialPort::Listener::InputBufferSize = 256;\r
-\r
-SerialPort::Listener::Listener(SerialPort* port, ProtocolStrategyPtr pPS) : pPort_(port), pProtocolStrategy_(pPS), overlappedReadEvent_(TRUE, FALSE), bWaitingOnRead_(false), pInputBuffer_(new char[InputBufferSize]), queuedChars_(0) {\r
- ZeroMemory(&overlappedRead_, sizeof(OVERLAPPED));\r
- overlappedRead_.hEvent = overlappedReadEvent_;\r
-\r
- ZeroMemory(pInputBuffer_, InputBufferSize);\r
-}\r
-\r
-SerialPort::Listener::~Listener() {\r
- if(pInputBuffer_ != 0) {\r
- delete[] pInputBuffer_;\r
- pInputBuffer_ = 0;\r
- }\r
-}\r
-\r
-void SerialPort::Listener::Run(HANDLE eventStop) {\r
- OVERLAPPED overlappedStatus;\r
- ZeroMemory(&overlappedStatus, sizeof(OVERLAPPED));\r
-\r
- common::Event eventStatus(TRUE, FALSE);\r
- overlappedStatus.hEvent = eventStatus;\r
-\r
- SetCommMask(pPort_->hPort_, EV_BREAK | EV_CTS | EV_DSR | EV_ERR | EV_RING | EV_RLSD | EV_RXCHAR | EV_RXFLAG | EV_TXEMPTY);\r
-\r
- const int StopEvent = 0;\r
- const int StatusEvent = 1;\r
- const int ReadEvent = 2;\r
-\r
- HANDLE waitEvents[3] = { eventStop, eventStatus, overlappedReadEvent_ };\r
-\r
- DWORD resultEventMask = 0;\r
- bool bContinue = true, bWaitingOnStatusEvent = false;\r
- while(bContinue) {\r
- if(!bWaitingOnStatusEvent) {\r
- if(WaitCommEvent(pPort_->hPort_, &resultEventMask, &overlappedStatus)) {\r
- ProcessStatusEvent(resultEventMask);\r
- }\r
- else {\r
- //WaitCommEvent did not complete. Is it pending or did an error occur?\r
- DWORD errorCode = GetLastError();\r
- if(errorCode == ERROR_IO_PENDING) {\r
- bWaitingOnStatusEvent = true;\r
- }\r
- else {\r
- //error in WaitCommEvent\r
- LogCommError(TEXT("Error in WaitCommEvent. Error: "), errorCode);\r
- bContinue = false;\r
- }\r
- }\r
- }\r
-\r
- if(bWaitingOnStatusEvent) {\r
- HRESULT waitResult = WaitForMultipleObjects((bWaitingOnRead_ ? 3 : 2), waitEvents, FALSE, WaitTimeout);\r
- switch(waitResult) {\r
- case WAIT_TIMEOUT:\r
- {\r
- break;\r
- }\r
-\r
- case WAIT_FAILED:\r
- {\r
- CASPAR_LOG(error) << "WaitForMultipleObjects Failed.";\r
- bContinue = false;\r
- break;\r
- }\r
-\r
- default:\r
- {\r
- int alertObject = waitResult - WAIT_OBJECT_0;\r
-\r
- if(alertObject == StopEvent) {\r
- CASPAR_LOG(info) << "Got stopEvent. Stopping listener-thread.";\r
- bContinue = false;\r
- }\r
- else if(alertObject == StatusEvent) {\r
- DWORD numBytes = 0;\r
- if(GetOverlappedResult(pPort_->hPort_, &overlappedStatus, &numBytes, FALSE)) {\r
- ProcessStatusEvent(resultEventMask);\r
- }\r
- else {\r
- LogCommError(TEXT("GetOverlappedResult Failed (StatusEvent). Error: "), GetLastError());\r
- }\r
- bWaitingOnStatusEvent = false;\r
- }\r
- else if(alertObject == ReadEvent) {\r
- overlappedReadEvent_.Reset();\r
- DWORD numBytesRead = 0;\r
- if(GetOverlappedResult(pPort_->hPort_, &overlappedRead_, &numBytesRead, FALSE)) {\r
- bWaitingOnRead_ = false;\r
- CASPAR_LOG(info) << "Overlapped completion sucessful.";\r
- OnRead(numBytesRead);\r
- }\r
- else {\r
- LogCommError(TEXT("GetOverlappedResult Failed (ReadEvent). Error: "), GetLastError());\r
- }\r
- }\r
- else {\r
- //unexpected error\r
- LogCommError(TEXT("Unexpected wait-result. Result: "), waitResult);\r
- bContinue = false;\r
- }\r
- break;\r
- }\r
- }\r
- }\r
- }\r
-}\r
-\r
-bool SerialPort::Listener::OnUnhandledException(const std::exception& ex) throw() {\r
- bool bDoRestart = true;\r
-\r
- try \r
- {\r
- CASPAR_LOG(fatal) << "UNHANDLED EXCEPTION in serialport listener. Message: " << ex.what();\r
-\r
- //TODO: Cleanup and prepare for restart\r
- }\r
- catch(...)\r
- {\r
- bDoRestart = false;\r
- }\r
-\r
- return bDoRestart;\r
-}\r
-\r
-\r
-void SerialPort::Listener::ProcessStatusEvent(DWORD eventMask) {\r
- DWORD errors = 0;\r
- COMSTAT commStat;\r
- ZeroMemory(&commStat, sizeof(COMSTAT));\r
-\r
- ClearCommError(pPort_->hPort_, &errors, &commStat);\r
-\r
- if((eventMask & EV_RXCHAR) && (commStat.cbInQue > 0)) {\r
- queuedChars_ += static_cast<int>(commStat.cbInQue);\r
- if(!bWaitingOnRead_) {\r
- DoRead();\r
- }\r
- else {\r
- CASPAR_LOG(error) << "Could not read, already waiting on overlapped completion";\r
- }\r
- }\r
-}\r
-\r
-void SerialPort::Listener::DoRead() {\r
- bool bContinue;\r
- do {\r
- bContinue = false;\r
- DWORD numBytesRead = 0;\r
- int bytesToRead = std::min(InputBufferSize, queuedChars_);\r
- if(ReadFile(pPort_->hPort_, pInputBuffer_, bytesToRead, &numBytesRead, &overlappedRead_)) {\r
- bContinue = OnRead(numBytesRead);\r
- } else {\r
- DWORD errorCode = GetLastError();\r
- if(errorCode == ERROR_IO_PENDING) {\r
- CASPAR_LOG(error) << "Could not complete read. Mark as waiting for overlapped completion";\r
- bWaitingOnRead_ = true;\r
- }\r
- else\r
- LogCommError(TEXT("ReadFile Failed. Error: "), errorCode);\r
- }\r
- }\r
- while(bContinue);\r
-}\r
-\r
-bool ConvertMultiByteToWideChar(char* pSource, int sourceLength, std::vector<wchar_t>& wideBuffer)\r
-{\r
- //28591 = ISO 8859-1 Latin I\r
- int charsWritten = 0;\r
- int wideBufferCapacity = MultiByteToWideChar(28591, 0, pSource, sourceLength, NULL, NULL);\r
- if(wideBufferCapacity > 0) \r
- {\r
- wideBuffer.resize(wideBufferCapacity);\r
- charsWritten = MultiByteToWideChar(28591, 0, pSource, sourceLength, &wideBuffer[0], wideBuffer.size());\r
- }\r
-\r
- wideBuffer.resize(charsWritten);\r
- return (charsWritten > 0);\r
-}\r
-\r
-bool SerialPort::Listener::OnRead(int numBytesRead) {\r
- queuedChars_ -= numBytesRead;\r
- _ASSERT(queuedChars_ >= 0);\r
-\r
- //just to be safe\r
- queuedChars_ = std::max(queuedChars_, 0);\r
-\r
- if(pProtocolStrategy_ != 0) {\r
- //TODO: Convert from LATIN-1 codepage to wide chars\r
- if(ConvertMultiByteToWideChar(pInputBuffer_, numBytesRead, wideRecvBuffer_)) {\r
- pProtocolStrategy_->Parse(&wideRecvBuffer_[0], wideRecvBuffer_.size(), pPort_->pClientInfo_);\r
- }\r
- else {\r
- CASPAR_LOG(error) << "Read failed, could not convert command to UNICODE";\r
- }\r
- }\r
-\r
- ZeroMemory(pInputBuffer_, InputBufferSize);\r
-\r
- return (queuedChars_ > 0);\r
-}\r
-\r
-void SerialPort::Write(const std::wstring& str) {\r
- if(pWriter_ != 0)\r
- pWriter_->push_back(str);\r
-}\r
-\r
-void SerialPort::SerialPortClientInfo::Send(const std::wstring& data) {\r
- pSerialPort_->Write(data);\r
-}\r
-\r
-SerialPort::Writer::Writer(HANDLE port) : port_(port), newStringEvent_(FALSE, FALSE) {\r
-}\r
-\r
-void SerialPort::Writer::push_back(const std::wstring& str) {\r
- tbb::mutex::scoped_lock lock(mutex_);\r
-\r
- sendQueue_.push(str);\r
- newStringEvent_.Set();\r
-}\r
-\r
-bool ConvertWideCharToLatin1(const std::wstring& wideString, std::vector<char>& destBuffer)\r
-{\r
- //28591 = ISO 8859-1 Latin I\r
- int bytesWritten = 0;\r
- int multibyteBufferCapacity = WideCharToMultiByte(28591, 0, wideString.c_str(), static_cast<int>(wideString.length()), 0, 0, NULL, NULL);\r
- if(multibyteBufferCapacity > 0) \r
- {\r
- destBuffer.resize(multibyteBufferCapacity);\r
- bytesWritten = WideCharToMultiByte(28591, 0, wideString.c_str(), static_cast<int>(wideString.length()), &destBuffer[0], destBuffer.size(), NULL, NULL);\r
- }\r
- destBuffer.resize(bytesWritten);\r
- return (bytesWritten > 0);\r
-}\r
-\r
-void SerialPort::Writer::Run(HANDLE stopEvent) {\r
- OVERLAPPED overlappedWrite;\r
- ZeroMemory(&overlappedWrite, sizeof(OVERLAPPED));\r
- common::Event overlappedWriteEvent(TRUE, FALSE);\r
- overlappedWrite.hEvent = overlappedWriteEvent;\r
- bool writePending = false;\r
- int bytesToSend = 0;\r
-\r
- std::vector<char> currentlySending;\r
- std::wstring currentlySendingString;\r
- unsigned int currentlySendingOffset = 0;\r
-\r
- HANDLE waitHandles[3] = { stopEvent, newStringEvent_, overlappedWriteEvent };\r
-\r
- while(true) {\r
- HRESULT waitResult = WaitForMultipleObjects(3, waitHandles, FALSE, 2500);\r
- if(waitResult == WAIT_TIMEOUT)\r
- continue;\r
- else if(waitResult == WAIT_FAILED)\r
- break;\r
-\r
- HRESULT currentEvent = waitResult - WAIT_OBJECT_0;\r
- if(currentEvent == 0) { //stopEvent\r
- //TODO: Cancel ev. pending write?\r
- break;\r
- }\r
- else if(currentEvent == 1) { //newStringEvent_\r
- if(!writePending) {\r
- if(currentlySending.size() == 0)\r
- {\r
- tbb::mutex::scoped_lock lock(mutex_);\r
- //Read the next string in the queue and convert to ISO 8859-1 LATIN-1\r
- currentlySendingString = sendQueue_.front();\r
- sendQueue_.pop();\r
- if(!ConvertWideCharToLatin1(currentlySendingString, currentlySending))\r
- {\r
- CASPAR_LOG(error) << "Send failed, could not convert response to ISO 8859-1";\r
- }\r
- currentlySendingOffset = 0;\r
- }\r
-\r
- if(currentlySending.size() > 0) {\r
- bytesToSend = static_cast<int>(currentlySending.size()-currentlySendingOffset);\r
- DWORD bytesWritten = 0;\r
- if(!WriteFile(port_, ¤tlySending[0] + currentlySendingOffset, bytesToSend, &bytesWritten, &overlappedWrite)) {\r
- DWORD errorCode = GetLastError();\r
- if(errorCode == ERROR_IO_PENDING) {\r
- writePending = true;\r
- }\r
- else {\r
- //TODO: Log and handle critical error\r
- CASPAR_LOG(error) << "Failed to send, errorcode: " << errorCode;\r
-\r
- currentlySending.resize(0);\r
- currentlySendingOffset = 0;\r
- break;\r
- }\r
- }\r
- else { //WriteFile completed successfully\r
- if(bytesToSend == bytesWritten) {\r
- currentlySending.resize(0);\r
- currentlySendingOffset = 0;\r
-\r
- CASPAR_LOG(debug) << "Sent serialdata (imediately): " << currentlySendingString.c_str();\r
- }\r
- else {\r
- currentlySendingOffset += bytesWritten;\r
- newStringEvent_.Set();\r
- }\r
- }\r
- }\r
- }\r
- }\r
- else if(currentEvent == 2) { //overlappedWriteEvent\r
- overlappedWriteEvent.Reset();\r
- DWORD bytesWritten = 0;\r
- if(!GetOverlappedResult(port_, &overlappedWrite, &bytesWritten, FALSE)) {\r
- DWORD errorCode = GetLastError();\r
- CASPAR_LOG(error) << "Failed to send, errorcode: " << errorCode;\r
-\r
- currentlySending.resize(0);\r
- currentlySendingOffset = 0;\r
- break;\r
- }\r
- else {\r
- writePending = false;\r
- if(bytesToSend == bytesWritten) {\r
- currentlySending.resize(0);\r
- currentlySendingOffset = 0;\r
-\r
- CASPAR_LOG(debug) << "Sent serialdata (overlapped): " << currentlySendingString.c_str();\r
- {\r
- tbb::mutex::scoped_lock lock(mutex_);\r
- if(sendQueue_.size() > 0)\r
- newStringEvent_.Set();\r
- }\r
- }\r
- else {\r
- currentlySendingOffset += bytesWritten;\r
- newStringEvent_.Set();\r
- }\r
- }\r
- }\r
- }\r
-}\r
-\r
-bool SerialPort::Writer::OnUnhandledException(const std::exception& ex) throw() {\r
- bool bDoRestart = true;\r
-\r
- try \r
- {\r
- CASPAR_LOG(fatal) << "UNHANDLED EXCEPTION in serialport writer. Message: " << ex.what();\r
-\r
- //TODO: Cleanup and prepare for restart\r
- }\r
- catch(...)\r
- {\r
- bDoRestart = false;\r
- }\r
-\r
- return bDoRestart;\r
-}\r
-\r
-void LogCommError(const std::wstring& msg, int errorCode) {\r
- TCHAR strNumber[65];\r
- _itot_s(errorCode, strNumber, 10);\r
- std::wstring error = msg;\r
- error.append(strNumber);\r
- CASPAR_LOG(error) << error;\r
-}\r
-\r
-} //namespace IO\r
-} //namespace caspar
\ No newline at end of file
+++ /dev/null
-/*\r
-* copyright (c) 2010 Sveriges Television AB <info@casparcg.com>\r
-*\r
-* This file is part of CasparCG.\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
-*/\r
- \r
-#pragma once\r
-\r
-#include <string>\r
-#include <queue>\r
-#include "..\concurrency\thread.h"\r
-#include "ProtocolStrategy.h"\r
-\r
-#include <vector>\r
-#include <tbb\mutex.h>\r
-\r
-namespace caspar {\r
-namespace IO {\r
-\r
-class SerialPort\r
-{\r
- class SerialPortClientInfo;\r
- typedef std::tr1::shared_ptr<SerialPortClientInfo> SerialPortClientInfoPtr;\r
- friend class SerialPortClientInfo;\r
-\r
- class Listener;\r
- typedef std::tr1::shared_ptr<Listener> ListenerPtr;\r
- friend class Listener;\r
-\r
- class Writer;\r
- typedef std::tr1::shared_ptr<Writer> WriterPtr;\r
- friend class Writer;\r
-\r
- SerialPort(const SerialPort&);\r
- SerialPort& operator=(const SerialPort&);\r
-\r
-public:\r
- explicit SerialPort(const ProtocolStrategyPtr& pProtocol, DWORD baudRate, BYTE parity, BYTE dataBits, BYTE stopBits, const std::wstring& portName, bool spy = false);\r
- virtual ~SerialPort();\r
-\r
- bool Start();\r
- void Stop();\r
-\r
- void SetProtocolStrategy(ProtocolStrategyPtr pPS) {\r
- pProtocolStrategy_ = pPS;\r
- }\r
-\r
-private:\r
- void Setup();\r
- void Write(const std::wstring&);\r
-\r
- bool spy_;\r
- ProtocolStrategyPtr pProtocolStrategy_;\r
- std::wstring portName_;\r
- HANDLE hPort_;\r
- DCB commSettings_;\r
-\r
- common::Thread listenerThread_;\r
- ListenerPtr pListener_;\r
-\r
- common::Thread writerThread_;\r
- WriterPtr pWriter_;\r
-\r
- SerialPortClientInfoPtr pClientInfo_;\r
-\r
-// Listener\r
-/////////////\r
- class Listener : public common::IRunnable\r
- {\r
- friend SerialPort;\r
-\r
- Listener(const Listener&);\r
- Listener& operator=(const Listener&);\r
-\r
- public:\r
- explicit Listener(SerialPort* pSerialPort, ProtocolStrategyPtr pPS);\r
- virtual ~Listener();\r
-\r
- void Run(HANDLE stopEvent);\r
- bool OnUnhandledException(const std::exception& ex) throw();\r
-\r
- private:\r
- void ProcessStatusEvent(DWORD eventMask);\r
- void DoRead();\r
- bool OnRead(int numBytesRead);\r
-\r
- static const int WaitTimeout;\r
- static const int InputBufferSize;\r
-\r
- SerialPort* pPort_;\r
- ProtocolStrategyPtr pProtocolStrategy_;\r
-\r
- common::Event overlappedReadEvent_;\r
- OVERLAPPED overlappedRead_;\r
- bool bWaitingOnRead_;\r
-\r
- char* pInputBuffer_;\r
- int queuedChars_;\r
- std::vector<wchar_t> wideRecvBuffer_;\r
- };\r
-\r
-// Writer\r
-/////////////\r
- class Writer : public common::IRunnable\r
- {\r
- public:\r
- Writer(HANDLE port);\r
- virtual ~Writer() \r
- {}\r
-\r
- public:\r
- void push_back(const std::wstring&);\r
-\r
- void Run(HANDLE stopEvent);\r
- bool OnUnhandledException(const std::exception& ex) throw();\r
-\r
- private:\r
- common::Event newStringEvent_;\r
- std::queue<std::wstring> sendQueue_;\r
- HANDLE port_;\r
- tbb::mutex mutex_;\r
- };\r
-\r
-// ClientInfo\r
-///////////////\r
- class SerialPortClientInfo : public caspar::IO::ClientInfo\r
- {\r
- SerialPort* pSerialPort_;\r
- public:\r
- SerialPortClientInfo(SerialPort* pSP) : pSerialPort_(pSP) {\r
- }\r
- virtual ~SerialPortClientInfo() \r
- {}\r
-\r
- void Send(const std::wstring& data);\r
- void Disconnect() \r
- {}\r
- };\r
-};\r
-\r
-typedef std::tr1::shared_ptr<SerialPort> SerialPortPtr;\r
-\r
-} //namespace IO\r
-} //namespace caspar
\ No newline at end of file
+++ /dev/null
-#include "StdAfx.h"\r
-\r
-#include "configuration.h"\r
-#include "channel.h"\r
-\r
-#include "consumer/oal/oal_consumer.h"\r
-#ifndef DISABLE_BLUEFISH\r
-#include "consumer/bluefish/bluefish_consumer.h"\r
-#endif\r
-#include "consumer/decklink/decklink_consumer.h"\r
-#include "consumer/ogl/ogl_consumer.h"\r
-\r
-#include "protocol/amcp/AMCPProtocolStrategy.h"\r
-#include "protocol/cii/CIIProtocolStrategy.h"\r
-#include "protocol/CLK/CLKProtocolStrategy.h"\r
-#include "producer/flash/FlashAxContainer.h"\r
-\r
-#include "../common/exception/exceptions.h"\r
-#include "../common/io/AsyncEventServer.h"\r
-#include "../common/utility/string_convert.h"\r
-\r
-#include <boost/algorithm/string.hpp>\r
-#include <boost/lexical_cast.hpp>\r
-#include <boost/filesystem.hpp>\r
-#include <boost/foreach.hpp>\r
-#include <boost/property_tree/ptree.hpp>\r
-#include <boost/property_tree/xml_parser.hpp>\r
-\r
-#include "consumer/frame_consumer_device.h"\r
-#include "processor/frame_processor_device.h"\r
-\r
-namespace caspar { namespace core {\r
-\r
-struct configuration::implementation : boost::noncopyable\r
-{\r
- implementation() \r
- { \r
- boost::property_tree::ptree pt;\r
- boost::property_tree::read_xml(boost::filesystem::initial_path().file_string() + "\\caspar.config", pt);\r
-\r
- setup_paths();\r
- setup_channels(pt);\r
- setup_controllers(pt);\r
- \r
- if(!flash::FlashAxContainer::CheckForFlashSupport())\r
- CASPAR_LOG(error) << "No flashplayer activex-control installed. Flash support will be disabled";\r
- }\r
-\r
- ~implementation()\r
- { \r
- async_configurations_.clear();\r
- channels_.clear();\r
- }\r
-\r
- static void setup_paths()\r
- {\r
- if(!media_folder_.empty())\r
- return;\r
-\r
- std::string initialPath = boost::filesystem::initial_path().file_string();\r
- boost::property_tree::ptree pt;\r
- boost::property_tree::read_xml(initialPath + "\\caspar.config", pt);\r
-\r
- auto paths = pt.get_child("configuration.paths");\r
- media_folder_ = widen(paths.get("media-path", initialPath + "\\media\\"));\r
- log_folder_ = widen(paths.get("log-path", initialPath + "\\log\\"));\r
- template_folder_ = widen(paths.get("template-path", initialPath + "\\template\\"));\r
- data_folder_ = widen(paths.get("data-path", initialPath + "\\data\\"));\r
- }\r
- \r
- void setup_channels(boost::property_tree::ptree& pt)\r
- { \r
- using boost::property_tree::ptree;\r
- BOOST_FOREACH(auto& xml_channel, pt.get_child("configuration.channels"))\r
- { \r
- auto format_desc = video_format_desc::get(widen(xml_channel.second.get("videomode", "PAL"))); \r
- if(format_desc.format == video_format::invalid)\r
- BOOST_THROW_EXCEPTION(caspar_exception() << msg_info("Invalid videomode."));\r
- std::vector<safe_ptr<frame_consumer>> consumers;\r
-\r
- BOOST_FOREACH(auto& xml_consumer, xml_channel.second.get_child("consumers"))\r
- {\r
- try\r
- {\r
- std::string name = xml_consumer.first;\r
- if(name == "ogl")\r
- { \r
- int device = xml_consumer.second.get("device", 0);\r
- \r
- ogl::stretch stretch = ogl::stretch::fill;\r
- std::string stretchStr = xml_consumer.second.get("stretch", "");\r
- if(stretchStr == "none")\r
- stretch = ogl::stretch::none;\r
- else if(stretchStr == "uniform")\r
- stretch = ogl::stretch::uniform;\r
- else if(stretchStr == "uniformtofill")\r
- stretch = ogl::stretch::uniform_to_fill;\r
-\r
- bool windowed = xml_consumer.second.get("windowed", false);\r
- consumers.push_back(ogl::consumer(format_desc, device, stretch, windowed));\r
- }\r
- #ifndef DISABLE_BLUEFISH\r
- else if(name == "bluefish") \r
- consumers.push_back(bluefish::consumer(format_desc, xml_consumer.second.get("device", 0), xml_consumer.second.get("embedded-audio", false))); \r
- #endif\r
- else if(name == "decklink")\r
- consumers.push_back(make_safe<decklink::decklink_consumer>(format_desc, xml_consumer.second.get("device", 0), xml_consumer.second.get("internalkey", false)));\r
- else if(name == "audio")\r
- consumers.push_back(oal::consumer(format_desc)); \r
- }\r
- catch(...)\r
- {\r
- CASPAR_LOG_CURRENT_EXCEPTION();\r
- }\r
- }\r
- \r
- channels_.push_back(channel(format_desc, consumers));\r
- }\r
- }\r
- \r
- void setup_controllers(boost::property_tree::ptree& pt)\r
- { \r
- using boost::property_tree::ptree;\r
- BOOST_FOREACH(auto& xml_controller, pt.get_child("configuration.controllers"))\r
- {\r
- try\r
- {\r
- std::string name = xml_controller.first;\r
- std::string protocol = xml_controller.second.get<std::string>("protocol"); \r
-\r
- if(name == "tcpcontroller")\r
- { \r
- unsigned int port = xml_controller.second.get<unsigned int>("port");\r
- port = port != 0 ? port : 5250;\r
- auto asyncconfiguration = make_safe<IO::AsyncEventServer>(create_protocol(protocol), port);\r
- asyncconfiguration->Start();\r
- async_configurations_.push_back(asyncconfiguration);\r
- }\r
- else\r
- BOOST_THROW_EXCEPTION(invalid_configuration() << arg_name_info(name) << msg_info("Invalid controller"));\r
- }\r
- catch(...)\r
- {\r
- CASPAR_LOG_CURRENT_EXCEPTION();\r
- }\r
- }\r
- }\r
-\r
- safe_ptr<IO::IProtocolStrategy> create_protocol(const std::string& name) const\r
- {\r
- if(name == "AMCP")\r
- return make_safe<amcp::AMCPProtocolStrategy>(channels_);\r
- else if(name == "CII")\r
- return make_safe<cii::CIIProtocolStrategy>(channels_);\r
- else if(name == "CLOCK")\r
- return make_safe<CLK::CLKProtocolStrategy>(channels_);\r
- \r
- BOOST_THROW_EXCEPTION(invalid_configuration() << arg_name_info("name") << arg_value_info(name) << msg_info("Invalid protocol"));\r
- }\r
-\r
- std::vector<safe_ptr<IO::AsyncEventServer>> async_configurations_;\r
- \r
- std::vector<safe_ptr<channel>> channels_;\r
-\r
- int logLevel_;\r
-\r
- static std::wstring media_folder_;\r
- static std::wstring log_folder_;\r
- static std::wstring template_folder_;\r
- static std::wstring data_folder_;\r
-};\r
-\r
-std::wstring configuration::implementation::media_folder_ = L"";\r
-std::wstring configuration::implementation::log_folder_ = L"";\r
-std::wstring configuration::implementation::template_folder_ = L"";\r
-std::wstring configuration::implementation::data_folder_ = L"";\r
-\r
-configuration::configuration() : impl_(new implementation()){}\r
-\r
-const std::wstring& configuration::media_folder()\r
-{\r
- configuration::implementation::setup_paths();\r
- return configuration::implementation::media_folder_;\r
-}\r
-\r
-const std::wstring& configuration::log_folder()\r
-{\r
- configuration::implementation::setup_paths();\r
- return configuration::implementation::log_folder_;\r
-}\r
-\r
-const std::wstring& configuration::template_folder()\r
-{\r
- configuration::implementation::setup_paths();\r
- return configuration::implementation::template_folder_;\r
-}\r
-\r
-const std::wstring& configuration::data_folder()\r
-{\r
- configuration::implementation::setup_paths();\r
- return configuration::implementation::data_folder_;\r
-}\r
-\r
-const std::vector<safe_ptr<channel>> configuration::get_channels() const\r
-{\r
- return impl_->channels_;\r
-}\r
-}}
\ No newline at end of file
+++ /dev/null
-#pragma once\r
-\r
-#include "channel.h"\r
-\r
-#include <common/exception/exceptions.h>\r
-\r
-#include <boost/noncopyable.hpp>\r
-\r
-#include <vector>\r
-\r
-namespace caspar { namespace core { \r
- \r
-struct invalid_configuration : virtual boost::exception, virtual std::exception {};\r
-\r
-class configuration : boost::noncopyable\r
-{\r
-public:\r
- configuration();\r
-\r
- static const std::wstring& media_folder();\r
- static const std::wstring& log_folder();\r
- static const std::wstring& template_folder(); \r
- static const std::wstring& data_folder();\r
-\r
- const std::vector<safe_ptr<channel>> get_channels() const;\r
-\r
-private:\r
- struct implementation;\r
- std::shared_ptr<implementation> impl_;\r
-};\r
-\r
-}}
\ No newline at end of file
<ClInclude Include="producer\image\image_scroll_producer.h" />\r
<ClInclude Include="producer\layer.h" />\r
<ClInclude Include="producer\transition\transition_producer.h" />\r
- <ClInclude Include="protocol\amcp\AMCPCommand.h" />\r
- <ClInclude Include="protocol\amcp\AMCPCommandQueue.h" />\r
- <ClInclude Include="protocol\amcp\AMCPCommandsImpl.h" />\r
- <ClInclude Include="protocol\amcp\AMCPProtocolStrategy.h" />\r
- <ClInclude Include="protocol\cii\CIICommand.h" />\r
- <ClInclude Include="protocol\cii\CIICommandsImpl.h" />\r
- <ClInclude Include="protocol\cii\CIIProtocolStrategy.h" />\r
- <ClInclude Include="protocol\clk\CLKCommand.h" />\r
- <ClInclude Include="protocol\clk\CLKProtocolStrategy.h" />\r
- <ClInclude Include="protocol\media.h" />\r
- <ClInclude Include="configuration.h" />\r
- <ClInclude Include="version.h" />\r
<ClInclude Include="video_format.h" />\r
<CustomBuildStep Include="consumers\bluefish\BluefishException.h" />\r
<CustomBuildStep Include="consumers\bluefish\BluefishFrameManager.h" />\r
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">../../StdAfx.h</PrecompiledHeaderFile>\r
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">../../StdAfx.h</PrecompiledHeaderFile>\r
</ClCompile>\r
- <ClCompile Include="protocol\amcp\AMCPCommandQueue.cpp">\r
- <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\stdafx.h</PrecompiledHeaderFile>\r
- <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\stdafx.h</PrecompiledHeaderFile>\r
- </ClCompile>\r
- <ClCompile Include="protocol\amcp\AMCPCommandsImpl.cpp">\r
- <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\StdAfx.h</PrecompiledHeaderFile>\r
- <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\StdAfx.h</PrecompiledHeaderFile>\r
- </ClCompile>\r
- <ClCompile Include="protocol\amcp\AMCPProtocolStrategy.cpp">\r
- <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\StdAfx.h</PrecompiledHeaderFile>\r
- <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\StdAfx.h</PrecompiledHeaderFile>\r
- </ClCompile>\r
- <ClCompile Include="protocol\cii\CIICommandsImpl.cpp">\r
- <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\StdAfx.h</PrecompiledHeaderFile>\r
- <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\StdAfx.h</PrecompiledHeaderFile>\r
- </ClCompile>\r
- <ClCompile Include="protocol\cii\CIIProtocolStrategy.cpp">\r
- <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\StdAfx.h</PrecompiledHeaderFile>\r
- <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\StdAfx.h</PrecompiledHeaderFile>\r
- </ClCompile>\r
- <ClCompile Include="protocol\clk\CLKCommand.cpp">\r
- <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\StdAfx.h</PrecompiledHeaderFile>\r
- <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\StdAfx.h</PrecompiledHeaderFile>\r
- </ClCompile>\r
- <ClCompile Include="protocol\clk\CLKProtocolStrategy.cpp">\r
- <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\StdAfx.h</PrecompiledHeaderFile>\r
- <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\StdAfx.h</PrecompiledHeaderFile>\r
- </ClCompile>\r
- <ClCompile Include="protocol\media.cpp">\r
- <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">../StdAfx.h</PrecompiledHeaderFile>\r
- <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">../StdAfx.h</PrecompiledHeaderFile>\r
- </ClCompile>\r
- <ClCompile Include="configuration.cpp" />\r
<ClCompile Include="StdAfx.cpp">\r
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>\r
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>\r
<Filter Include="Source">\r
<UniqueIdentifier>{0361bd88-1d96-4d86-b3ad-34d40e2319c6}</UniqueIdentifier>\r
</Filter>\r
- <Filter Include="Source\protocol">\r
- <UniqueIdentifier>{57f477cb-9cff-4216-aab7-50b06df51f20}</UniqueIdentifier>\r
- </Filter>\r
- <Filter Include="Source\protocol\cii">\r
- <UniqueIdentifier>{a94bc00a-4753-4bce-a777-6a3ea2ceca59}</UniqueIdentifier>\r
- </Filter>\r
- <Filter Include="Source\protocol\amcp">\r
- <UniqueIdentifier>{d33e8ddc-ccb4-4f4f-ad20-e788a796bb7b}</UniqueIdentifier>\r
- </Filter>\r
- <Filter Include="Source\protocol\clk">\r
- <UniqueIdentifier>{8355a891-c4db-4a0e-8ecc-795314127cdc}</UniqueIdentifier>\r
- </Filter>\r
- <Filter Include="Source\protocol\osc">\r
- <UniqueIdentifier>{23166bfa-06eb-4da9-8a0d-1ae5eac4348b}</UniqueIdentifier>\r
- </Filter>\r
<Filter Include="My Amplifier Results">\r
<UniqueIdentifier>{bb801cd9-8dc8-4300-a5c7-a7f5ee0805fb}</UniqueIdentifier>\r
</Filter>\r
- <Filter Include="Source\channel">\r
- <UniqueIdentifier>{0eb1ae03-858d-4248-96d9-5c99e8c6e7a1}</UniqueIdentifier>\r
- </Filter>\r
- <Filter Include="Source\channel\processor">\r
- <UniqueIdentifier>{53e41831-70b4-4214-bc38-77e0d7aa288b}</UniqueIdentifier>\r
+ <Filter Include="Afx">\r
+ <UniqueIdentifier>{a15604fc-d914-48e1-8fd5-ae1edeba9c6c}</UniqueIdentifier>\r
</Filter>\r
- <Filter Include="Source\channel\consumer">\r
+ <Filter Include="Source\consumer">\r
<UniqueIdentifier>{35d7835f-f813-4b4b-8d8d-8a35dfef68d3}</UniqueIdentifier>\r
</Filter>\r
- <Filter Include="Source\channel\consumer\oal">\r
+ <Filter Include="Source\consumer\oal">\r
<UniqueIdentifier>{3dab53b0-e0ef-4431-8c1d-9a973b269ae7}</UniqueIdentifier>\r
</Filter>\r
- <Filter Include="Source\channel\consumer\ogl">\r
+ <Filter Include="Source\consumer\ogl">\r
<UniqueIdentifier>{7217dee5-b7ca-4128-9994-03a844c06903}</UniqueIdentifier>\r
</Filter>\r
- <Filter Include="Source\channel\consumer\bluefish">\r
+ <Filter Include="Source\consumer\bluefish">\r
<UniqueIdentifier>{89e746b3-5d4d-4ff2-a66e-279b5371ac9d}</UniqueIdentifier>\r
</Filter>\r
- <Filter Include="Source\channel\consumer\decklink">\r
+ <Filter Include="Source\consumer\decklink">\r
<UniqueIdentifier>{aa3626b2-ad7a-4e84-8867-0f5868a21567}</UniqueIdentifier>\r
</Filter>\r
- <Filter Include="Source\channel\consumer\decklink\interop">\r
+ <Filter Include="Source\consumer\decklink\interop">\r
<UniqueIdentifier>{a5cb89d7-dbbb-4fca-b899-f53a069727b4}</UniqueIdentifier>\r
</Filter>\r
- <Filter Include="Source\channel\producer">\r
+ <Filter Include="Source\processor">\r
+ <UniqueIdentifier>{53e41831-70b4-4214-bc38-77e0d7aa288b}</UniqueIdentifier>\r
+ </Filter>\r
+ <Filter Include="Source\processor\frame">\r
+ <UniqueIdentifier>{1b9effc5-16ee-4be7-9189-d2b6bec0165a}</UniqueIdentifier>\r
+ </Filter>\r
+ <Filter Include="Source\processor\image">\r
+ <UniqueIdentifier>{fe2c2f78-7daf-4b6d-9132-eda45b4c93e1}</UniqueIdentifier>\r
+ </Filter>\r
+ <Filter Include="Source\processor\audio">\r
+ <UniqueIdentifier>{e3d8bd98-8cb9-4f4a-8cf0-bd455ce9138d}</UniqueIdentifier>\r
+ </Filter>\r
+ <Filter Include="Source\processor\ogl">\r
+ <UniqueIdentifier>{219e5733-b365-4231-8c79-fd689c46c488}</UniqueIdentifier>\r
+ </Filter>\r
+ <Filter Include="Source\producer">\r
<UniqueIdentifier>{71accefc-1437-4e1d-9ff7-9de654a32df9}</UniqueIdentifier>\r
</Filter>\r
- <Filter Include="Source\channel\producer\ffmpeg">\r
+ <Filter Include="Source\producer\ffmpeg">\r
<UniqueIdentifier>{671d13be-c7e1-4f65-9909-03b7c8adcbde}</UniqueIdentifier>\r
</Filter>\r
- <Filter Include="Source\channel\producer\ffmpeg\video">\r
+ <Filter Include="Source\producer\ffmpeg\video">\r
<UniqueIdentifier>{a6d6bcc9-7ef1-47a3-9800-76e71f2b3f62}</UniqueIdentifier>\r
</Filter>\r
- <Filter Include="Source\channel\producer\ffmpeg\audio">\r
+ <Filter Include="Source\producer\ffmpeg\audio">\r
<UniqueIdentifier>{4031dc0c-88e9-46b5-b279-955639dca8b7}</UniqueIdentifier>\r
</Filter>\r
- <Filter Include="Source\channel\producer\color">\r
+ <Filter Include="Source\producer\ffmpeg\io">\r
+ <UniqueIdentifier>{eaa43a39-9ff0-4291-b717-4d4231d8295a}</UniqueIdentifier>\r
+ </Filter>\r
+ <Filter Include="Source\producer\color">\r
<UniqueIdentifier>{78b16c14-bf29-4511-9122-684ff513dbf5}</UniqueIdentifier>\r
</Filter>\r
- <Filter Include="Source\channel\producer\transition">\r
+ <Filter Include="Source\producer\transition">\r
<UniqueIdentifier>{26bf9811-1954-46f5-86ce-ecdc26e6db16}</UniqueIdentifier>\r
</Filter>\r
- <Filter Include="Source\channel\producer\flash">\r
+ <Filter Include="Source\producer\flash">\r
<UniqueIdentifier>{fc25232a-cab1-4c79-962a-b51dc51161fb}</UniqueIdentifier>\r
</Filter>\r
- <Filter Include="Source\channel\producer\flash\interop">\r
+ <Filter Include="Source\producer\flash\interop">\r
<UniqueIdentifier>{f99e4727-2b1b-4009-a445-99b11b071e8e}</UniqueIdentifier>\r
</Filter>\r
- <Filter Include="Source\channel\producer\image">\r
+ <Filter Include="Source\producer\image">\r
<UniqueIdentifier>{3d4314f3-8a39-44e3-a0c9-9b833bb8f809}</UniqueIdentifier>\r
</Filter>\r
- <Filter Include="Source\channel\processor\frame">\r
- <UniqueIdentifier>{1b9effc5-16ee-4be7-9189-d2b6bec0165a}</UniqueIdentifier>\r
- </Filter>\r
- <Filter Include="Source\channel\producer\ffmpeg\io">\r
- <UniqueIdentifier>{eaa43a39-9ff0-4291-b717-4d4231d8295a}</UniqueIdentifier>\r
- </Filter>\r
- <Filter Include="Source\channel\processor\image">\r
- <UniqueIdentifier>{fe2c2f78-7daf-4b6d-9132-eda45b4c93e1}</UniqueIdentifier>\r
- </Filter>\r
- <Filter Include="Source\channel\processor\audio">\r
- <UniqueIdentifier>{e3d8bd98-8cb9-4f4a-8cf0-bd455ce9138d}</UniqueIdentifier>\r
- </Filter>\r
- <Filter Include="Source\channel\processor\ogl">\r
- <UniqueIdentifier>{219e5733-b365-4231-8c79-fd689c46c488}</UniqueIdentifier>\r
- </Filter>\r
- <Filter Include="Afx">\r
- <UniqueIdentifier>{a15604fc-d914-48e1-8fd5-ae1edeba9c6c}</UniqueIdentifier>\r
- </Filter>\r
</ItemGroup>\r
<ItemGroup>\r
- <ClInclude Include="protocol\amcp\AMCPCommandQueue.h">\r
- <Filter>Source\protocol\amcp</Filter>\r
- </ClInclude>\r
- <ClInclude Include="protocol\amcp\AMCPCommandsImpl.h">\r
- <Filter>Source\protocol\amcp</Filter>\r
- </ClInclude>\r
- <ClInclude Include="protocol\amcp\AMCPProtocolStrategy.h">\r
- <Filter>Source\protocol\amcp</Filter>\r
- </ClInclude>\r
- <ClInclude Include="protocol\amcp\AMCPCommand.h">\r
- <Filter>Source\protocol\amcp</Filter>\r
- </ClInclude>\r
- <ClInclude Include="protocol\cii\CIICommandsImpl.h">\r
- <Filter>Source\protocol\cii</Filter>\r
- </ClInclude>\r
- <ClInclude Include="protocol\cii\CIIProtocolStrategy.h">\r
- <Filter>Source\protocol\cii</Filter>\r
- </ClInclude>\r
- <ClInclude Include="protocol\cii\CIICommand.h">\r
- <Filter>Source\protocol\cii</Filter>\r
- </ClInclude>\r
- <ClInclude Include="protocol\clk\CLKCommand.h">\r
- <Filter>Source\protocol\clk</Filter>\r
- </ClInclude>\r
- <ClInclude Include="protocol\clk\CLKProtocolStrategy.h">\r
- <Filter>Source\protocol\clk</Filter>\r
- </ClInclude>\r
<ClInclude Include="consumer\decklink\DeckLinkAPI_h.h">\r
- <Filter>Source\channel\consumer\decklink\interop</Filter>\r
+ <Filter>Source\consumer\decklink\interop</Filter>\r
</ClInclude>\r
<ClInclude Include="producer\color\color_producer.h">\r
- <Filter>Source\channel\producer\color</Filter>\r
+ <Filter>Source\producer\color</Filter>\r
</ClInclude>\r
<ClInclude Include="producer\ffmpeg\ffmpeg_producer.h">\r
- <Filter>Source\channel\producer\ffmpeg</Filter>\r
+ <Filter>Source\producer\ffmpeg</Filter>\r
</ClInclude>\r
<ClInclude Include="producer\image\image_loader.h">\r
- <Filter>Source\channel\producer\image</Filter>\r
+ <Filter>Source\producer\image</Filter>\r
</ClInclude>\r
<ClInclude Include="producer\image\image_producer.h">\r
- <Filter>Source\channel\producer\image</Filter>\r
+ <Filter>Source\producer\image</Filter>\r
</ClInclude>\r
<ClInclude Include="producer\image\image_scroll_producer.h">\r
- <Filter>Source\channel\producer\image</Filter>\r
+ <Filter>Source\producer\image</Filter>\r
</ClInclude>\r
<ClInclude Include="producer\transition\transition_producer.h">\r
- <Filter>Source\channel\producer\transition</Filter>\r
- </ClInclude>\r
- <ClInclude Include="protocol\media.h">\r
- <Filter>Source\protocol</Filter>\r
+ <Filter>Source\producer\transition</Filter>\r
</ClInclude>\r
<ClInclude Include="producer\frame_producer.h">\r
- <Filter>Source\channel\producer</Filter>\r
+ <Filter>Source\producer</Filter>\r
</ClInclude>\r
<ClInclude Include="producer\flash\cg_producer.h">\r
- <Filter>Source\channel\producer\flash</Filter>\r
+ <Filter>Source\producer\flash</Filter>\r
</ClInclude>\r
<ClInclude Include="producer\flash\flash_producer.h">\r
- <Filter>Source\channel\producer\flash</Filter>\r
+ <Filter>Source\producer\flash</Filter>\r
</ClInclude>\r
<ClInclude Include="producer\flash\FlashAxContainer.h">\r
- <Filter>Source\channel\producer\flash\interop</Filter>\r
+ <Filter>Source\producer\flash\interop</Filter>\r
</ClInclude>\r
<ClInclude Include="consumer\bluefish\util.h">\r
- <Filter>Source\channel\consumer\bluefish</Filter>\r
+ <Filter>Source\consumer\bluefish</Filter>\r
</ClInclude>\r
<ClInclude Include="consumer\bluefish\memory.h">\r
- <Filter>Source\channel\consumer\bluefish</Filter>\r
+ <Filter>Source\consumer\bluefish</Filter>\r
</ClInclude>\r
<ClInclude Include="consumer\ogl\ogl_consumer.h">\r
- <Filter>Source\channel\consumer\ogl</Filter>\r
+ <Filter>Source\consumer\ogl</Filter>\r
</ClInclude>\r
<ClInclude Include="consumer\oal\oal_consumer.h">\r
- <Filter>Source\channel\consumer\oal</Filter>\r
+ <Filter>Source\consumer\oal</Filter>\r
</ClInclude>\r
<ClInclude Include="consumer\bluefish\bluefish_consumer.h">\r
- <Filter>Source\channel\consumer\bluefish</Filter>\r
+ <Filter>Source\consumer\bluefish</Filter>\r
</ClInclude>\r
<ClInclude Include="consumer\frame_consumer.h">\r
- <Filter>Source\channel\consumer</Filter>\r
+ <Filter>Source\consumer</Filter>\r
</ClInclude>\r
<ClInclude Include="consumer\frame_consumer_device.h">\r
- <Filter>Source\channel\consumer</Filter>\r
+ <Filter>Source\consumer</Filter>\r
</ClInclude>\r
<ClInclude Include="processor\frame_processor_device.h">\r
- <Filter>Source\channel\processor</Filter>\r
- </ClInclude>\r
- <ClInclude Include="channel.h">\r
- <Filter>Source\channel</Filter>\r
+ <Filter>Source\processor</Filter>\r
</ClInclude>\r
<ClInclude Include="consumer\decklink\decklink_consumer.h">\r
- <Filter>Source\channel\consumer\decklink</Filter>\r
+ <Filter>Source\consumer\decklink</Filter>\r
</ClInclude>\r
<ClInclude Include="consumer\decklink\util.h">\r
- <Filter>Source\channel\consumer\decklink</Filter>\r
+ <Filter>Source\consumer\decklink</Filter>\r
</ClInclude>\r
<ClInclude Include="processor\fwd.h">\r
- <Filter>Source\channel\processor</Filter>\r
+ <Filter>Source\processor</Filter>\r
</ClInclude>\r
<ClInclude Include="processor\read_frame.h">\r
- <Filter>Source\channel\processor\frame</Filter>\r
+ <Filter>Source\processor\frame</Filter>\r
</ClInclude>\r
<ClInclude Include="processor\image_processor.h">\r
- <Filter>Source\channel\processor\image</Filter>\r
+ <Filter>Source\processor\image</Filter>\r
</ClInclude>\r
<ClInclude Include="processor\audio_processor.h">\r
- <Filter>Source\channel\processor\audio</Filter>\r
+ <Filter>Source\processor\audio</Filter>\r
</ClInclude>\r
<ClInclude Include="producer\ffmpeg\audio\audio_decoder.h">\r
- <Filter>Source\channel\producer\ffmpeg\audio</Filter>\r
+ <Filter>Source\producer\ffmpeg\audio</Filter>\r
</ClInclude>\r
<ClInclude Include="producer\ffmpeg\input.h">\r
- <Filter>Source\channel\producer\ffmpeg\io</Filter>\r
+ <Filter>Source\producer\ffmpeg\io</Filter>\r
</ClInclude>\r
<ClInclude Include="producer\ffmpeg\video\video_decoder.h">\r
- <Filter>Source\channel\producer\ffmpeg\video</Filter>\r
- </ClInclude>\r
- <ClInclude Include="producer\layer.h">\r
- <Filter>Source\channel</Filter>\r
+ <Filter>Source\producer\ffmpeg\video</Filter>\r
</ClInclude>\r
<ClInclude Include="processor\write_frame.h">\r
- <Filter>Source\channel\processor\frame</Filter>\r
+ <Filter>Source\processor\frame</Filter>\r
</ClInclude>\r
<ClInclude Include="processor\image_kernel.h">\r
- <Filter>Source\channel\processor\image</Filter>\r
+ <Filter>Source\processor\image</Filter>\r
</ClInclude>\r
<ClInclude Include="processor\ogl_device.h">\r
- <Filter>Source\channel\processor\ogl</Filter>\r
+ <Filter>Source\processor\ogl</Filter>\r
</ClInclude>\r
<ClInclude Include="processor\host_buffer.h">\r
- <Filter>Source\channel\processor\ogl</Filter>\r
+ <Filter>Source\processor\ogl</Filter>\r
</ClInclude>\r
<ClInclude Include="processor\device_buffer.h">\r
- <Filter>Source\channel\processor\ogl</Filter>\r
+ <Filter>Source\processor\ogl</Filter>\r
</ClInclude>\r
<ClInclude Include="StdAfx.h">\r
<Filter>Afx</Filter>\r
</ClInclude>\r
<ClInclude Include="processor\pixel_format.h">\r
- <Filter>Source\channel\processor</Filter>\r
+ <Filter>Source\processor</Filter>\r
</ClInclude>\r
<ClInclude Include="producer\flash\axflash.h">\r
- <Filter>Source\channel\producer\flash\interop</Filter>\r
+ <Filter>Source\producer\flash\interop</Filter>\r
</ClInclude>\r
<ClInclude Include="producer\flash\TimerHelper.h">\r
- <Filter>Source\channel\producer\flash\interop</Filter>\r
+ <Filter>Source\producer\flash\interop</Filter>\r
</ClInclude>\r
- <ClInclude Include="configuration.h">\r
- <Filter>Source</Filter>\r
+ <ClInclude Include="processor\draw_frame.h">\r
+ <Filter>Source\processor\frame</Filter>\r
</ClInclude>\r
- <ClInclude Include="version.h">\r
+ <ClInclude Include="video_format.h">\r
<Filter>Source</Filter>\r
</ClInclude>\r
- <ClInclude Include="processor\draw_frame.h">\r
- <Filter>Source\channel\processor\frame</Filter>\r
+ <ClInclude Include="producer\layer.h">\r
+ <Filter>Source</Filter>\r
</ClInclude>\r
- <ClInclude Include="video_format.h">\r
+ <ClInclude Include="channel.h">\r
<Filter>Source</Filter>\r
</ClInclude>\r
</ItemGroup>\r
<ItemGroup>\r
- <ClCompile Include="protocol\amcp\AMCPCommandQueue.cpp">\r
- <Filter>Source\protocol\amcp</Filter>\r
- </ClCompile>\r
- <ClCompile Include="protocol\amcp\AMCPCommandsImpl.cpp">\r
- <Filter>Source\protocol\amcp</Filter>\r
- </ClCompile>\r
- <ClCompile Include="protocol\amcp\AMCPProtocolStrategy.cpp">\r
- <Filter>Source\protocol\amcp</Filter>\r
- </ClCompile>\r
- <ClCompile Include="protocol\cii\CIICommandsImpl.cpp">\r
- <Filter>Source\protocol\cii</Filter>\r
- </ClCompile>\r
- <ClCompile Include="protocol\cii\CIIProtocolStrategy.cpp">\r
- <Filter>Source\protocol\cii</Filter>\r
- </ClCompile>\r
- <ClCompile Include="protocol\clk\CLKProtocolStrategy.cpp">\r
- <Filter>Source\protocol\clk</Filter>\r
- </ClCompile>\r
- <ClCompile Include="protocol\clk\CLKCommand.cpp">\r
- <Filter>Source\protocol\clk</Filter>\r
- </ClCompile>\r
<ClCompile Include="consumer\decklink\DeckLinkAPI_i.c">\r
- <Filter>Source\channel\consumer\decklink\interop</Filter>\r
+ <Filter>Source\consumer\decklink\interop</Filter>\r
</ClCompile>\r
<ClCompile Include="producer\color\color_producer.cpp">\r
- <Filter>Source\channel\producer\color</Filter>\r
+ <Filter>Source\producer\color</Filter>\r
</ClCompile>\r
<ClCompile Include="producer\ffmpeg\ffmpeg_producer.cpp">\r
- <Filter>Source\channel\producer\ffmpeg</Filter>\r
+ <Filter>Source\producer\ffmpeg</Filter>\r
</ClCompile>\r
<ClCompile Include="producer\image\image_loader.cpp">\r
- <Filter>Source\channel\producer\image</Filter>\r
+ <Filter>Source\producer\image</Filter>\r
</ClCompile>\r
<ClCompile Include="producer\image\image_producer.cpp">\r
- <Filter>Source\channel\producer\image</Filter>\r
+ <Filter>Source\producer\image</Filter>\r
</ClCompile>\r
<ClCompile Include="producer\image\image_scroll_producer.cpp">\r
- <Filter>Source\channel\producer\image</Filter>\r
+ <Filter>Source\producer\image</Filter>\r
</ClCompile>\r
<ClCompile Include="producer\transition\transition_producer.cpp">\r
- <Filter>Source\channel\producer\transition</Filter>\r
- </ClCompile>\r
- <ClCompile Include="protocol\media.cpp">\r
- <Filter>Source\protocol</Filter>\r
+ <Filter>Source\producer\transition</Filter>\r
</ClCompile>\r
<ClCompile Include="producer\flash\cg_producer.cpp">\r
- <Filter>Source\channel\producer\flash</Filter>\r
+ <Filter>Source\producer\flash</Filter>\r
</ClCompile>\r
<ClCompile Include="producer\flash\flash_producer.cpp">\r
- <Filter>Source\channel\producer\flash</Filter>\r
+ <Filter>Source\producer\flash</Filter>\r
</ClCompile>\r
<ClCompile Include="producer\flash\FlashAxContainer.cpp">\r
- <Filter>Source\channel\producer\flash\interop</Filter>\r
+ <Filter>Source\producer\flash\interop</Filter>\r
</ClCompile>\r
<ClCompile Include="consumer\ogl\ogl_consumer.cpp">\r
- <Filter>Source\channel\consumer\ogl</Filter>\r
+ <Filter>Source\consumer\ogl</Filter>\r
</ClCompile>\r
<ClCompile Include="consumer\oal\oal_consumer.cpp">\r
- <Filter>Source\channel\consumer\oal</Filter>\r
+ <Filter>Source\consumer\oal</Filter>\r
</ClCompile>\r
<ClCompile Include="consumer\bluefish\bluefish_consumer.cpp">\r
- <Filter>Source\channel\consumer\bluefish</Filter>\r
+ <Filter>Source\consumer\bluefish</Filter>\r
</ClCompile>\r
<ClCompile Include="consumer\frame_consumer_device.cpp">\r
- <Filter>Source\channel\consumer</Filter>\r
+ <Filter>Source\consumer</Filter>\r
</ClCompile>\r
<ClCompile Include="processor\frame_processor_device.cpp">\r
- <Filter>Source\channel\processor</Filter>\r
- </ClCompile>\r
- <ClCompile Include="channel.cpp">\r
- <Filter>Source\channel</Filter>\r
+ <Filter>Source\processor</Filter>\r
</ClCompile>\r
<ClCompile Include="consumer\decklink\decklink_consumer.cpp">\r
- <Filter>Source\channel\consumer\decklink</Filter>\r
+ <Filter>Source\consumer\decklink</Filter>\r
</ClCompile>\r
<ClCompile Include="processor\read_frame.cpp">\r
- <Filter>Source\channel\processor\frame</Filter>\r
+ <Filter>Source\processor\frame</Filter>\r
</ClCompile>\r
<ClCompile Include="processor\image_processor.cpp">\r
- <Filter>Source\channel\processor\image</Filter>\r
+ <Filter>Source\processor\image</Filter>\r
</ClCompile>\r
<ClCompile Include="processor\audio_processor.cpp">\r
- <Filter>Source\channel\processor\audio</Filter>\r
+ <Filter>Source\processor\audio</Filter>\r
</ClCompile>\r
<ClCompile Include="producer\ffmpeg\audio\audio_decoder.cpp">\r
- <Filter>Source\channel\producer\ffmpeg\audio</Filter>\r
+ <Filter>Source\producer\ffmpeg\audio</Filter>\r
</ClCompile>\r
<ClCompile Include="producer\ffmpeg\input.cpp">\r
- <Filter>Source\channel\producer\ffmpeg\io</Filter>\r
+ <Filter>Source\producer\ffmpeg\io</Filter>\r
</ClCompile>\r
<ClCompile Include="producer\ffmpeg\video\video_decoder.cpp">\r
- <Filter>Source\channel\producer\ffmpeg\video</Filter>\r
- </ClCompile>\r
- <ClCompile Include="producer\layer.cpp">\r
- <Filter>Source\channel</Filter>\r
+ <Filter>Source\producer\ffmpeg\video</Filter>\r
</ClCompile>\r
<ClCompile Include="processor\write_frame.cpp">\r
- <Filter>Source\channel\processor\frame</Filter>\r
+ <Filter>Source\processor\frame</Filter>\r
</ClCompile>\r
<ClCompile Include="processor\image_kernel.cpp">\r
- <Filter>Source\channel\processor\image</Filter>\r
+ <Filter>Source\processor\image</Filter>\r
</ClCompile>\r
<ClCompile Include="processor\ogl_device.cpp">\r
- <Filter>Source\channel\processor\ogl</Filter>\r
+ <Filter>Source\processor\ogl</Filter>\r
</ClCompile>\r
<ClCompile Include="processor\host_buffer.cpp">\r
- <Filter>Source\channel\processor\ogl</Filter>\r
+ <Filter>Source\processor\ogl</Filter>\r
</ClCompile>\r
<ClCompile Include="processor\device_buffer.cpp">\r
- <Filter>Source\channel\processor\ogl</Filter>\r
+ <Filter>Source\processor\ogl</Filter>\r
</ClCompile>\r
<ClCompile Include="StdAfx.cpp">\r
<Filter>Afx</Filter>\r
</ClCompile>\r
<ClCompile Include="producer\flash\Flash9e_i.c">\r
- <Filter>Source\channel\producer\flash\interop</Filter>\r
- </ClCompile>\r
- <ClCompile Include="configuration.cpp">\r
- <Filter>Source</Filter>\r
+ <Filter>Source\producer\flash\interop</Filter>\r
</ClCompile>\r
<ClCompile Include="processor\draw_frame.cpp">\r
- <Filter>Source\channel\processor\frame</Filter>\r
+ <Filter>Source\processor\frame</Filter>\r
</ClCompile>\r
<ClCompile Include="video_format.cpp">\r
<Filter>Source</Filter>\r
</ClCompile>\r
+ <ClCompile Include="channel.cpp">\r
+ <Filter>Source</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="producer\layer.cpp">\r
+ <Filter>Source</Filter>\r
+ </ClCompile>\r
</ItemGroup>\r
<ItemGroup>\r
<Midl Include="consumer\decklink\DeckLinkAPI_v7_3.idl">\r
- <Filter>Source\channel\consumer\decklink\interop</Filter>\r
+ <Filter>Source\consumer\decklink\interop</Filter>\r
</Midl>\r
<Midl Include="consumer\decklink\DeckLinkAPI.idl">\r
- <Filter>Source\channel\consumer\decklink\interop</Filter>\r
+ <Filter>Source\consumer\decklink\interop</Filter>\r
</Midl>\r
<Midl Include="consumer\decklink\DeckLinkAPI_v7_1.idl">\r
- <Filter>Source\channel\consumer\decklink\interop</Filter>\r
+ <Filter>Source\consumer\decklink\interop</Filter>\r
</Midl>\r
<Midl Include="producer\flash\Flash9e.IDL">\r
- <Filter>Source\channel\producer\flash\interop</Filter>\r
+ <Filter>Source\producer\flash\interop</Filter>\r
</Midl>\r
</ItemGroup>\r
<ItemGroup>\r
#include "../../StdAfx.h"\r
\r
+#include <common/env.h>\r
+\r
#include "cg_producer.h"\r
\r
#include "flash_producer.h"\r
\r
-#include "../../configuration.h"\r
-\r
#include <boost/filesystem.hpp>\r
#include <boost/format.hpp>\r
\r
{\r
public:\r
implementation() \r
- : flash_producer_(flash_producer(configuration::template_folder()+TEXT("cg.fth.18"))){}\r
+ : flash_producer_(flash_producer(env::template_folder()+TEXT("cg.fth.18"))){}\r
\r
void clear()\r
{\r
- flash_producer_ = flash_producer(configuration::template_folder()+TEXT("cg.fth.18"));\r
+ flash_producer_ = flash_producer(env::template_folder()+TEXT("cg.fth.18"));\r
}\r
\r
void add(int layer, const std::wstring& filename, bool play_on_load, const std::wstring& label, const std::wstring& data)\r
+++ /dev/null
-#include "../StdAfx.h"\r
-\r
-#include "media.h"\r
-\r
-#include "../producer/color/color_producer.h"\r
-#include "../producer/ffmpeg/ffmpeg_producer.h"\r
-#include "../producer/flash/cg_producer.h"\r
-#include "../producer/image/image_producer.h"\r
-//#include "../producer/image/image_scroll_producer.h"\r
-\r
-#include "../../common/exception/exceptions.h"\r
-\r
-#include <boost/assign.hpp>\r
-#include <boost/filesystem.hpp>\r
-\r
-using namespace boost::assign;\r
-\r
-namespace caspar { namespace core { \r
- \r
-safe_ptr<frame_producer> load_media(const std::vector<std::wstring>& params)\r
-{ \r
- typedef std::function<safe_ptr<frame_producer>(const std::vector<std::wstring>&)> producer_factory;\r
-\r
- const auto producer_factories = list_of<producer_factory>\r
- (&flash::create_ct_producer)\r
- (&image::create_image_producer)\r
- // (&image::create_image_scroll_producer)\r
- (&ffmpeg::create_ffmpeg_producer)\r
- (&create_color_producer);\r
-\r
- if(params.empty())\r
- BOOST_THROW_EXCEPTION(invalid_argument() << arg_name_info("params") << arg_value_info(""));\r
-\r
- safe_ptr<frame_producer> producer(frame_producer::empty());\r
- std::any_of(producer_factories.begin(), producer_factories.end(), [&](const producer_factory& factory) -> bool\r
- {\r
- try\r
- {\r
- producer = factory(params);\r
- }\r
- catch(...)\r
- {\r
- CASPAR_LOG_CURRENT_EXCEPTION();\r
- }\r
- return producer != frame_producer::empty();\r
- });\r
-\r
- return producer;\r
-}\r
-\r
-}}\r
+++ /dev/null
-#pragma once\r
-\r
-#include "../producer/frame_producer.h"\r
-\r
-#include <string>\r
-#include <vector>\r
-\r
-namespace caspar { namespace core { \r
- \r
-safe_ptr<frame_producer> load_media(const std::vector<std::wstring>& params);\r
-\r
-}}\r
+++ /dev/null
-/*\r
-* copyright (c) 2010 Sveriges Television AB <info@casparcg.com>\r
-*\r
-* This file is part of CasparCG.\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
-*/\r
- \r
-#include "..\..\stdAfx.h"\r
-\r
-#if defined(_MSC_VER)\r
-#pragma warning (push, 1) // marked as __forceinline not inlined\r
-#endif\r
-\r
-#include "Monitor.h"\r
-#include "..\..\..\common\io\AsyncEventServer.h"\r
-#include "..\..\..\common\concurrency\function_task.h"\r
-\r
-namespace caspar {\r
-\r
-using namespace std;\r
-\r
-const int Monitor::ResponseCodeNoParam = 102;\r
-const int Monitor::ResponseCodeWithParam = 101;\r
-\r
-Monitor::MonitorList Monitor::monitors_;\r
-\r
-Monitor::Monitor(int channelIndex) : channelIndex_(channelIndex) \r
-{\r
- monitors_.push_back(this);\r
-}\r
-\r
-Monitor::~Monitor() \r
-{\r
- monitors_.remove(this);\r
-}\r
-\r
-void Monitor::ClearListener(const caspar::IO::ClientInfoPtr& pClient)\r
-{\r
- std::for_each(monitors_.begin(), monitors_.end(), std::bind(&Monitor::RemoveListener, std::placeholders::_1, pClient));\r
-}\r
-\r
-void Monitor::Inform(MonitorEventType type, const std::wstring& parameter, MonitorParameterFormatter formatter) \r
-{\r
- common::function_task::enqueue(std::bind(&Monitor::internal_Inform, this, type, parameter, formatter));\r
-}\r
-\r
-void Monitor::internal_Inform(MonitorEventType type, const std::wstring parameter, MonitorParameterFormatter formatter)\r
-{\r
- //lock the list and make a local copy\r
- ListenerList localListeners;\r
- {\r
- tbb::mutex::scoped_lock lock(mutex_);\r
- localListeners = listeners_;\r
- }\r
-\r
- if(localListeners.empty())\r
- return;\r
-\r
- std::wstringstream msg;\r
- int code = ResponseCodeNoParam;\r
- if(!parameter.empty())\r
- code = ResponseCodeWithParam;\r
-\r
- msg << code << TEXT(' ');\r
-\r
- FormatInfo(msg, type);\r
-\r
- if(!parameter.empty()) \r
- {\r
- if(formatter)\r
- msg << formatter(parameter) << TEXT("\r\n");\r
- else\r
- msg << parameter << TEXT("\r\n");\r
- }\r
-\r
- std::wstring message(msg.str());\r
-\r
- std::for_each(localListeners.begin(), localListeners.end(), std::bind(&IO::ClientInfo::Send, std::placeholders::_1, message));\r
- CASPAR_LOG(debug) << "Monitor:" << msg;\r
-}\r
-\r
-void Monitor::FormatInfo(std::wstringstream& msg, MonitorEventType type) \r
-{\r
- switch(type) \r
- {\r
- case LOADBG:\r
- msg << TEXT("LOADBG");\r
- break;\r
- case LOAD:\r
- msg << TEXT("LOAD");\r
- break;\r
- case PLAY:\r
- msg << TEXT("PLAY");\r
- break;\r
- case STOPPED:\r
- msg << TEXT("STOP");\r
- break;\r
- case CLEAR:\r
- msg << TEXT("CLEAR");\r
- break;\r
-\r
- case CG_ADD:\r
- case CG_CLEAR:\r
- case CG_PLAY:\r
- case CG_STOP:\r
- case CG_NEXT:\r
- case CG_REMOVE:\r
- case CG_UPDATE:\r
- case CG_INVOKE:\r
- msg << TEXT("CG");\r
- break;\r
-\r
- default:\r
- break;\r
- }\r
-\r
- if(channelIndex_ > 0)\r
- msg << TEXT(' ') << channelIndex_;\r
-\r
- switch(type)\r
- {\r
- case CG_ADD:\r
- msg << TEXT(" ADD");\r
- break;\r
- case CG_CLEAR:\r
- msg << TEXT(" CLEAR");\r
- break;\r
- case CG_PLAY:\r
- msg << TEXT(" PLAY");\r
- break;\r
- case CG_STOP:\r
- msg << TEXT(" STOP");\r
- break;\r
- case CG_NEXT:\r
- msg << TEXT(" NEXT");\r
- break;\r
- case CG_REMOVE:\r
- msg << TEXT(" REMOVE");\r
- break;\r
- case CG_UPDATE:\r
- msg << TEXT(" UPDATE");\r
- break;\r
- case CG_INVOKE:\r
- msg << TEXT(" INVOKE");\r
- break;\r
- default:\r
- break;\r
- }\r
- msg << TEXT("\r\n");\r
-}\r
-\r
-void Monitor::AddListener(caspar::IO::ClientInfoPtr& pClient) \r
-{\r
- tbb::mutex::scoped_lock lock(mutex_);\r
- ListenerList::iterator it = std::find(listeners_.begin(), listeners_.end(), pClient);\r
- if(it == listeners_.end()) \r
- {\r
- CASPAR_LOG(debug) << "Added a client as listener";\r
- listeners_.push_back(pClient);\r
- }\r
-}\r
-\r
-void Monitor::RemoveListener(const caspar::IO::ClientInfoPtr& pClient) \r
-{\r
- tbb::mutex::scoped_lock lock(mutex_);\r
- listeners_.remove(pClient);\r
-}\r
-\r
-} //namespace caspar
\ No newline at end of file
+++ /dev/null
-/*\r
-* copyright (c) 2010 Sveriges Television AB <info@casparcg.com>\r
-*\r
-* This file is part of CasparCG.\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
-*/\r
-#pragma once\r
-\r
-#include "../../../common/io/ClientInfo.h"\r
-#include <tbb/mutex.h>\r
-\r
-namespace caspar {\r
-\r
-typedef std::function<std::wstring(const std::wstring&)> MonitorParameterFormatter;\r
-\r
-enum MonitorEventType\r
-{\r
- LOADBG,\r
- LOAD,\r
- PLAY,\r
- STOPPED,\r
- CLEAR,\r
-\r
- CG_ADD,\r
- CG_CLEAR,\r
- CG_PLAY,\r
- CG_STOP,\r
- CG_NEXT,\r
- CG_REMOVE,\r
- CG_UPDATE,\r
- CG_INVOKE\r
-};\r
-\r
-class Monitor : boost::noncopyable\r
-{\r
-public:\r
- static const int ResponseCodeNoParam;\r
- static const int ResponseCodeWithParam;\r
-\r
- //removes the client from all monitors\r
- static void ClearListener(const caspar::IO::ClientInfoPtr& pClient);\r
-\r
- explicit Monitor(int channelIndex);\r
- virtual ~Monitor();\r
-\r
- void Inform(MonitorEventType type, const std::wstring& parameter = TEXT(""), MonitorParameterFormatter formatter = 0);\r
-\r
- void AddListener(caspar::IO::ClientInfoPtr& pClient);\r
- void RemoveListener(const caspar::IO::ClientInfoPtr& pClient);\r
-\r
-private:\r
- void internal_Inform(MonitorEventType type, const std::wstring parameter, MonitorParameterFormatter formatter);\r
-\r
- void FormatInfo(std::wstringstream& sstream, MonitorEventType type);\r
-\r
- int channelIndex_;\r
- typedef std::list<caspar::IO::ClientInfoPtr> ListenerList;\r
- typedef std::list<Monitor*> MonitorList;\r
-\r
- ListenerList listeners_;\r
- static MonitorList monitors_;\r
- tbb::mutex mutex_;\r
-};\r
-\r
-}
\ No newline at end of file
+++ /dev/null
-#include "../StdAfx.h"\r
-\r
-#ifdef _MSC_VER\r
-#pragma warning (disable : 4244)\r
-#endif\r
-\r
-#include "display_device.h"\r
-\r
-#include "../frame/frame_format.h"\r
-#include "../frame/gpu_frame.h"\r
-\r
-#include <tbb/concurrent_queue.h>\r
-#include <tbb/atomic.h>\r
-\r
-#include <boost/foreach.hpp>\r
-#include <boost/thread.hpp>\r
-\r
-#include <boost/date_time/posix_time/posix_time.hpp>\r
-\r
-#include <boost/range/algorithm_ext/erase.hpp>\r
-\r
-namespace caspar { namespace core { namespace renderer {\r
-\r
-class video_sync_clock\r
-{\r
-public:\r
- video_sync_clock(const frame_format_desc& format_desc)\r
- {\r
- period_ = static_cast<long>(render_frame_format_period(format_desc)*1000000.0);\r
- time_ = boost::posix_time::microsec_clock::local_time();\r
- }\r
-\r
- void synchronize()\r
- {\r
- auto remaining = boost::posix_time::microseconds(period_) - \r
- (boost::posix_time::microsec_clock::local_time() - time_);\r
- if(remaining > boost::posix_time::microseconds(5000))\r
- boost::this_thread::sleep(remaining - boost::posix_time::microseconds(5000));\r
- time_ = boost::posix_time::microsec_clock::local_time();\r
- }\r
-private:\r
- boost::posix_time::ptime time_;\r
- long period_;\r
-};\r
-\r
-struct display_device::implementation\r
-{\r
-public:\r
- implementation(const frame_format_desc& format_desc, \r
- const std::vector<frame_consumer_ptr>& consumers) \r
- : consumers_(consumers), fmt_(format_desc)\r
- {\r
- if(consumers.empty())\r
- BOOST_THROW_EXCEPTION(invalid_argument() << arg_name_info("consumer") \r
- << msg_info("display_device requires atleast one consumer."));\r
-\r
- if(std::any_of(consumers.begin(), consumers.end(), \r
- [&](const frame_consumer_ptr& pConsumer)\r
- { return pConsumer->get_frame_format_desc() != format_desc;}))\r
- {\r
- BOOST_THROW_EXCEPTION(invalid_argument() << arg_name_info("consumer") \r
- << msg_info("All consumers must have same frameformat as display_device."));\r
- }\r
-\r
- needs_clock_ = !std::any_of(consumers.begin(), consumers.end(), \r
- std::mem_fn(&frame_consumer::has_sync_clock));\r
- frame_buffer_.set_capacity(3);\r
- is_running_ = true;\r
- display_thread_ = boost::thread([=]{run();});\r
- }\r
-\r
- ~implementation()\r
- {\r
- is_running_ = false;\r
- frame_buffer_.clear();\r
- display_thread_.join();\r
- }\r
-\r
- void display(const gpu_frame_ptr& frame)\r
- {\r
- if(is_running_)\r
- frame_buffer_.push(frame);\r
- }\r
- \r
- void run()\r
- {\r
- CASPAR_LOG(info) << L"Started display_device thread.";\r
- win32_exception::install_handler();\r
- \r
- video_sync_clock clock(fmt_);\r
- \r
- while(is_running_)\r
- {\r
- if(needs_clock_)\r
- clock.synchronize();\r
- \r
- gpu_frame_ptr frame;\r
- if(!frame_buffer_.try_pop(frame))\r
- {\r
- CASPAR_LOG(trace) << "Display Buffer Underrun.";\r
- frame_buffer_.pop(frame);\r
- }\r
- if(frame != nullptr) \r
- display_frame(frame); \r
- }\r
- \r
- CASPAR_LOG(info) << L"Ended display_device thread.";\r
- }\r
-\r
- void display_frame(const gpu_frame_ptr& frame)\r
- {\r
- BOOST_FOREACH(const frame_consumer_ptr& consumer, consumers_)\r
- {\r
- try\r
- {\r
- consumer->prepare(frame);\r
- prepared_frames_.push_back(frame);\r
-\r
- if(prepared_frames_.size() > 2)\r
- {\r
- consumer->display(prepared_frames_.front());\r
- prepared_frames_.pop_front();\r
- }\r
- }\r
- catch(...)\r
- {\r
- CASPAR_LOG_CURRENT_EXCEPTION();\r
- boost::range::remove_erase(consumers_, consumer);\r
- CASPAR_LOG(warning) << "Removed consumer from display_device.";\r
- if(consumers_.empty())\r
- {\r
- CASPAR_LOG(warning) << "No consumers available. Shutting down display_device.";\r
- is_running_ = false;\r
- }\r
- }\r
- }\r
- }\r
-\r
- std::deque<gpu_frame_ptr> prepared_frames_;\r
- \r
- boost::thread display_thread_;\r
-\r
- tbb::atomic<bool> is_running_;\r
- tbb::concurrent_bounded_queue<gpu_frame_ptr> frame_buffer_;\r
-\r
- bool needs_clock_;\r
- std::vector<frame_consumer_ptr> consumers_;\r
-\r
- frame_format_desc fmt_;\r
-};\r
-\r
-display_device::display_device(const frame_format_desc& format_desc, const std::vector<frame_consumer_ptr>& consumers) : impl_(new implementation(format_desc, consumers)){}\r
-void display_device::display(const gpu_frame_ptr& frame){impl_->display(frame);}\r
-}}}
\ No newline at end of file
+++ /dev/null
-#pragma once\r
-\r
-#include "../frame/frame_fwd.h"\r
-#include "../consumer/frame_consumer.h"\r
-\r
-#include <vector>\r
-\r
-namespace caspar { namespace core { namespace renderer {\r
-\r
-class display_device\r
-{\r
-public:\r
- display_device(const frame_format_desc& format_desc, const std::vector<frame_consumer_ptr>& consumers);\r
- void display(const gpu_frame_ptr& frame);\r
-private:\r
- struct implementation;\r
- std::shared_ptr<implementation> impl_;\r
-};\r
-typedef std::shared_ptr<display_device> display_device_ptr;\r
-\r
-}}}
\ No newline at end of file
+++ /dev/null
-#include "../stdafx.h"\r
-\r
-#include "layer.h"\r
-\r
-#include "../producer/frame_producer.h"\r
-\r
-#include "../frame/frame_format.h"\r
-\r
-namespace caspar { namespace core { namespace renderer {\r
-\r
-struct layer::implementation\r
-{ \r
- implementation() \r
- : preview_frame_(nullptr), active_(nullptr), \r
- background_(nullptr), last_frame_(nullptr) {}\r
- \r
- void load(const frame_producer_ptr& frame_producer, load_option option)\r
- {\r
- if(frame_producer == nullptr) \r
- BOOST_THROW_EXCEPTION(null_argument() << arg_name_info("frame_producer"));\r
- \r
- last_frame_ = nullptr;\r
- background_ = frame_producer;\r
- if(option == load_option::preview) \r
- {\r
- last_frame_ = frame_producer->render_frame();\r
- if(last_frame_ != nullptr)\r
- last_frame_->audio_data().clear(); // No audio\r
- active_ = nullptr; \r
- }\r
- else if(option == load_option::auto_play)\r
- play(); \r
- }\r
- \r
- void play()\r
- { \r
- if(background_ != nullptr)\r
- {\r
- background_->set_leading_producer(active_);\r
- active_ = background_;\r
- background_ = nullptr;\r
- }\r
-\r
- is_paused_ = false;\r
- }\r
-\r
- void pause()\r
- {\r
- is_paused_ = true;\r
- }\r
-\r
- void stop()\r
- {\r
- active_ = nullptr;\r
- last_frame_ = nullptr;\r
- }\r
-\r
- void clear()\r
- {\r
- active_ = nullptr;\r
- background_ = nullptr;\r
- last_frame_ = nullptr;\r
- }\r
- \r
- gpu_frame_ptr render_frame()\r
- { \r
- if(!active_ || is_paused_)\r
- return last_frame_;\r
-\r
- try\r
- {\r
- last_frame_ = active_->render_frame();\r
-\r
- if(last_frame_ == nullptr)\r
- {\r
- active_ = active_->get_following_producer();\r
- last_frame_ = render_frame();\r
- }\r
- }\r
- catch(...)\r
- {\r
- CASPAR_LOG_CURRENT_EXCEPTION();\r
- active_ = nullptr;\r
- CASPAR_LOG(warning) << "Removed producer from layer.";\r
- }\r
-\r
- return last_frame_;\r
- } \r
- \r
- tbb::atomic<bool> is_paused_;\r
- gpu_frame_ptr last_frame_;\r
- gpu_frame_ptr preview_frame_;\r
- frame_producer_ptr active_;\r
- frame_producer_ptr background_;\r
-};\r
-\r
-layer::layer() : impl_(new implementation()){}\r
-layer::layer(layer&& other) : impl_(std::move(other.impl_)){other.impl_ = nullptr;}\r
-layer& layer::operator=(layer&& other)\r
-{\r
- impl_ = std::move(other.impl_); \r
- other.impl_ = nullptr;\r
- return *this;\r
-}\r
-void layer::load(const frame_producer_ptr& frame_producer, load_option option){return impl_->load(frame_producer, option);} \r
-void layer::play(){impl_->play();}\r
-void layer::pause(){impl_->pause();}\r
-void layer::stop(){impl_->stop();}\r
-void layer::clear(){impl_->clear();}\r
-gpu_frame_ptr layer::render_frame() {return impl_->render_frame();}\r
-frame_producer_ptr layer::active() const { return impl_->active_;}\r
-frame_producer_ptr layer::background() const { return impl_->background_;}\r
-}}}
\ No newline at end of file
+++ /dev/null
-#pragma once\r
-\r
-#include "../producer/frame_producer.h"\r
-\r
-namespace caspar { namespace core { namespace renderer {\r
-\r
-enum load_option\r
-{\r
- none,\r
- preview,\r
- auto_play\r
-};\r
- \r
-class layer\r
-{\r
- layer(const layer& other);\r
- layer& operator=(const layer& other);\r
-public:\r
- layer();\r
- layer(layer&& other);\r
- layer& operator=(layer&& other);\r
-\r
- void load(const frame_producer_ptr& producer, load_option option = load_option::none); \r
- void play();\r
- void pause();\r
- void stop();\r
- void clear();\r
- \r
- frame_producer_ptr active() const;\r
- frame_producer_ptr background() const;\r
-\r
- gpu_frame_ptr render_frame();\r
-private:\r
- struct implementation;\r
- std::shared_ptr<implementation> impl_;\r
-};\r
-typedef std::shared_ptr<layer> layer_ptr;\r
-typedef std::unique_ptr<layer> layer_uptr;\r
-\r
-}}}
\ No newline at end of file
+++ /dev/null
-#include "..\StdAfx.h"\r
-\r
-#include "render_device.h"\r
-\r
-#include "display_device.h"\r
-#include "layer.h"\r
-\r
-#include "../frame/frame_format.h"\r
-#include "../frame/gpu_frame_device.h"\r
-\r
-#include "../../common/utility/scope_exit.h"\r
-#include "../../common/utility/memory.h"\r
-\r
-#include <boost/thread.hpp>\r
-#include <boost/range/algorithm_ext/erase.hpp>\r
-#include <boost/foreach.hpp>\r
-\r
-#include <tbb/parallel_for.h>\r
-#include <tbb/mutex.h>\r
- \r
-namespace caspar { namespace core { namespace renderer {\r
- \r
-std::vector<gpu_frame_ptr> render_frames(std::map<int, layer>& layers)\r
-{ \r
- std::vector<gpu_frame_ptr> frames(layers.size(), nullptr);\r
- tbb::parallel_for(tbb::blocked_range<size_t>(0, frames.size()), \r
- [&](const tbb::blocked_range<size_t>& r)\r
- {\r
- auto it = layers.begin();\r
- std::advance(it, r.begin());\r
- for(size_t i = r.begin(); i != r.end(); ++i, ++it)\r
- frames[i] = it->second.render_frame();\r
- }); \r
- return frames;\r
-}\r
-\r
-struct render_device::implementation : boost::noncopyable\r
-{ \r
- implementation(const frame_format_desc& format_desc, const std::vector<frame_consumer_ptr>& consumers) \r
- : display_device_(new display_device(format_desc, consumers)), fmt_(format_desc), frame_processor_(new gpu_frame_device(format_desc))\r
- { \r
- is_running_ = true;\r
- \r
- render_thread_ = boost::thread([=]{run();});\r
-\r
- CASPAR_LOG(info) << L"Initialized render_device with " << format_desc;\r
- }\r
- \r
- ~implementation()\r
- {\r
- is_running_ = false;\r
- display_device_.reset();\r
- render_thread_.join();\r
- }\r
- \r
- void run()\r
- { \r
- CASPAR_LOG(info) << L"Started render_device thread";\r
- win32_exception::install_handler();\r
- \r
- while(is_running_)\r
- {\r
- try\r
- { \r
- std::vector<gpu_frame_ptr> next_frames;\r
- {\r
- tbb::mutex::scoped_lock lock(layers_mutex_); \r
- next_frames = render_frames(layers_);\r
- }\r
- frame_processor_->push(next_frames);\r
- \r
- gpu_frame_ptr frame = frame_processor_->pop(); \r
- display_device_->display(frame);\r
- }\r
- catch(...)\r
- {\r
- CASPAR_LOG_CURRENT_EXCEPTION();\r
- layers_.clear();\r
- CASPAR_LOG(error) << "Unexpected exception. Cleared layers in render-device";\r
- }\r
- }\r
-\r
- CASPAR_LOG(info) << L"Ended render_device thread";\r
- }\r
-\r
- void load(int render_layer, const frame_producer_ptr& producer, load_option option)\r
- {\r
- if(producer->get_frame_format_desc() != fmt_)\r
- BOOST_THROW_EXCEPTION(invalid_argument() << arg_name_info("producer") << msg_info("Invalid frame format"));\r
-\r
- producer->initialize(frame_processor_);\r
- tbb::mutex::scoped_lock lock(layers_mutex_);\r
- layers_[render_layer].load(producer, option);\r
- }\r
- \r
- void pause(int render_layer)\r
- { \r
- tbb::mutex::scoped_lock lock(layers_mutex_);\r
- auto it = layers_.find(render_layer);\r
- if(it != layers_.end())\r
- it->second.pause(); \r
- }\r
-\r
- void play(int render_layer)\r
- { \r
- tbb::mutex::scoped_lock lock(layers_mutex_);\r
- auto it = layers_.find(render_layer);\r
- if(it != layers_.end())\r
- it->second.play(); \r
- }\r
-\r
- void stop(int render_layer)\r
- { \r
- tbb::mutex::scoped_lock lock(layers_mutex_);\r
- auto it = layers_.find(render_layer);\r
- if(it != layers_.end())\r
- it->second.stop();\r
- }\r
-\r
- void clear(int render_layer)\r
- {\r
- tbb::mutex::scoped_lock lock(layers_mutex_);\r
- auto it = layers_.find(render_layer);\r
- if(it != layers_.end())\r
- it->second.clear(); \r
- }\r
- \r
- void clear()\r
- {\r
- tbb::mutex::scoped_lock lock(layers_mutex_);\r
- layers_.clear();\r
- } \r
-\r
- frame_producer_ptr active(int render_layer) const\r
- {\r
- tbb::mutex::scoped_lock lock(layers_mutex_);\r
- auto it = layers_.find(render_layer);\r
- return it != layers_.end() ? it->second.active() : nullptr;\r
- }\r
- \r
- frame_producer_ptr background(int render_layer) const\r
- {\r
- tbb::mutex::scoped_lock lock(layers_mutex_);\r
- auto it = layers_.find(render_layer);\r
- return it != layers_.end() ? it->second.background() : nullptr;\r
- }\r
- \r
- display_device_ptr display_device_;\r
- boost::thread render_thread_;\r
- \r
- frame_format_desc fmt_;\r
- \r
- mutable tbb::mutex layers_mutex_;\r
- std::map<int, layer> layers_;\r
- \r
- tbb::atomic<bool> is_running_; \r
-\r
- gpu_frame_device_ptr frame_processor_;\r
-};\r
-\r
-render_device::render_device(const frame_format_desc& format_desc, const std::vector<frame_consumer_ptr>& consumers) \r
- : impl_(new implementation(format_desc, consumers)){}\r
-void render_device::load(int render_layer, const frame_producer_ptr& pProducer, load_option option){impl_->load(render_layer, pProducer, option);}\r
-void render_device::pause(int render_layer){impl_->pause(render_layer);}\r
-void render_device::play(int render_layer){impl_->play(render_layer);}\r
-void render_device::stop(int render_layer){impl_->stop(render_layer);}\r
-void render_device::clear(int render_layer){impl_->clear(render_layer);}\r
-void render_device::clear(){impl_->clear();}\r
-frame_producer_ptr render_device::active(int render_layer) const {return impl_->active(render_layer);}\r
-frame_producer_ptr render_device::background(int render_layer) const {return impl_->background(render_layer);}\r
-const frame_format_desc& render_device::get_frame_format_desc() const{return impl_->fmt_;}\r
-}}}\r
+++ /dev/null
-#pragma once\r
-\r
-#include "../producer/frame_producer.h"\r
-#include "../consumer/frame_consumer.h"\r
-#include "../frame/frame_format.h"\r
-\r
-#include "layer.h"\r
-\r
-namespace caspar { namespace core { namespace renderer {\r
- \r
-class render_device : boost::noncopyable\r
-{ \r
-public:\r
- render_device(const frame_format_desc& format_desc, const std::vector<frame_consumer_ptr>& consumers);\r
- \r
- void load(int render_layer, const frame_producer_ptr& producer, load_option option = load_option::none); \r
- void pause(int render_layer);\r
- void play(int render_layer);\r
- void stop(int render_layer);\r
- void clear(int render_layer);\r
- void clear();\r
-\r
- frame_producer_ptr active(int render_layer) const;\r
- frame_producer_ptr background(int render_layer) const;\r
-\r
- const frame_format_desc& get_frame_format_desc() const; \r
-private:\r
- struct implementation;\r
- std::shared_ptr<implementation> impl_;\r
-};\r
-typedef std::shared_ptr<render_device> render_device_ptr;\r
-typedef std::unique_ptr<render_device> render_device_uptr;\r
-\r
-}}}\r
+++ /dev/null
-#pragma once\r
-\r
-#include <memory>\r
-\r
-namespace caspar { namespace core {\r
-\r
-class Monitor;\r
-\r
-namespace renderer {\r
-\r
-class render_device;\r
-typedef std::shared_ptr<render_device> render_device_ptr;\r
-typedef std::unique_ptr<render_device> render_device_uptr;\r
-class layer;\r
-typedef std::shared_ptr<layer> layer_ptr;\r
-typedef std::unique_ptr<layer> layer_uptr;\r
-\r
-}}}\r
+++ /dev/null
-#pragma once\r
-\r
-#define CASPAR_VERSION_STR "2.0.0.0"\r
-#define CASPAR_VERSION_TAG "Experimental"
\ No newline at end of file
--- /dev/null
+/*\r
+* copyright (c) 2010 Sveriges Television AB <info@casparcg.com>\r
+*\r
+* This file is part of CasparCG.\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
+*/\r
+ \r
+#include "StdAfx.h"\r
+\r
+#include "video_format.h"\r
+\r
+#include <boost/algorithm/string.hpp>\r
+\r
+#include <array>\r
+\r
+#define DEFINE_VIDEOFORMATDESC(w, h, m, f, s, fmt) { (fmt), (w), (h), (m), (m == video_mode::progressive ? f : f/2.0), (1.0/(m == video_mode::progressive ? f : f/2.0)), ((w)*(h)*4), (s) }\r
+\r
+namespace caspar { namespace core {\r
+ \r
+const video_format_desc format_descs[video_format::invalid] = \r
+{ \r
+ DEFINE_VIDEOFORMATDESC(720, 576, video_mode::upper, 50, TEXT("PAL"), video_format::pal ), \r
+ //DEFINE_VIDEOFORMATDESC(720, 486, video_mode::lower, 60/1.001, TEXT("NTSC"), video_format::ntsc ), \r
+ //DEFINE_VIDEOFORMATDESC(720, 576, video_mode::progressive, 25, TEXT("576p2500"), video_format::x576p2500 ),\r
+ DEFINE_VIDEOFORMATDESC(1280, 720, video_mode::progressive, 25, TEXT("720p2500"), video_format::x720p2500 ), \r
+ DEFINE_VIDEOFORMATDESC(1280, 720, video_mode::progressive, 50, TEXT("720p5000"), video_format::x720p5000 ), \r
+ //DEFINE_VIDEOFORMATDESC(1280, 720, video_mode::progressive, 60/1.001, TEXT("720p5994"), video_format::x720p5994 ),\r
+ //DEFINE_VIDEOFORMATDESC(1280, 720, video_mode::progressive, 60, TEXT("720p6000"), video_format::x720p6000 ),\r
+ //DEFINE_VIDEOFORMATDESC(1920, 1080, video_mode::progressive, 24/1.001, TEXT("1080p2397"), video_format::x1080p2397),\r
+ //DEFINE_VIDEOFORMATDESC(1920, 1080, video_mode::progressive, 24, TEXT("1080p2400"), video_format::x1080p2400),\r
+ DEFINE_VIDEOFORMATDESC(1920, 1080, video_mode::upper, 50, TEXT("1080i5000"), video_format::x1080i5000),\r
+ //DEFINE_VIDEOFORMATDESC(1920, 1080, video_mode::upper, 60/1.001, TEXT("1080i5994"), video_format::x1080i5994),\r
+ //DEFINE_VIDEOFORMATDESC(1920, 1080, video_mode::upper, 60, TEXT("1080i6000"), video_format::x1080i6000),\r
+ DEFINE_VIDEOFORMATDESC(1920, 1080, video_mode::progressive, 25, TEXT("1080p2500"), video_format::x1080p2500),\r
+ //DEFINE_VIDEOFORMATDESC(1920, 1080, video_mode::progressive, 30/1.001, TEXT("1080p2997"), video_format::x1080p2997),\r
+ //DEFINE_VIDEOFORMATDESC(1920, 1080, video_mode::progressive, 30, TEXT("1080p3000"), video_format::x1080p3000),\r
+ DEFINE_VIDEOFORMATDESC(0, 0, video_mode::invalid, -1, TEXT("invalid"), video_format::invalid)\r
+};\r
+\r
+const video_format_desc& video_format_desc::get(video_format::type format) \r
+{\r
+ return format_descs[format];\r
+}\r
+\r
+const video_format_desc& video_format_desc::get(const std::wstring& name) \r
+{\r
+ for(int n = 0; n < video_format::invalid; ++n)\r
+ {\r
+ if(boost::iequals(format_descs[n].name, name))\r
+ return format_descs[n];\r
+ }\r
+ return format_descs[video_format::invalid];\r
+}\r
+\r
+}}\r
+\r
--- /dev/null
+#pragma once\r
+\r
+#include <string>\r
+\r
+#include <common/compiler/vs/disable_silly_warnings.h>\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
+ count,\r
+ invalid\r
+ };\r
+};\r
+\r
+struct video_mode \r
+{ \r
+ enum type\r
+ {\r
+ progressive,\r
+ lower,\r
+ upper,\r
+ count,\r
+ invalid\r
+ };\r
+};\r
+\r
+struct video_format_desc\r
+{\r
+ video_format::type format; // video output format\r
+\r
+ size_t width; // output frame width\r
+ size_t height; // output frame height\r
+ video_mode::type mode; // progressive, interlaced upper field first, interlaced lower field first\r
+ double fps; // actual framerate, e.g. i50 = 25 fps, p50 = 50 fps\r
+ double interval; // time between frames\r
+ size_t size; // output frame size in bytes \r
+ std::wstring name; // name of output format\r
+\r
+ static const video_format_desc& get(video_format::type format);\r
+ static const video_format_desc& get(const std::wstring& name);\r
+};\r
+\r
+inline bool operator==(const video_format_desc& rhs, const video_format_desc& lhs)\r
+{\r
+ return rhs.format == lhs.format;\r
+}\r
+\r
+inline bool operator!=(const video_format_desc& rhs, const video_format_desc& lhs)\r
+{\r
+ return !(rhs == lhs);\r
+}\r
+\r
+inline std::wostream& operator<<(std::wostream& out, const video_format_desc& format_desc)\r
+{\r
+ out << format_desc.name.c_str();\r
+ return out;\r
+}\r
+\r
+}}
\ No newline at end of file
--- /dev/null
+/*\r
+* copyright (c) 2010 Sveriges Television AB <info@casparcg.com>\r
+*\r
+* This file is part of CasparCG.\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
+*/\r
+ \r
+// stdafx.cpp : source file that includes just the standard includes\r
+// dma.pch will be the pre-compiled header\r
+// stdafx.obj will contain the pre-compiled type information\r
+\r
+#include "stdafx.h"\r
+\r
+// TODO: reference any additional headers you need in STDAFX.H\r
+// and not in this file\r
--- /dev/null
+/*\r
+* copyright (c) 2010 Sveriges Television AB <info@casparcg.com>\r
+*\r
+* This file is part of CasparCG.\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
+*/\r
+ \r
+// stdafx.h : include file for standard system include files,\r
+// or project specific include files that are used frequently, but\r
+// are changed infrequently\r
+//\r
+\r
+#pragma once\r
+\r
+#include "../common/compiler/vs/disable_silly_warnings.h"\r
+\r
+#define NOMINMAX\r
+\r
+#if defined(_MSC_VER)\r
+# ifndef _SCL_SECURE_NO_WARNINGS\r
+# define _SCL_SECURE_NO_WARNINGS\r
+# endif\r
+# ifndef _CRT_SECURE_NO_WARNINGS\r
+# define _CRT_SECURE_NO_WARNINGS\r
+# endif\r
+#endif\r
+\r
+#if !defined(AFX_STDAFX_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_)\r
+#define AFX_STDAFX_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_\r
+\r
+#ifdef _DEBUG\r
+#include <crtdbg.h>\r
+#endif\r
+\r
+#include <winsock2.h>\r
+#include <tchar.h>\r
+#include <sstream>\r
+#include <memory>\r
+#include <functional>\r
+#include <algorithm>\r
+#include <vector>\r
+#include <deque>\r
+#include <queue>\r
+#include <string>\r
+#include <math.h>\r
+\r
+#include <tbb/atomic.h>\r
+#include <tbb/concurrent_queue.h>\r
+#include <tbb/concurrent_unordered_map.h>\r
+#include <tbb/parallel_invoke.h>\r
+#include <tbb/parallel_for.h>\r
+#include <tbb/parallel_for_each.h>\r
+\r
+#include <boost/assign.hpp>\r
+#include <boost/filesystem.hpp>\r
+#include <boost/foreach.hpp>\r
+#include <boost/range/algorithm.hpp>\r
+\r
+#include "../common/utility/string_convert.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/exception/exceptions.h"\r
+#include "../common/exception/win32_exception.h"\r
+\r
+#include <assert.h>\r
+\r
+#endif\r
*/\r
#pragma once\r
\r
-#include "../../../common/io/clientinfo.h"\r
-#include "../../consumer/frame_consumer.h"\r
-#include "../../channel.h"\r
+#include "../util/clientinfo.h"\r
+\r
+#include <core/consumer/frame_consumer.h>\r
+#include <core/channel.h>\r
\r
#include <boost/algorithm/string.hpp>\r
\r
-namespace caspar { namespace core {\r
+namespace caspar { namespace protocol {\r
namespace amcp {\r
\r
enum AMCPCommandScheduling\r
void SetClientInfo(IO::ClientInfoPtr& s){pClientInfo_ = s;}\r
IO::ClientInfoPtr GetClientInfo(){return pClientInfo_;}\r
\r
- void SetChannel(const std::shared_ptr<channel>& pChannel){pChannel_ = pChannel;}\r
- std::shared_ptr<channel> GetChannel(){return pChannel_;}\r
+ void SetChannel(const std::shared_ptr<core::channel>& pChannel){pChannel_ = pChannel;}\r
+ std::shared_ptr<core::channel> GetChannel(){return pChannel_;}\r
\r
void SetChannelIndex(unsigned int channelIndex){channelIndex_ = channelIndex;}\r
unsigned int GetChannelIndex(){return channelIndex_;}\r
unsigned int channelIndex_;\r
int layerIndex_;\r
IO::ClientInfoPtr pClientInfo_;\r
- std::shared_ptr<channel> pChannel_;\r
+ std::shared_ptr<core::channel> pChannel_;\r
AMCPCommandScheduling scheduling_;\r
std::wstring replyString_;\r
};\r
*\r
*/\r
\r
-#include "..\..\stdafx.h"\r
+#include "..\stdafx.h"\r
\r
#include "AMCPCommandQueue.h"\r
\r
-namespace caspar { namespace core { namespace amcp {\r
+namespace caspar { namespace protocol { namespace amcp {\r
\r
AMCPCommandQueue::AMCPCommandQueue() : newCommandEvent_(FALSE, FALSE) \r
{}\r
*/\r
#pragma once\r
\r
-#include "../../../common/concurrency\thread.h"\r
+#include "../util/thread.h"\r
\r
#include "AMCPCommand.h"\r
\r
#include <tbb\mutex.h>\r
\r
-namespace caspar { namespace core { namespace amcp {\r
+namespace caspar { namespace protocol { namespace amcp {\r
\r
class AMCPCommandQueue : public IRunnable\r
{\r
*\r
*/\r
\r
-#include "../../StdAfx.h"\r
+#include "../StdAfx.h"\r
\r
#include "AMCPCommandsImpl.h"\r
#include "AMCPProtocolStrategy.h"\r
-#include "../../producer/frame_producer.h"\r
-#include "../../video_format.h"\r
-#include "../../producer/flash/flash_producer.h"\r
-#include "../../producer/transition/transition_producer.h"\r
-#include <boost/lexical_cast.hpp>\r
-#include "../../producer/flash/cg_producer.h"\r
#include "../media.h"\r
-#include "../../configuration.h"\r
-#include "../../version.h"\r
+\r
+#include <core/producer/frame_producer.h>\r
+#include <core/video_format.h>\r
+#include <core/producer/flash/flash_producer.h>\r
+#include <core/producer/transition/transition_producer.h>\r
+#include <core/producer/flash/cg_producer.h>\r
+\r
+#include <common/env.h>\r
\r
#include <algorithm>\r
#include <locale>\r
600 [kommando] FAILED funktion ej implementerad\r
*/\r
\r
-namespace caspar { namespace core {\r
+namespace caspar { namespace protocol {\r
+\r
+using namespace core;\r
\r
std::wstring ListMedia()\r
{ \r
std::wstringstream replyString;\r
- for (boost::filesystem::wrecursive_directory_iterator itr(configuration::media_folder()), end; itr != end; ++itr)\r
+ for (boost::filesystem::wrecursive_directory_iterator itr(env::media_folder()), end; itr != end; ++itr)\r
{ \r
if(boost::filesystem::is_regular_file(itr->path()))\r
{\r
{ \r
auto is_not_digit = [](char c){ return std::isdigit(c) == 0; };\r
\r
- auto relativePath = boost::filesystem::wpath(itr->path().file_string().substr(configuration::media_folder().size()-1, itr->path().file_string().size()));\r
+ auto relativePath = boost::filesystem::wpath(itr->path().file_string().substr(env::media_folder().size()-1, itr->path().file_string().size()));\r
\r
auto writeTimeStr = boost::posix_time::to_iso_string(boost::posix_time::from_time_t(boost::filesystem::last_write_time(itr->path())));\r
writeTimeStr.erase(std::remove_if(writeTimeStr.begin(), writeTimeStr.end(), is_not_digit), writeTimeStr.end());\r
{\r
std::wstringstream replyString;\r
\r
- for (boost::filesystem::wrecursive_directory_iterator itr(configuration::template_folder()), end; itr != end; ++itr)\r
+ for (boost::filesystem::wrecursive_directory_iterator itr(env::template_folder()), end; itr != end; ++itr)\r
{ \r
if(boost::filesystem::is_regular_file(itr->path()) && itr->path().extension() == L".ft")\r
{\r
- auto relativePath = boost::filesystem::wpath(itr->path().file_string().substr(configuration::template_folder().size()-1, itr->path().file_string().size()));\r
+ auto relativePath = boost::filesystem::wpath(itr->path().file_string().substr(env::template_folder().size()-1, itr->path().file_string().size()));\r
\r
auto writeTimeStr = boost::posix_time::to_iso_string(boost::posix_time::from_time_t(boost::filesystem::last_write_time(itr->path())));\r
writeTimeStr.erase(std::remove_if(writeTimeStr.begin(), writeTimeStr.end(), [](char c){ return std::isdigit(c) == 0;}), writeTimeStr.end());\r
//Perform loading of the clip\r
try\r
{\r
- _parameters[0] = configuration::media_folder() + L"\\" + _parameters[0];\r
+ _parameters[0] = env::media_folder() + L"\\" + _parameters[0];\r
auto pFP = load_media(_parameters); \r
GetChannel()->preview(GetLayerIndex(), pFP);\r
\r
//Perform loading of the clip\r
try\r
{\r
- _parameters[0] = configuration::media_folder() + L"\\" + _parameters[0];\r
+ _parameters[0] = env::media_folder() + L"\\" + _parameters[0];\r
auto pFP = load_media(_parameters);\r
if(pFP == frame_producer::empty())\r
BOOST_THROW_EXCEPTION(file_not_found() << msg_info(_parameters.size() > 0 ? narrow(_parameters[0]) : ""));\r
\r
- pFP = safe_ptr<frame_producer>(transition_producer(pFP, transitionInfo));\r
+ pFP = safe_ptr<core::frame_producer>(transition_producer(pFP, transitionInfo));\r
bool autoPlay = std::find(_parameters.begin(), _parameters.end(), TEXT("AUTOPLAY")) != _parameters.end();\r
GetChannel()->load(GetLayerIndex(), pFP, autoPlay); // TODO: LOOP\r
\r
else \r
{\r
//The data is not an XML-string, it must be a filename\r
- std::wstring filename = configuration::data_folder();\r
+ std::wstring filename = env::data_folder();\r
filename.append(dataString);\r
filename.append(TEXT(".ftd"));\r
\r
}\r
}\r
\r
- std::wstring fullFilename = flash::flash_producer::find_template(configuration::template_folder() + _parameters[2]);\r
+ std::wstring fullFilename = core::flash::flash_producer::find_template(env::template_folder() + _parameters[2]);\r
if(!fullFilename.empty())\r
{\r
std::wstring extension = boost::filesystem::wpath(fullFilename).extension();\r
std::wstring filename = _parameters[2];\r
filename.append(extension);\r
\r
- flash::get_default_cg_producer(safe_ptr<channel>(GetChannel()), GetLayerIndex(flash::cg_producer::DEFAULT_LAYER))->add(layer, filename, bDoStart, label, (pDataString!=0) ? pDataString : TEXT(""));\r
+ core::flash::get_default_cg_producer(safe_ptr<core::channel>(GetChannel()), GetLayerIndex(core::flash::cg_producer::DEFAULT_LAYER))->add(layer, filename, bDoStart, label, (pDataString!=0) ? pDataString : TEXT(""));\r
SetReplyString(TEXT("202 CG OK\r\n"));\r
}\r
else\r
return false;\r
}\r
int layer = _ttoi(_parameters[1].c_str());\r
- flash::get_default_cg_producer(safe_ptr<channel>(GetChannel()), GetLayerIndex(flash::cg_producer::DEFAULT_LAYER))->play(layer);\r
+ core::flash::get_default_cg_producer(safe_ptr<core::channel>(GetChannel()), GetLayerIndex(core::flash::cg_producer::DEFAULT_LAYER))->play(layer);\r
}\r
else\r
{\r
return false;\r
}\r
int layer = _ttoi(_parameters[1].c_str());\r
- flash::get_default_cg_producer(safe_ptr<channel>(GetChannel()), GetLayerIndex(flash::cg_producer::DEFAULT_LAYER))->stop(layer, 0);\r
+ core::flash::get_default_cg_producer(safe_ptr<core::channel>(GetChannel()), GetLayerIndex(core::flash::cg_producer::DEFAULT_LAYER))->stop(layer, 0);\r
}\r
else \r
{\r
return false;\r
}\r
int layer = _ttoi(_parameters[1].c_str());\r
- flash::get_default_cg_producer(safe_ptr<channel>(GetChannel()), GetLayerIndex(flash::cg_producer::DEFAULT_LAYER))->next(layer);\r
+ core::flash::get_default_cg_producer(safe_ptr<core::channel>(GetChannel()), GetLayerIndex(core::flash::cg_producer::DEFAULT_LAYER))->next(layer);\r
}\r
else \r
{\r
return false;\r
}\r
int layer = _ttoi(_parameters[1].c_str());\r
- flash::get_default_cg_producer(safe_ptr<channel>(GetChannel()), GetLayerIndex(flash::cg_producer::DEFAULT_LAYER))->remove(layer);\r
+ core::flash::get_default_cg_producer(safe_ptr<core::channel>(GetChannel()), GetLayerIndex(core::flash::cg_producer::DEFAULT_LAYER))->remove(layer);\r
}\r
else \r
{\r
\r
bool CGCommand::DoExecuteClear() \r
{\r
- flash::get_default_cg_producer(safe_ptr<channel>(GetChannel()), GetLayerIndex(flash::cg_producer::DEFAULT_LAYER))->clear();\r
+ core::flash::get_default_cg_producer(safe_ptr<core::channel>(GetChannel()), GetLayerIndex(core::flash::cg_producer::DEFAULT_LAYER))->clear();\r
SetReplyString(TEXT("202 CG OK\r\n"));\r
return true;\r
}\r
}\r
int layer = _ttoi(_parameters[1].c_str());\r
//TODO: Implement indirect data loading from file. Same as in Add\r
- flash::get_default_cg_producer(safe_ptr<channel>(GetChannel()), GetLayerIndex(flash::cg_producer::DEFAULT_LAYER))->update(layer, _parameters[2]);\r
+ core::flash::get_default_cg_producer(safe_ptr<core::channel>(GetChannel()), GetLayerIndex(core::flash::cg_producer::DEFAULT_LAYER))->update(layer, _parameters[2]);\r
}\r
else \r
{\r
return false;\r
}\r
int layer = _ttoi(_parameters[1].c_str());\r
- flash::get_default_cg_producer(safe_ptr<channel>(GetChannel()), GetLayerIndex(flash::cg_producer::DEFAULT_LAYER))->invoke(layer, _parameters[2]);\r
+ core::flash::get_default_cg_producer(safe_ptr<core::channel>(GetChannel()), GetLayerIndex(core::flash::cg_producer::DEFAULT_LAYER))->invoke(layer, _parameters[2]);\r
}\r
else \r
{\r
bool CGCommand::DoExecuteInfo() \r
{\r
// TODO\r
- //flash::get_default_cg_producer(GetChannel())->Info();\r
+ //core::flash::get_default_cg_producer(GetChannel())->Info();\r
SetReplyString(TEXT("600 CG FAILED\r\n"));\r
return true;\r
}\r
return false;\r
}\r
\r
- std::wstring filename = configuration::data_folder();\r
+ std::wstring filename = env::data_folder();\r
filename.append(_parameters[1]);\r
filename.append(TEXT(".ftd"));\r
\r
return false;\r
}\r
\r
- std::wstring filename = configuration::data_folder();\r
+ std::wstring filename = env::data_folder();\r
filename.append(_parameters[1]);\r
filename.append(TEXT(".ftd"));\r
\r
{\r
std::wstringstream replyString;\r
\r
- std::wstring filename = configuration::media_folder()+_parameters[0];\r
+ std::wstring filename = env::media_folder()+_parameters[0];\r
\r
// TODO:\r
\r
return false;\r
}\r
\r
-void GenerateChannelInfo(int index, const safe_ptr<channel>& pChannel, std::wstringstream& replyString)\r
+void GenerateChannelInfo(int index, const safe_ptr<core::channel>& pChannel, std::wstringstream& replyString)\r
{\r
replyString << index << TEXT(" ") << pChannel->get_video_format_desc().name << TEXT("\r\n") << (pChannel->foreground(0).get()->print());\r
}\r
bool VersionCommand::DoExecute()\r
{\r
std::wstringstream replyString;\r
- replyString << TEXT("201 VERSION OK\r\n") << TEXT(CASPAR_VERSION_STR) << TEXT("\r\n");\r
+ replyString << TEXT("201 VERSION OK\r\n") << env::version() << TEXT("\r\n");\r
\r
SetReplyString(replyString.str());\r
return true;\r
\r
#include "AMCPCommand.h"\r
\r
-namespace caspar { namespace core {\r
+namespace caspar { namespace protocol {\r
\r
std::wstring ListMedia();\r
std::wstring ListTemplates();\r
class InfoCommand : public AMCPCommandBase<false, AddToQueue, 0>\r
{\r
public:\r
- InfoCommand(const std::vector<safe_ptr<channel>>& channels) : channels_(channels){}\r
+ InfoCommand(const std::vector<safe_ptr<core::channel>>& channels) : channels_(channels){}\r
bool DoExecute();\r
private:\r
- const std::vector<safe_ptr<channel>>& channels_;\r
+ const std::vector<safe_ptr<core::channel>>& channels_;\r
};\r
\r
class VersionCommand : public AMCPCommandBase<false, AddToQueue, 0>\r
*\r
*/\r
\r
-#include "../../StdAfx.h"\r
+#include "../StdAfx.h"\r
\r
#include "AMCPProtocolStrategy.h"\r
\r
-#include "../../../common/io/AsyncEventServer.h"\r
+#include "../util/AsyncEventServer.h"\r
#include "AMCPCommandsImpl.h"\r
\r
#include <stdio.h>\r
#pragma warning (push, 1) // TODO: Legacy code, just disable warnings\r
#endif\r
\r
-namespace caspar { namespace core { namespace amcp {\r
+namespace caspar { namespace protocol { namespace amcp {\r
\r
using IO::ClientInfoPtr;\r
\r
const std::wstring AMCPProtocolStrategy::MessageDelimiter = TEXT("\r\n");\r
\r
-inline std::shared_ptr<channel> GetChannelSafe(unsigned int index, const std::vector<safe_ptr<channel>>& channels)\r
+inline std::shared_ptr<core::channel> GetChannelSafe(unsigned int index, const std::vector<safe_ptr<core::channel>>& channels)\r
{\r
- return index < channels.size() ? std::shared_ptr<channel>(channels[index]) : nullptr;\r
+ return index < channels.size() ? std::shared_ptr<core::channel>(channels[index]) : nullptr;\r
}\r
\r
-AMCPProtocolStrategy::AMCPProtocolStrategy(const std::vector<safe_ptr<channel>>& channels) : channels_(channels) {\r
+AMCPProtocolStrategy::AMCPProtocolStrategy(const std::vector<safe_ptr<core::channel>>& channels) : channels_(channels) {\r
AMCPCommandQueuePtr pGeneralCommandQueue(new AMCPCommandQueue());\r
if(!pGeneralCommandQueue->Start()) {\r
CASPAR_LOG(error) << "Failed to start the general command-queue";\r
commandQueues_.push_back(pGeneralCommandQueue);\r
\r
\r
- std::shared_ptr<channel> pChannel;\r
+ std::shared_ptr<core::channel> pChannel;\r
unsigned int index = -1;\r
//Create a commandpump for each channel\r
while((pChannel = GetChannelSafe(++index, channels_)) != 0) {\r
goto ParseFinnished;\r
}\r
\r
- std::shared_ptr<channel> pChannel = GetChannelSafe(channelIndex, channels_);\r
+ std::shared_ptr<core::channel> pChannel = GetChannelSafe(channelIndex, channels_);\r
if(pChannel == 0) {\r
goto ParseFinnished;\r
}\r
*/\r
#pragma once\r
\r
-#include "../../../common/io/protocolstrategy.h"\r
+#include "../util/protocolstrategy.h"\r
+#include <core/channel.h>\r
+\r
#include "AMCPCommand.h"\r
#include "AMCPCommandQueue.h"\r
-#include "../../channel.h"\r
\r
#include <boost/noncopyable.hpp>\r
\r
-namespace caspar { namespace core { namespace amcp {\r
+namespace caspar { namespace protocol { namespace amcp {\r
\r
class AMCPProtocolStrategy : public IO::IProtocolStrategy, boost::noncopyable\r
{\r
AMCPProtocolStrategy& operator=(const AMCPProtocolStrategy&);\r
\r
public:\r
- AMCPProtocolStrategy(const std::vector<safe_ptr<channel>>& channels);\r
+ AMCPProtocolStrategy(const std::vector<safe_ptr<core::channel>>& channels);\r
virtual ~AMCPProtocolStrategy();\r
\r
virtual void Parse(const TCHAR* pData, int charCount, IO::ClientInfoPtr pClientInfo);\r
\r
bool QueueCommand(AMCPCommandPtr);\r
\r
- std::vector<safe_ptr<channel>> channels_;\r
+ std::vector<safe_ptr<core::channel>> channels_;\r
std::vector<AMCPCommandQueuePtr> commandQueues_;\r
static const std::wstring MessageDelimiter;\r
};\r
\r
#pragma once\r
\r
-namespace caspar { namespace core {\r
+namespace caspar { namespace protocol {\r
namespace cii {\r
\r
class ICIICommand\r
*\r
*/\r
\r
-#include "../../StdAfx.h"\r
+#include "../StdAfx.h"\r
\r
#include "CIIProtocolStrategy.h"\r
#include "CIICommandsImpl.h"\r
#include <sstream>\r
#include <algorithm>\r
-#include "../../producer/flash/cg_producer.h"\r
+#include <core/producer/flash/cg_producer.h>\r
\r
-namespace caspar { namespace core { namespace cii {\r
+namespace caspar { namespace protocol { namespace cii {\r
\r
/////////////////\r
// MediaCommand\r
\r
//TODO: Need to be checked for validity\r
else if(state_ == 1)\r
- flash::get_default_cg_producer(pCIIStrategy_->GetChannel())->add(layer_, filename_, false, TEXT(""), xmlData_);\r
+ core::flash::get_default_cg_producer(pCIIStrategy_->GetChannel())->add(layer_, filename_, false, TEXT(""), xmlData_);\r
}\r
\r
\r
\r
//TODO: Need to be checked for validity\r
else if(state_ == 1)\r
- flash::get_default_cg_producer(pCIIStrategy_->GetChannel())->stop(layer_, 0);\r
+ core::flash::get_default_cg_producer(pCIIStrategy_->GetChannel())->stop(layer_, 0);\r
else if(state_ == 2)\r
- flash::get_default_cg_producer(pCIIStrategy_->GetChannel())->clear();\r
+ core::flash::get_default_cg_producer(pCIIStrategy_->GetChannel())->clear();\r
else if(state_ == 3)\r
- flash::get_default_cg_producer(pCIIStrategy_->GetChannel())->play(layer_);\r
+ core::flash::get_default_cg_producer(pCIIStrategy_->GetChannel())->play(layer_);\r
}\r
\r
void KeydataCommand::Setup(const std::vector<std::wstring>& parameters) {\r
\r
#include "ciicommand.h"\r
\r
-namespace caspar { namespace core {\r
+namespace caspar { namespace protocol {\r
\r
namespace cii {\r
\r
*\r
*/\r
\r
-#include "../../StdAfx.h"\r
+#include "../StdAfx.h"\r
\r
#include <string>\r
#include <sstream>\r
#include "../media.h"\r
#include "CIIProtocolStrategy.h"\r
#include "CIICommandsimpl.h"\r
-#include "../../producer/flash/flash_producer.h"\r
-#include "../../producer/transition/transition_producer.h"\r
-#include "../../configuration.h"\r
-#include "../../producer/frame_producer.h"\r
+#include <core/producer/flash/flash_producer.h>\r
+#include <core/producer/transition/transition_producer.h>\r
+#include <core/producer/frame_producer.h>\r
+#include <common/env.h>\r
\r
#if defined(_MSC_VER)\r
#pragma warning (push, 1) // TODO: Legacy code, just disable warnings\r
#endif\r
\r
-namespace caspar { namespace core { namespace cii {\r
+namespace caspar { namespace protocol { namespace cii {\r
\r
+using namespace core;\r
+\r
const std::wstring CIIProtocolStrategy::MessageDelimiter = TEXT("\r\n");\r
const TCHAR CIIProtocolStrategy::TokenDelimiter = TEXT('\\');\r
\r
-CIIProtocolStrategy::CIIProtocolStrategy(const std::vector<safe_ptr<channel>>& channels) : pChannel_(channels.at(0))\r
+CIIProtocolStrategy::CIIProtocolStrategy(const std::vector<safe_ptr<core::channel>>& channels) : pChannel_(channels.at(0))\r
{\r
executor_.start();\r
}\r
\r
void CIIProtocolStrategy::WriteTemplateData(const std::wstring& templateName, const std::wstring& titleName, const std::wstring& xmlData) \r
{\r
- std::wstring fullTemplateFilename = configuration::template_folder();\r
+ std::wstring fullTemplateFilename = env::template_folder();\r
if(currentProfile_.size() > 0)\r
{\r
fullTemplateFilename += currentProfile_;\r
fullTemplateFilename += TEXT("\\");\r
}\r
fullTemplateFilename += templateName;\r
- fullTemplateFilename = flash::flash_producer::find_template(fullTemplateFilename);\r
+ fullTemplateFilename = core::flash::flash_producer::find_template(fullTemplateFilename);\r
if(fullTemplateFilename.empty())\r
{\r
CASPAR_LOG(error) << "Failed to save instance of " << templateName << TEXT(" as ") << titleName << TEXT(", template ") << fullTemplateFilename << " not found";\r
return;\r
}\r
\r
- auto producer = flash::flash_producer(configuration::template_folder()+TEXT("CG.fth"));\r
+ auto producer = core::flash::flash_producer(env::template_folder()+TEXT("CG.fth"));\r
\r
std::wstringstream flashParam;\r
flashParam << TEXT("<invoke name=\"Add\" returntype=\"xml\"><arguments><number>1</number><string>") << currentProfile_ << '/' << templateName << TEXT("</string><number>0</number><true/><string> </string><string><![CDATA[ ") << xmlData << TEXT(" ]]></string></arguments></invoke>");\r
\r
CASPAR_LOG(info) << "Saved an instance of " << templateName << TEXT(" as ") << titleName ;\r
\r
- PutPreparedTemplate(titleName, safe_ptr<frame_producer>(std::move(producer)));\r
+ PutPreparedTemplate(titleName, safe_ptr<core::frame_producer>(std::move(producer)));\r
\r
}\r
\r
transition.duration = 12;\r
\r
auto pFP = load_media(boost::assign::list_of(filename));\r
- auto pTransition = safe_ptr<frame_producer>(transition_producer(pFP, transition));\r
+ auto pTransition = safe_ptr<core::frame_producer>(transition_producer(pFP, transition));\r
\r
try\r
{\r
CASPAR_LOG(info) << L"Displayed " << filename;\r
}\r
\r
-safe_ptr<frame_producer> CIIProtocolStrategy::GetPreparedTemplate(const std::wstring& titleName)\r
+safe_ptr<core::frame_producer> CIIProtocolStrategy::GetPreparedTemplate(const std::wstring& titleName)\r
{\r
- safe_ptr<frame_producer> result(frame_producer::empty());\r
+ safe_ptr<core::frame_producer> result(frame_producer::empty());\r
\r
TitleList::iterator it = std::find(titles_.begin(), titles_.end(), titleName);\r
if(it != titles_.end()) {\r
return result;\r
}\r
\r
-void CIIProtocolStrategy::PutPreparedTemplate(const std::wstring& titleName, safe_ptr<frame_producer>& pFP)\r
+void CIIProtocolStrategy::PutPreparedTemplate(const std::wstring& titleName, safe_ptr<core::frame_producer>& pFP)\r
{\r
CASPAR_LOG(debug) << L"Saved title with name " << titleName;\r
\r
\r
#pragma once\r
\r
-#include "../../channel.h"\r
+#include <core/channel.h>\r
\r
-#include <common/io/ProtocolStrategy.h>\r
+#include "../util/ProtocolStrategy.h"\r
#include "CIICommand.h"\r
\r
-#include "../../consumer/frame_consumer.h"\r
+#include <core/consumer/frame_consumer.h>\r
\r
#include <common/concurrency/executor.h>\r
\r
-namespace caspar { namespace core { namespace cii {\r
+namespace caspar { namespace protocol { namespace cii {\r
\r
class CIIProtocolStrategy : public IO::IProtocolStrategy\r
{\r
public:\r
- CIIProtocolStrategy(const std::vector<safe_ptr<channel>>& channels);\r
+ CIIProtocolStrategy(const std::vector<safe_ptr<core::channel>>& channels);\r
\r
void Parse(const TCHAR* pData, int charCount, IO::ClientInfoPtr pClientInfo);\r
UINT GetCodepage() {return 28591;} //ISO 8859-1\r
\r
void SetProfile(const std::wstring& profile) {currentProfile_ = profile;}\r
\r
- safe_ptr<channel> GetChannel() const{return this->pChannel_;}\r
+ safe_ptr<core::channel> GetChannel() const{return this->pChannel_;}\r
\r
void DisplayMediaFile(const std::wstring& filename);\r
void DisplayTemplate(const std::wstring& titleName);\r
public:\r
struct TitleHolder\r
{\r
- TitleHolder() : titleName(TEXT("")), pframe_producer(frame_producer::empty()) {}\r
- TitleHolder(const std::wstring& name, safe_ptr<frame_producer> pFP) : titleName(name), pframe_producer(pFP) {}\r
+ TitleHolder() : titleName(TEXT("")), pframe_producer(core::frame_producer::empty()) {}\r
+ TitleHolder(const std::wstring& name, safe_ptr<core::frame_producer> pFP) : titleName(name), pframe_producer(pFP) {}\r
TitleHolder(const TitleHolder& th) : titleName(th.titleName), pframe_producer(th.pframe_producer) {}\r
const TitleHolder& operator=(const TitleHolder& th) \r
{\r
}\r
\r
std::wstring titleName;\r
- safe_ptr<frame_producer> pframe_producer;\r
+ safe_ptr<core::frame_producer> pframe_producer;\r
friend CIIProtocolStrategy;\r
};\r
private:\r
\r
typedef std::list<TitleHolder> TitleList;\r
TitleList titles_;\r
- safe_ptr<frame_producer> GetPreparedTemplate(const std::wstring& name);\r
- void PutPreparedTemplate(const std::wstring& name, safe_ptr<frame_producer>& pframe_producer);\r
+ safe_ptr<core::frame_producer> GetPreparedTemplate(const std::wstring& name);\r
+ void PutPreparedTemplate(const std::wstring& name, safe_ptr<core::frame_producer>& pframe_producer);\r
\r
static const TCHAR TokenDelimiter;\r
static const std::wstring MessageDelimiter;\r
std::wstring currentMessage_;\r
\r
std::wstring currentProfile_;\r
- safe_ptr<channel> pChannel_;\r
+ safe_ptr<core::channel> pChannel_;\r
};\r
\r
}}}
\ No newline at end of file
*\r
*/\r
\r
-#include "..\..\stdafx.h"\r
+#include "..\stdafx.h"\r
#include <algorithm>\r
#include <locale>\r
#include "CLKCommand.h"\r
\r
-namespace caspar { namespace core { namespace CLK {\r
+namespace caspar { namespace protocol { namespace CLK {\r
\r
CLKCommand::CLKCommand() : clockID_(0), command_(CLKInvalidCommand) {}\r
\r
\r
#pragma once\r
\r
-namespace caspar { namespace core { namespace CLK {\r
+namespace caspar { namespace protocol { namespace CLK {\r
\r
class CLKCommand\r
{\r
*\r
*/\r
\r
-#include "..\..\StdAfx.h"\r
+#include "..\stdafx.h"\r
\r
#include "CLKProtocolStrategy.h"\r
\r
-#include "..\..\producer\flash\cg_producer.h"\r
+#include <core/producer\flash\cg_producer.h>\r
\r
#include <string>\r
#include <sstream>\r
#include <algorithm>\r
\r
-namespace caspar { namespace core { namespace CLK {\r
+namespace caspar { namespace protocol { namespace CLK {\r
\r
-CLKProtocolStrategy::CLKProtocolStrategy(const std::vector<safe_ptr<channel>>& channels) \r
+CLKProtocolStrategy::CLKProtocolStrategy(const std::vector<safe_ptr<core::channel>>& channels) \r
: currentState_(ExpectingNewCommand), bClockLoaded_(false), pChannel_(channels.at(0))\r
{}\r
\r
\r
if(currentCommand_.command_ == CLKCommand::CLKReset) \r
{\r
- flash::get_default_cg_producer(pChannel_)->clear();\r
+ core::flash::get_default_cg_producer(pChannel_)->clear();\r
bClockLoaded_ = false;\r
\r
CASPAR_LOG(info) << L"CLK: Recieved and executed reset-command";\r
{\r
if(!bClockLoaded_) \r
{\r
- flash::get_default_cg_producer(pChannel_)->add(0, TEXT("hawrysklocka/clock"), true, TEXT(""), currentCommand_.GetData());\r
+ core::flash::get_default_cg_producer(pChannel_)->add(0, TEXT("hawrysklocka/clock"), true, TEXT(""), currentCommand_.GetData());\r
bClockLoaded_ = true;\r
}\r
else \r
- flash::get_default_cg_producer(pChannel_)->update(0, currentCommand_.GetData());\r
+ core::flash::get_default_cg_producer(pChannel_)->update(0, currentCommand_.GetData());\r
\r
CASPAR_LOG(debug) << L"CLK: Clockdata sent: " << currentCommand_.GetData();\r
CASPAR_LOG(debug) << L"CLK: Executed valid command: " << currentCommandString_.str();\r
#pragma once\r
\r
#include "CLKCommand.h"\r
-#include "../../../common/io/ProtocolStrategy.h"\r
-#include "../../channel.h"\r
+#include "../util/ProtocolStrategy.h"\r
+#include <core/channel.h>\r
\r
-namespace caspar { namespace core { namespace CLK {\r
+namespace caspar { namespace protocol { namespace CLK {\r
\r
class CLKProtocolStrategy : public IO::IProtocolStrategy\r
{\r
public:\r
- CLKProtocolStrategy(const std::vector<safe_ptr<channel>>& channels);\r
+ CLKProtocolStrategy(const std::vector<safe_ptr<core::channel>>& channels);\r
\r
void Parse(const TCHAR* pData, int charCount, IO::ClientInfoPtr pClientInfo);\r
UINT GetCodepage() { return 28591; } //ISO 8859-1\r
CLKCommand currentCommand_;\r
std::wstringstream currentCommandString_;\r
\r
- safe_ptr<channel> pChannel_;\r
+ safe_ptr<core::channel> pChannel_;\r
\r
bool bClockLoaded_;\r
};\r
--- /dev/null
+#include "StdAfx.h"\r
+\r
+#include "media.h"\r
+\r
+#include <core/producer/color/color_producer.h>\r
+#include <core/producer/ffmpeg/ffmpeg_producer.h>\r
+#include <core/producer/flash/cg_producer.h>\r
+#include <core/producer/image/image_producer.h>\r
+//#include "../producer/image/image_scroll_producer.h"\r
+\r
+#include <common/exception/exceptions.h>\r
+\r
+#include <boost/assign.hpp>\r
+#include <boost/filesystem.hpp>\r
+\r
+using namespace boost::assign;\r
+\r
+namespace caspar { namespace protocol { \r
+ \r
+using namespace core;\r
+\r
+safe_ptr<core::frame_producer> load_media(const std::vector<std::wstring>& params)\r
+{ \r
+ typedef std::function<safe_ptr<core::frame_producer>(const std::vector<std::wstring>&)> producer_factory;\r
+\r
+ const auto producer_factories = list_of<producer_factory>\r
+ (&core::flash::create_ct_producer)\r
+ (&core::image::create_image_producer)\r
+ // (&image::create_image_scroll_producer)\r
+ (&core::ffmpeg::create_ffmpeg_producer)\r
+ (&core::create_color_producer);\r
+\r
+ if(params.empty())\r
+ BOOST_THROW_EXCEPTION(invalid_argument() << arg_name_info("params") << arg_value_info(""));\r
+\r
+ safe_ptr<core::frame_producer> producer(frame_producer::empty());\r
+ std::any_of(producer_factories.begin(), producer_factories.end(), [&](const producer_factory& factory) -> bool\r
+ {\r
+ try\r
+ {\r
+ producer = factory(params);\r
+ }\r
+ catch(...)\r
+ {\r
+ CASPAR_LOG_CURRENT_EXCEPTION();\r
+ }\r
+ return producer != frame_producer::empty();\r
+ });\r
+\r
+ return producer;\r
+}\r
+\r
+}}\r
--- /dev/null
+#pragma once\r
+\r
+#include <core/producer/frame_producer.h>\r
+\r
+#include <string>\r
+#include <vector>\r
+\r
+namespace caspar { namespace protocol { \r
+ \r
+safe_ptr<core::frame_producer> load_media(const std::vector<std::wstring>& params);\r
+\r
+}}\r
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+ <ItemGroup Label="ProjectConfigurations">\r
+ <ProjectConfiguration Include="Debug|Win32">\r
+ <Configuration>Debug</Configuration>\r
+ <Platform>Win32</Platform>\r
+ </ProjectConfiguration>\r
+ <ProjectConfiguration Include="Release|Win32">\r
+ <Configuration>Release</Configuration>\r
+ <Platform>Win32</Platform>\r
+ </ProjectConfiguration>\r
+ </ItemGroup>\r
+ <ItemGroup>\r
+ <ProjectReference Include="..\common\common.vcxproj">\r
+ <Project>{02308602-7fe0-4253-b96e-22134919f56a}</Project>\r
+ </ProjectReference>\r
+ <ProjectReference Include="..\core\core.vcxproj">\r
+ <Project>{79388c20-6499-4bf6-b8b9-d8c33d7d4ddd}</Project>\r
+ </ProjectReference>\r
+ </ItemGroup>\r
+ <ItemGroup>\r
+ <ClInclude Include="amcp\AMCPCommand.h" />\r
+ <ClInclude Include="amcp\AMCPCommandQueue.h" />\r
+ <ClInclude Include="amcp\AMCPCommandsImpl.h" />\r
+ <ClInclude Include="amcp\AMCPProtocolStrategy.h" />\r
+ <ClInclude Include="cii\CIICommand.h" />\r
+ <ClInclude Include="cii\CIICommandsImpl.h" />\r
+ <ClInclude Include="cii\CIIProtocolStrategy.h" />\r
+ <ClInclude Include="clk\CLKCommand.h" />\r
+ <ClInclude Include="clk\CLKProtocolStrategy.h" />\r
+ <ClInclude Include="media.h" />\r
+ <ClInclude Include="StdAfx.h" />\r
+ <ClInclude Include="util\AsyncEventServer.h" />\r
+ <ClInclude Include="util\ClientInfo.h" />\r
+ <ClInclude Include="util\ProtocolStrategy.h" />\r
+ <ClInclude Include="util\SocketInfo.h" />\r
+ <ClInclude Include="util\Thread.h" />\r
+ </ItemGroup>\r
+ <ItemGroup>\r
+ <ClCompile Include="amcp\AMCPCommandQueue.cpp">\r
+ <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">../StdAfx.h</PrecompiledHeaderFile>\r
+ <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">../StdAfx.h</PrecompiledHeaderFile>\r
+ </ClCompile>\r
+ <ClCompile Include="amcp\AMCPCommandsImpl.cpp">\r
+ <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">../StdAfx.h</PrecompiledHeaderFile>\r
+ <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">../StdAfx.h</PrecompiledHeaderFile>\r
+ </ClCompile>\r
+ <ClCompile Include="amcp\AMCPProtocolStrategy.cpp">\r
+ <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">../StdAfx.h</PrecompiledHeaderFile>\r
+ <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">../StdAfx.h</PrecompiledHeaderFile>\r
+ </ClCompile>\r
+ <ClCompile Include="cii\CIICommandsImpl.cpp">\r
+ <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">../StdAfx.h</PrecompiledHeaderFile>\r
+ <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">../StdAfx.h</PrecompiledHeaderFile>\r
+ </ClCompile>\r
+ <ClCompile Include="cii\CIIProtocolStrategy.cpp">\r
+ <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">../StdAfx.h</PrecompiledHeaderFile>\r
+ <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">../StdAfx.h</PrecompiledHeaderFile>\r
+ </ClCompile>\r
+ <ClCompile Include="clk\CLKCommand.cpp">\r
+ <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">../StdAfx.h</PrecompiledHeaderFile>\r
+ <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">../StdAfx.h</PrecompiledHeaderFile>\r
+ </ClCompile>\r
+ <ClCompile Include="clk\CLKProtocolStrategy.cpp">\r
+ <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">../StdAfx.h</PrecompiledHeaderFile>\r
+ <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">../StdAfx.h</PrecompiledHeaderFile>\r
+ </ClCompile>\r
+ <ClCompile Include="media.cpp" />\r
+ <ClCompile Include="StdAfx.cpp">\r
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>\r
+ </ClCompile>\r
+ <ClCompile Include="util\AsyncEventServer.cpp">\r
+ <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">../StdAfx.h</PrecompiledHeaderFile>\r
+ <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">../StdAfx.h</PrecompiledHeaderFile>\r
+ </ClCompile>\r
+ <ClCompile Include="util\SocketInfo.cpp">\r
+ <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">../StdAfx.h</PrecompiledHeaderFile>\r
+ <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">../StdAfx.h</PrecompiledHeaderFile>\r
+ </ClCompile>\r
+ <ClCompile Include="util\Thread.cpp">\r
+ <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">../StdAfx.h</PrecompiledHeaderFile>\r
+ <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">../StdAfx.h</PrecompiledHeaderFile>\r
+ </ClCompile>\r
+ </ItemGroup>\r
+ <PropertyGroup Label="Globals">\r
+ <ProjectGuid>{2040B361-1FB6-488E-84A5-38A580DA90DE}</ProjectGuid>\r
+ <Keyword>Win32Proj</Keyword>\r
+ <RootNamespace>protocol</RootNamespace>\r
+ </PropertyGroup>\r
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />\r
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">\r
+ <ConfigurationType>StaticLibrary</ConfigurationType>\r
+ <UseDebugLibraries>true</UseDebugLibraries>\r
+ <CharacterSet>Unicode</CharacterSet>\r
+ </PropertyGroup>\r
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">\r
+ <ConfigurationType>StaticLibrary</ConfigurationType>\r
+ <UseDebugLibraries>false</UseDebugLibraries>\r
+ <WholeProgramOptimization>true</WholeProgramOptimization>\r
+ <CharacterSet>Unicode</CharacterSet>\r
+ </PropertyGroup>\r
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
+ <ImportGroup Label="ExtensionSettings">\r
+ </ImportGroup>\r
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+ </ImportGroup>\r
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+ </ImportGroup>\r
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
+ <IncludePath>../common;../core;$(IncludePath)</IncludePath>\r
+ </PropertyGroup>\r
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
+ <IncludePath>../;../../../dependencies/tbb30_20100406oss/include;..\..\..\\dependencies\boost_1_44_0;$(IncludePath)</IncludePath>\r
+ </PropertyGroup>\r
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
+ <ClCompile>\r
+ <PrecompiledHeader>Use</PrecompiledHeader>\r
+ <WarningLevel>Level3</WarningLevel>\r
+ <Optimization>Disabled</Optimization>\r
+ <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+ </ClCompile>\r
+ <Link>\r
+ <SubSystem>Windows</SubSystem>\r
+ <GenerateDebugInformation>true</GenerateDebugInformation>\r
+ </Link>\r
+ </ItemDefinitionGroup>\r
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
+ <ClCompile>\r
+ <WarningLevel>Level3</WarningLevel>\r
+ <PrecompiledHeader>Use</PrecompiledHeader>\r
+ <Optimization>MaxSpeed</Optimization>\r
+ <FunctionLevelLinking>true</FunctionLevelLinking>\r
+ <IntrinsicFunctions>true</IntrinsicFunctions>\r
+ <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+ </ClCompile>\r
+ <Link>\r
+ <SubSystem>Windows</SubSystem>\r
+ <GenerateDebugInformation>true</GenerateDebugInformation>\r
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>\r
+ <OptimizeReferences>true</OptimizeReferences>\r
+ </Link>\r
+ </ItemDefinitionGroup>\r
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
+ <ImportGroup Label="ExtensionTargets">\r
+ </ImportGroup>\r
+</Project>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+ <ItemGroup>\r
+ <Filter Include="Source Files">\r
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>\r
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>\r
+ </Filter>\r
+ <Filter Include="Afx">\r
+ <UniqueIdentifier>{0289b005-5045-4798-b83e-72a4c7c1e412}</UniqueIdentifier>\r
+ </Filter>\r
+ <Filter Include="Source Files\amcp">\r
+ <UniqueIdentifier>{93331f26-581b-4d15-81a6-0aae31ad3958}</UniqueIdentifier>\r
+ </Filter>\r
+ <Filter Include="Source Files\cii">\r
+ <UniqueIdentifier>{abb11aa5-fa66-4e76-8ea6-38f01f6e7dff}</UniqueIdentifier>\r
+ </Filter>\r
+ <Filter Include="Source Files\clk">\r
+ <UniqueIdentifier>{9ed5b10f-d494-4460-b868-e36357b3e04d}</UniqueIdentifier>\r
+ </Filter>\r
+ <Filter Include="Source Files\util">\r
+ <UniqueIdentifier>{ac6eb3ad-c1d7-4bae-a03d-b1fd752a0305}</UniqueIdentifier>\r
+ </Filter>\r
+ </ItemGroup>\r
+ <ItemGroup>\r
+ <ClInclude Include="amcp\AMCPCommand.h">\r
+ <Filter>Source Files\amcp</Filter>\r
+ </ClInclude>\r
+ <ClInclude Include="amcp\AMCPCommandQueue.h">\r
+ <Filter>Source Files\amcp</Filter>\r
+ </ClInclude>\r
+ <ClInclude Include="amcp\AMCPCommandsImpl.h">\r
+ <Filter>Source Files\amcp</Filter>\r
+ </ClInclude>\r
+ <ClInclude Include="amcp\AMCPProtocolStrategy.h">\r
+ <Filter>Source Files\amcp</Filter>\r
+ </ClInclude>\r
+ <ClInclude Include="cii\CIICommand.h">\r
+ <Filter>Source Files\cii</Filter>\r
+ </ClInclude>\r
+ <ClInclude Include="cii\CIICommandsImpl.h">\r
+ <Filter>Source Files\cii</Filter>\r
+ </ClInclude>\r
+ <ClInclude Include="cii\CIIProtocolStrategy.h">\r
+ <Filter>Source Files\cii</Filter>\r
+ </ClInclude>\r
+ <ClInclude Include="clk\CLKCommand.h">\r
+ <Filter>Source Files\clk</Filter>\r
+ </ClInclude>\r
+ <ClInclude Include="clk\CLKProtocolStrategy.h">\r
+ <Filter>Source Files\clk</Filter>\r
+ </ClInclude>\r
+ <ClInclude Include="StdAfx.h">\r
+ <Filter>Afx</Filter>\r
+ </ClInclude>\r
+ <ClInclude Include="media.h">\r
+ <Filter>Source Files</Filter>\r
+ </ClInclude>\r
+ <ClInclude Include="util\AsyncEventServer.h">\r
+ <Filter>Source Files\util</Filter>\r
+ </ClInclude>\r
+ <ClInclude Include="util\ClientInfo.h">\r
+ <Filter>Source Files\util</Filter>\r
+ </ClInclude>\r
+ <ClInclude Include="util\ProtocolStrategy.h">\r
+ <Filter>Source Files\util</Filter>\r
+ </ClInclude>\r
+ <ClInclude Include="util\SocketInfo.h">\r
+ <Filter>Source Files\util</Filter>\r
+ </ClInclude>\r
+ <ClInclude Include="util\Thread.h">\r
+ <Filter>Source Files\util</Filter>\r
+ </ClInclude>\r
+ </ItemGroup>\r
+ <ItemGroup>\r
+ <ClCompile Include="amcp\AMCPCommandQueue.cpp">\r
+ <Filter>Source Files\amcp</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="amcp\AMCPCommandsImpl.cpp">\r
+ <Filter>Source Files\amcp</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="amcp\AMCPProtocolStrategy.cpp">\r
+ <Filter>Source Files\amcp</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="cii\CIICommandsImpl.cpp">\r
+ <Filter>Source Files\cii</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="cii\CIIProtocolStrategy.cpp">\r
+ <Filter>Source Files\cii</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="clk\CLKCommand.cpp">\r
+ <Filter>Source Files\clk</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="clk\CLKProtocolStrategy.cpp">\r
+ <Filter>Source Files\clk</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="StdAfx.cpp">\r
+ <Filter>Afx</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="media.cpp">\r
+ <Filter>Source Files</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="util\AsyncEventServer.cpp">\r
+ <Filter>Source Files\util</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="util\SocketInfo.cpp">\r
+ <Filter>Source Files\util</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="util\Thread.cpp">\r
+ <Filter>Source Files\util</Filter>\r
+ </ClCompile>\r
+ </ItemGroup>\r
+</Project>
\ No newline at end of file
#include "AsyncEventServer.h"\r
#include "SocketInfo.h"\r
\r
-#include "../log/log.h"\r
+#include <common/log/log.h>\r
\r
#include <string>\r
#include <algorithm>\r
#pragma once\r
#endif\r
\r
-#include "../memory/safe_ptr.h"\r
+#include <common/memory/safe_ptr.h>\r
\r
#include <string>\r
#include <map>\r
#include <vector>\r
#include <functional>\r
\r
-#include "..\concurrency\thread.h"\r
+#include "..\util\thread.h"\r
\r
#include "ProtocolStrategy.h"\r
#include "SocketInfo.h"\r
virtual void Parse(const wchar_t* pData, int charCount, ClientInfoPtr pClientInfo) = 0;\r
virtual unsigned int GetCodepage() = 0;\r
};\r
+typedef std::shared_ptr<IProtocolStrategy> ProtocolStrategyPtr;\r
\r
}} //namespace caspar
\ No newline at end of file
#include "../StdAfx.h"\r
\r
#include "thread.h"\r
-#include "../exception/win32_exception.h"\r
+#include <common/exception/win32_exception.h>\r
\r
namespace caspar {\r
\r
--- /dev/null
+#include "bootstrapper.h"\r
+\r
+#include <core/channel.h>\r
+\r
+#include <core/consumer/oal/oal_consumer.h>\r
+#ifndef DISABLE_BLUEFISH\r
+#include <core/consumer/bluefish/bluefish_consumer.h>\r
+#endif\r
+#include <core/consumer/decklink/decklink_consumer.h>\r
+#include <core/consumer/ogl/ogl_consumer.h>\r
+#include <core/producer/flash/FlashAxContainer.h>\r
+\r
+#include <protocol/amcp/AMCPProtocolStrategy.h>\r
+#include <protocol/cii/CIIProtocolStrategy.h>\r
+#include <protocol/CLK/CLKProtocolStrategy.h>\r
+#include <protocol/util/AsyncEventServer.h>\r
+\r
+#include <common/env.h>\r
+#include <common/exception/exceptions.h>\r
+#include <common/utility/string_convert.h>\r
+\r
+#include <boost/algorithm/string.hpp>\r
+#include <boost/lexical_cast.hpp>\r
+#include <boost/filesystem.hpp>\r
+#include <boost/foreach.hpp>\r
+#include <boost/property_tree/ptree.hpp>\r
+#include <boost/property_tree/xml_parser.hpp>\r
+\r
+namespace caspar {\r
+\r
+using namespace core;\r
+using namespace protocol;\r
+\r
+struct bootstrapper::implementation : boost::noncopyable\r
+{\r
+ std::vector<safe_ptr<IO::AsyncEventServer>> async_servers_; \r
+ std::vector<safe_ptr<channel>> channels_;\r
+\r
+ implementation() \r
+ { \r
+ setup_channels(env::properties());\r
+ setup_controllers(env::properties());\r
+ \r
+ if(!flash::FlashAxContainer::CheckForFlashSupport())\r
+ CASPAR_LOG(error) << "No flashplayer activex-control installed. Flash support will be disabled";\r
+ }\r
+\r
+ ~implementation()\r
+ { \r
+ async_servers_.clear();\r
+ channels_.clear();\r
+ }\r
+ \r
+ void setup_channels(const boost::property_tree::ptree& pt)\r
+ { \r
+ using boost::property_tree::ptree;\r
+ BOOST_FOREACH(auto& xml_channel, pt.get_child("configuration.channels"))\r
+ { \r
+ auto format_desc = video_format_desc::get(widen(xml_channel.second.get("videomode", "PAL"))); \r
+ if(format_desc.format == video_format::invalid)\r
+ BOOST_THROW_EXCEPTION(caspar_exception() << msg_info("Invalid videomode."));\r
+ std::vector<safe_ptr<frame_consumer>> consumers;\r
+\r
+ BOOST_FOREACH(auto& xml_consumer, xml_channel.second.get_child("consumers"))\r
+ {\r
+ try\r
+ {\r
+ std::string name = xml_consumer.first;\r
+ if(name == "ogl")\r
+ { \r
+ int device = xml_consumer.second.get("device", 0);\r
+ \r
+ ogl::stretch stretch = ogl::stretch::fill;\r
+ std::string stretchStr = xml_consumer.second.get("stretch", "");\r
+ if(stretchStr == "none")\r
+ stretch = ogl::stretch::none;\r
+ else if(stretchStr == "uniform")\r
+ stretch = ogl::stretch::uniform;\r
+ else if(stretchStr == "uniformtofill")\r
+ stretch = ogl::stretch::uniform_to_fill;\r
+\r
+ bool windowed = xml_consumer.second.get("windowed", false);\r
+ consumers.push_back(ogl::consumer(format_desc, device, stretch, windowed));\r
+ }\r
+ #ifndef DISABLE_BLUEFISH\r
+ else if(name == "bluefish") \r
+ consumers.push_back(bluefish::consumer(format_desc, xml_consumer.second.get("device", 0), xml_consumer.second.get("embedded-audio", false))); \r
+ #endif\r
+ else if(name == "decklink")\r
+ consumers.push_back(make_safe<decklink::decklink_consumer>(format_desc, xml_consumer.second.get("device", 0), xml_consumer.second.get("internalkey", false)));\r
+ else if(name == "audio")\r
+ consumers.push_back(oal::consumer(format_desc)); \r
+ }\r
+ catch(...)\r
+ {\r
+ CASPAR_LOG_CURRENT_EXCEPTION();\r
+ }\r
+ }\r
+ \r
+ channels_.push_back(channel(format_desc, consumers));\r
+ }\r
+ }\r
+ \r
+ void setup_controllers(const boost::property_tree::ptree& pt)\r
+ { \r
+ using boost::property_tree::ptree;\r
+ BOOST_FOREACH(auto& xml_controller, pt.get_child("configuration.controllers"))\r
+ {\r
+ try\r
+ {\r
+ std::string name = xml_controller.first;\r
+ std::string protocol = xml_controller.second.get<std::string>("protocol"); \r
+\r
+ if(name == "tcpcontroller")\r
+ { \r
+ unsigned int port = xml_controller.second.get<unsigned int>("port");\r
+ port = port != 0 ? port : 5250;\r
+ auto asyncbootstrapper = make_safe<IO::AsyncEventServer>(create_protocol(protocol), port);\r
+ asyncbootstrapper->Start();\r
+ async_servers_.push_back(asyncbootstrapper);\r
+ }\r
+ else\r
+ BOOST_THROW_EXCEPTION(invalid_bootstrapper() << arg_name_info(name) << msg_info("Invalid controller"));\r
+ }\r
+ catch(...)\r
+ {\r
+ CASPAR_LOG_CURRENT_EXCEPTION();\r
+ }\r
+ }\r
+ }\r
+\r
+ safe_ptr<IO::IProtocolStrategy> create_protocol(const std::string& name) const\r
+ {\r
+ if(name == "AMCP")\r
+ return make_safe<amcp::AMCPProtocolStrategy>(channels_);\r
+ else if(name == "CII")\r
+ return make_safe<cii::CIIProtocolStrategy>(channels_);\r
+ else if(name == "CLOCK")\r
+ return make_safe<CLK::CLKProtocolStrategy>(channels_);\r
+ \r
+ BOOST_THROW_EXCEPTION(invalid_bootstrapper() << arg_name_info("name") << arg_value_info(name) << msg_info("Invalid protocol"));\r
+ }\r
+};\r
+\r
+bootstrapper::bootstrapper() : impl_(new implementation()){}\r
+\r
+const std::vector<safe_ptr<channel>> bootstrapper::get_channels() const\r
+{\r
+ return impl_->channels_;\r
+}\r
+\r
+}
\ No newline at end of file
--- /dev/null
+#pragma once\r
+\r
+#include <core/channel.h>\r
+\r
+#include <common/exception/exceptions.h>\r
+\r
+#include <boost/noncopyable.hpp>\r
+\r
+#include <vector>\r
+\r
+namespace caspar {\r
+ \r
+struct invalid_bootstrapper : virtual boost::exception, virtual std::exception {};\r
+\r
+class bootstrapper : boost::noncopyable\r
+{\r
+public:\r
+ bootstrapper();\r
+\r
+ const std::vector<safe_ptr<core::channel>> get_channels() const;\r
+\r
+private:\r
+ struct implementation;\r
+ std::shared_ptr<implementation> impl_;\r
+};\r
+\r
+}
\ No newline at end of file
\r
#include <conio.h>\r
\r
-#include <core/version.h>\r
-#include <core/configuration.h>\r
-#include <core/protocol/amcp/AMCPProtocolStrategy.h>\r
+#include "bootstrapper.h"\r
+\r
#include <common/exception/win32_exception.h>\r
#include <common/exception/exceptions.h>\r
#include <common/log/log.h>\r
+#include <common/env.h>\r
+#include <protocol/amcp/AMCPProtocolStrategy.h>\r
\r
using namespace caspar;\r
using namespace caspar::core;\r
+using namespace caspar::protocol;\r
\r
class win32_handler_tbb_installer : public tbb::task_scheduler_observer\r
{\r
timeBeginPeriod(1);\r
\r
std::wstringstream str;\r
- str << "CasparCG " << CASPAR_VERSION_STR << " " << CASPAR_VERSION_TAG;\r
+ str << "CasparCG " << env::version() << " " << env::version_tag();\r
SetConsoleTitle(str.str().c_str());\r
\r
- CASPAR_LOG(info) << L"Starting CasparCG Video Playout Server Ver: " << CASPAR_VERSION_STR << " Tag: " << CASPAR_VERSION_TAG << std::endl;\r
+ CASPAR_LOG(info) << L"Starting CasparCG Video Playout Server Ver: " << env::version() << env::version_tag() << std::endl;\r
CASPAR_LOG(info) << L"Copyright (c) 2010 Sveriges Television AB <info@casparcg.com>\n\n" << std::endl;\r
\r
EnableMenuItem(GetSystemMenu(GetConsoleWindow(), FALSE), SC_CLOSE , MF_GRAYED);\r
MessageBox(nullptr, TEXT("Now is the time to connect for remote debugging..."), TEXT("Debug"), MB_OK | MB_TOPMOST);\r
#endif\r
\r
- log::add_file_sink(configuration::log_folder());\r
+ log::add_file_sink(env::log_folder());\r
\r
CASPAR_LOG(debug) << "Started Main Thread";\r
\r
\r
try \r
{\r
- configuration caspar_device;\r
+ bootstrapper caspar_device;\r
\r
auto dummy = std::make_shared<IO::DummyClientInfo>();\r
amcp::AMCPProtocolStrategy amcp(caspar_device.get_channels());\r
</ProjectConfiguration>\r
</ItemGroup>\r
<ItemGroup>\r
+ <ClCompile Include="boostrapper.cpp" />\r
<ClCompile Include="main.cpp">\r
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>\r
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>\r
<ProjectReference Include="..\core\core.vcxproj">\r
<Project>{79388c20-6499-4bf6-b8b9-d8c33d7d4ddd}</Project>\r
</ProjectReference>\r
+ <ProjectReference Include="..\protocol\protocol.vcxproj">\r
+ <Project>{2040b361-1fb6-488e-84a5-38a580da90de}</Project>\r
+ </ProjectReference>\r
</ItemGroup>\r
<ItemGroup>\r
<None Include="caspar.config">\r
<None Include="My Amplifier Results\r009hs\r009hs.ampl" />\r
<None Include="My Inspector Results\r000ti3\r000ti3.insp" />\r
</ItemGroup>\r
+ <ItemGroup>\r
+ <ClInclude Include="bootstrapper.h" />\r
+ </ItemGroup>\r
<PropertyGroup Label="Globals">\r
<ProjectGuid>{8C26C94F-8092-4769-8D84-DEA479721C5B}</ProjectGuid>\r
<Keyword>Win32Proj</Keyword>\r
<?xml version="1.0" encoding="utf-8"?>\r
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
<ItemGroup>\r
- <ClCompile Include="main.cpp" />\r
+ <ClCompile Include="main.cpp">\r
+ <Filter>Source</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="boostrapper.cpp">\r
+ <Filter>Source</Filter>\r
+ </ClCompile>\r
</ItemGroup>\r
<ItemGroup>\r
<None Include="caspar.config" />\r
<Filter Include="My Inspector Results">\r
<UniqueIdentifier>{54aa3e52-b5b4-4451-84e3-3b5d5ddcee0e}</UniqueIdentifier>\r
</Filter>\r
+ <Filter Include="Source">\r
+ <UniqueIdentifier>{069a6bcd-e304-44a5-9f32-eac8e2f304af}</UniqueIdentifier>\r
+ </Filter>\r
+ </ItemGroup>\r
+ <ItemGroup>\r
+ <ClInclude Include="bootstrapper.h">\r
+ <Filter>Source</Filter>\r
+ </ClInclude>\r
</ItemGroup>\r
</Project>
\ No newline at end of file