#pragma once\r
\r
#include "../exception/win32_exception.h"\r
-#include "../utility/assert.h"\r
+#include "../utility/string.h"\r
#include "../log/log.h"\r
\r
#include <tbb/atomic.h>\r
#include "log.h"\r
\r
#include "../exception/exceptions.h"\r
-\r
+#include "../utility/string.h"\r
#include <ios>\r
#include <string>\r
#include <ostream>\r
#include <boost/log/sources/severity_logger.hpp>\r
#include <boost/log/sources/record_ostream.hpp>\r
\r
-#include "../utility/string.h"\r
-\r
namespace caspar { namespace log {\r
\r
namespace internal{\r
\r
#define CASPAR_LOG_CURRENT_EXCEPTION() \\r
try\\r
- {CASPAR_LOG(error) << caspar::widen(boost::current_exception_diagnostic_information());}\\r
+ {CASPAR_LOG(error) << boost::current_exception_diagnostic_information().c_str();}\\r
catch(...){}\r
\r
}}\r
#include <type_traits>\r
#include <exception>\r
\r
-#include "../utility/assert.h"\r
-\r
namespace caspar {\r
\r
template<typename T>\r
\r
T& operator*() const // noexcept\r
{\r
- CASPAR_ASSERT(impl_);\r
return *impl_.get();\r
} \r
\r
T* operator->() const // noexcept\r
{\r
- CASPAR_ASSERT(impl_);\r
return impl_.get();\r
} \r
\r
T* get() const // noexcept\r
{\r
- CASPAR_ASSERT(impl_);\r
return impl_.get();\r
} \r
\r
#include <functional>\r
#include <string>\r
#include <vector>\r
+#include <stdint.h>\r
\r
namespace caspar { namespace core {\r
\r
*/\r
#include "bluefish.h"\r
\r
+#include "consumer/bluefish_consumer.h"\r
+\r
#include "util/blue_velvet.h"\r
\r
+#include <common/log/log.h>\r
+#include <common/utility/string.h>\r
+\r
#include <core/consumer/frame_consumer.h>\r
\r
-#include "consumer/bluefish_consumer.h"\r
+#include <boost/lexical_cast.hpp>\r
\r
namespace caspar {\r
\r
#include <common/memory/memclr.h>\r
#include <common/utility/timer.h>\r
\r
+#include <core/consumer/frame_consumer.h>\r
+\r
#include <tbb/concurrent_queue.h>\r
\r
#include <boost/timer.hpp>\r
*/\r
#pragma once\r
\r
-#include <core/consumer/frame_consumer.h>\r
#include <common/memory/safe_ptr.h>\r
\r
#include <boost/property_tree/ptree.hpp>\r
#include <string>\r
\r
namespace caspar { \r
+\r
+namespace core {\r
+ struct frame_consumer;\r
+}\r
\r
safe_ptr<core::frame_consumer> create_bluefish_consumer(const std::vector<std::wstring>& params);\r
safe_ptr<core::frame_consumer> create_bluefish_consumer(const boost::property_tree::ptree& ptree);\r
#include <common/memory/memclr.h>\r
#include <common/memory/memshfl.h>\r
\r
+#include <core/consumer/frame_consumer.h>\r
+\r
#include <tbb/concurrent_queue.h>\r
\r
#include <boost/circular_buffer.hpp>\r
*/\r
#pragma once\r
\r
-#include <core/consumer/frame_consumer.h>\r
+#include <common/memory/safe_ptr.h>\r
+\r
#include <core/video_format.h>\r
\r
#include <boost/property_tree/ptree.hpp>\r
#include <vector>\r
\r
namespace caspar { \r
+\r
+namespace core {\r
+ struct frame_consumer;\r
+}\r
\r
safe_ptr<core::frame_consumer> create_decklink_consumer(const std::vector<std::wstring>& params);\r
safe_ptr<core::frame_consumer> create_decklink_consumer(const boost::property_tree::ptree& ptree);\r
#include <core/producer/frame/frame_factory.h>\r
\r
#include <tbb/concurrent_queue.h>\r
-#include <tbb/atomic.h>\r
\r
#include <boost/algorithm/string.hpp>\r
#include <boost/timer.hpp>\r
*/\r
#pragma once\r
\r
-#include <boost/property_tree/ptree.hpp>\r
-\r
-#include <string>\r
-#include <vector>\r
+//#include <boost/property_tree/ptree.hpp>\r
+//\r
+//#include <string>\r
+//#include <vector>\r
\r
namespace caspar { \r
\r
*/\r
#pragma once\r
\r
+#include <string>\r
+\r
namespace caspar {\r
\r
void init_ffmpeg();\r
#include <boost/assign.hpp>\r
#include <boost/filesystem.hpp>\r
#include <boost/foreach.hpp>\r
+#include <boost/lexical_cast.hpp>\r
\r
#include <algorithm>\r
\r
\r
#include <boost/exception/errinfo_file_name.hpp>\r
#include <boost/filesystem.hpp>\r
-#include <boost/thread/once.hpp>\r
\r
namespace caspar { \r
\r
#include <common/diagnostics/graph.h>\r
#include <common/log/log.h>\r
#include <common/utility/timer.h>\r
+#include <common/utility/string.h>\r
\r
+#include <core/consumer/frame_consumer.h>\r
#include <core/video_format.h>\r
\r
#include <core/mixer/read_frame.h>\r
\r
namespace caspar {\r
\r
-struct oal_consumer::implementation : public sf::SoundStream, boost::noncopyable\r
+struct oal_consumer : public core::frame_consumer, public sf::SoundStream\r
{\r
- safe_ptr<diagnostics::graph> graph_;\r
- boost::timer perf_timer_;\r
+ safe_ptr<diagnostics::graph> graph_;\r
+ boost::timer perf_timer_;\r
\r
- tbb::concurrent_bounded_queue<std::vector<short>> input_;\r
- boost::circular_buffer<std::vector<short>> container_;\r
- tbb::atomic<bool> is_running_;\r
+ tbb::concurrent_bounded_queue<std::vector<short>> input_;\r
+ boost::circular_buffer<std::vector<short>> container_;\r
+ tbb::atomic<bool> is_running_;\r
\r
- core::video_format_desc format_desc_;\r
- int preroll_count_;\r
+ core::video_format_desc format_desc_;\r
+ int preroll_count_;\r
public:\r
- implementation(const core::video_format_desc& format_desc) \r
+ oal_consumer() \r
: graph_(diagnostics::create_graph(narrow(print())))\r
, container_(5)\r
- , format_desc_(format_desc)\r
, preroll_count_(0)\r
{\r
graph_->add_guide("tick-time", 0.5);\r
graph_->set_color("tick-time", diagnostics::color(0.1f, 0.7f, 0.8f));\r
is_running_ = true;\r
input_.set_capacity(core::consumer_buffer_depth()-2);\r
- \r
- sf::SoundStream::Initialize(2, 48000);\r
- Play(); \r
- CASPAR_LOG(info) << print() << " Sucessfully initialized.";\r
}\r
\r
- ~implementation()\r
+ ~oal_consumer()\r
{\r
is_running_ = false;\r
input_.try_push(std::vector<short>());\r
Stop();\r
CASPAR_LOG(info) << print() << L" Shutting down."; \r
}\r
+\r
+ virtual void initialize(const core::video_format_desc& format_desc)\r
+ {\r
+ format_desc_ = format_desc; \r
+ sf::SoundStream::Initialize(2, 48000);\r
+ Play(); \r
+ CASPAR_LOG(info) << print() << " Sucessfully initialized.";\r
+ }\r
\r
- void send(const safe_ptr<core::read_frame>& frame)\r
+ virtual void send(const safe_ptr<core::read_frame>& frame)\r
{ \r
if(preroll_count_ < input_.capacity())\r
{\r
input_.push(std::vector<int16_t>(frame->audio_data().begin(), frame->audio_data().end())); \r
}\r
\r
- size_t buffer_depth() const{return 3;}\r
+ virtual size_t buffer_depth() const{return 3;}\r
\r
virtual bool OnGetData(sf::SoundStream::Chunk& data)\r
{ \r
return is_running_;\r
}\r
\r
- std::wstring print() const\r
+ virtual std::wstring print() const\r
{\r
return L"oal[" + format_desc_.name + L"]";\r
}\r
-};\r
\r
-oal_consumer::oal_consumer(){}\r
-oal_consumer::oal_consumer(oal_consumer&& other) : impl_(std::move(other.impl_)){}\r
-void oal_consumer::send(const safe_ptr<core::read_frame>& frame){impl_->send(frame);}\r
-size_t oal_consumer::buffer_depth() const{return impl_->buffer_depth();}\r
-void oal_consumer::initialize(const core::video_format_desc& format_desc){impl_.reset(new implementation(format_desc));}\r
-std::wstring oal_consumer::print() const { return impl_->print(); }\r
-const core::video_format_desc& oal_consumer::get_video_format_desc() const{return impl_->format_desc_;}\r
+ virtual const core::video_format_desc& get_video_format_desc() const\r
+ {\r
+ return format_desc_;\r
+ }\r
+};\r
\r
safe_ptr<core::frame_consumer> create_oal_consumer(const std::vector<std::wstring>& params)\r
{\r
\r
return make_safe<oal_consumer>();\r
}\r
+\r
+safe_ptr<core::frame_consumer> create_oal_consumer()\r
+{\r
+ return make_safe<oal_consumer>();\r
+}\r
+\r
}\r
*/\r
#pragma once\r
\r
+#include <common/memory/safe_ptr.h>\r
+\r
#include <core/video_format.h>\r
-#include <core/consumer/frame_consumer.h>\r
\r
#include <vector>\r
\r
namespace caspar {\r
- \r
-class oal_consumer : public core::frame_consumer\r
-{\r
-public: \r
- explicit oal_consumer();\r
- oal_consumer(oal_consumer&& other);\r
-\r
- // frame_consumer\r
- virtual void initialize(const core::video_format_desc& format_desc); \r
- virtual void send(const safe_ptr<core::read_frame>&);\r
- virtual size_t buffer_depth() const;\r
- virtual std::wstring print() const;\r
- virtual const core::video_format_desc& get_video_format_desc() const;\r
-private:\r
- struct implementation;\r
- std::shared_ptr<implementation> impl_;\r
-};\r
+\r
+namespace core {\r
+ struct frame_consumer;\r
+} \r
\r
safe_ptr<core::frame_consumer> create_oal_consumer(const std::vector<std::wstring>& params);\r
+safe_ptr<core::frame_consumer> create_oal_consumer();\r
\r
}
\ No newline at end of file
\r
void init_oal()\r
{\r
- core::register_consumer_factory(create_oal_consumer);\r
+ core::register_consumer_factory([](const std::vector<std::wstring>& params){return create_oal_consumer(params);});\r
}\r
\r
}
\ No newline at end of file
\r
#include "ogl_consumer.h"\r
\r
-#include <core/video_format.h>\r
-#include <core/mixer/read_frame.h>\r
-\r
#include <common/gl/gl_check.h>\r
#include <common/concurrency/executor.h>\r
#include <common/memory/safe_ptr.h>\r
#include <common/diagnostics/graph.h>\r
#include <common/utility/timer.h>\r
\r
+#include <core/video_format.h>\r
+#include <core/mixer/read_frame.h>\r
+#include <core/consumer/frame_consumer.h>\r
+\r
#include <boost/timer.hpp>\r
#include <boost/circular_buffer.hpp>\r
\r
*/\r
#pragma once\r
\r
-#include <core/consumer/frame_consumer.h>\r
-#include <core/video_format.h>\r
+#include <common/memory/safe_ptr.h>\r
\r
#include <vector>\r
#include <boost/property_tree/ptree.hpp>\r
\r
namespace caspar {\r
\r
+namespace core {\r
+ struct frame_consumer;\r
+}\r
+\r
safe_ptr<core::frame_consumer> create_ogl_consumer(const std::vector<std::wstring>& params);\r
safe_ptr<core::frame_consumer> create_ogl_consumer(const boost::property_tree::ptree& ptree);\r
\r
#include <windows.h>\r
#include <atlbase.h>\r
\r
-#include <GL/glew.h>\r
-\r
-#include <core/mixer/gpu/ogl_device.h>\r
-\r
#include <protocol/amcp/AMCPProtocolStrategy.h>\r
\r
#include <modules/bluefish/bluefish.h>\r
#include <common/gl/gl_check.h>\r
#include <common/os/windows/current_version.h>\r
#include <common/os/windows/system_info.h>\r
-#include <common/utility/assert.h>\r
+\r
+#include <core/mixer/gpu/ogl_device.h>\r
\r
#include <tbb/task_scheduler_observer.h>\r
-#include <tbb/task_scheduler_init.h>\r
\r
-#include <boost/foreach.hpp>\r
#include <boost/property_tree/detail/file_parser_error.hpp>\r
\r
+#include <algorithm>\r
+\r
// NOTE: This is needed in order to make CComObject work since this is not a real ATL project.\r
CComModule _AtlModule;\r
extern __declspec(selectany) CAtlModule* _pAtlModule = &_AtlModule;\r
CASPAR_LOG(info) << L"FreeImage " << caspar::get_image_version();\r
\r
CASPAR_LOG(info) << L"Decklink " << caspar::get_decklink_version();\r
- BOOST_FOREACH(auto& device, caspar::get_decklink_device_list())\r
+ auto deck = caspar::get_decklink_device_list();\r
+ std::for_each(deck.begin(), deck.end(), [](const std::wstring& device)\r
+ {\r
CASPAR_LOG(info) << device;\r
+ });\r
\r
- CASPAR_LOG(info) << L"Bluefish " << caspar::get_bluefish_version();\r
- BOOST_FOREACH(auto& device, caspar::get_bluefish_device_list())\r
+ auto blue = caspar::get_bluefish_device_list();\r
+ std::for_each(blue.begin(), blue.end(), [](const std::wstring& device)\r
+ {\r
CASPAR_LOG(info) << device;\r
-\r
+ });\r
+ \r
CASPAR_LOG(info) << L"FFMPEG-avcodec " << caspar::get_avcodec_version();\r
CASPAR_LOG(info) << L"FFMPEG-avformat " << caspar::get_avformat_version();\r
CASPAR_LOG(info) << L"FFMPEG-avfilter " << caspar::get_avfilter_version();\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
using namespace core;\r
using namespace protocol;\r
\r
-\r
struct server::implementation : boost::noncopyable\r
{\r
std::vector<safe_ptr<IO::AsyncEventServer>> async_servers_; \r
- std::vector<safe_ptr<video_channel>> channels_;\r
+ std::vector<safe_ptr<video_channel>> channels_;\r
ogl_device ogl_;\r
\r
implementation() \r
//else if(name == "file") \r
// channels_.back()->output()->add(index++, create_ffmpeg_consumer(xml_consumer.second)); \r
else if(name == "audio")\r
- channels_.back()->output()->add(index++, make_safe<oal_consumer>()); \r
+ channels_.back()->output()->add(index++, create_oal_consumer()); \r
else if(name != "<xmlcomment>")\r
CASPAR_LOG(warning) << "Invalid consumer: " << widen(name); \r
}\r
\r
#pragma once\r
\r
-#include <core/video_channel.h>\r
-\r
-#include <common/exception/exceptions.h>\r
+#include <common/memory/safe_ptr.h>\r
\r
#include <boost/noncopyable.hpp>\r
\r
#include <vector>\r
\r
namespace caspar {\r
- \r
+\r
+namespace core {\r
+ class video_channel;\r
+}\r
+\r
class server : boost::noncopyable\r
{\r
public:\r
server();\r
-\r
const std::vector<safe_ptr<core::video_channel>> get_channels() const;\r
-\r
private:\r
struct implementation;\r
- std::shared_ptr<implementation> impl_;\r
+ safe_ptr<implementation> impl_;\r
};\r
\r
}
\ No newline at end of file
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">NotUsing</PrecompiledHeader>\r
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Develop|Win32'">NotUsing</PrecompiledHeader>\r
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>\r
+ <ShowIncludes Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</ShowIncludes>\r
</ClCompile>\r
</ItemGroup>\r
<ItemGroup>\r