\r
#include "../log/log.h"\r
\r
-namespace caspar{\r
+namespace caspar {\r
\r
void win32_exception::install_handler() \r
{\r
badAddress_ = reinterpret_cast<win32_exception::address>(info.ExceptionInformation[1]);\r
}\r
\r
-const char* win32_access_violation::what() const {\r
+const char* win32_access_violation::what() const\r
+{\r
sprintf_s<>(messageBuffer_, "Access violation at %p, trying to %s %p", location(), isWrite_?"write":"read", badAddress_);\r
\r
return messageBuffer_;\r
#include <BlueVelvet4.h>\r
#include <BlueHancUtils.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 bluefish {\r
+namespace caspar { namespace core { namespace bluefish {\r
\r
struct consumer::implementation\r
{\r
- implementation::implementation(const frame_format_desc& format_desc, unsigned int device_index, bool embeed_audio) \r
- : device_index_(device_index), format_desc_(format_desc), sdk_(BlueVelvetFactory4()), current_id_(0), embeed_audio_(embeed_audio)\r
+ implementation::implementation(const frame_format_desc& format_desc, unsigned int device_index, bool embed_audio) \r
+ : device_index_(device_index), format_desc_(format_desc), sdk_(BlueVelvetFactory4()), current_id_(0), embed_audio_(embed_audio)\r
{\r
mem_fmt_ = MEM_FMT_ARGB_PC;\r
upd_fmt_ = UPD_FMT_FRAME;\r
BOOST_THROW_EXCEPTION(bluefish_exception() << msg_info("BLUECARD ERROR: Failed to set vido engine."));\r
\r
enable_video_output();\r
-\r
- \r
+ \r
page_locked_buffer::reserve_working_size(MAX_HANC_BUFFER_SIZE * 3); \r
for(int n = 0; n < 3; ++n)\r
hanc_buffers_.push_back(std::make_shared<page_locked_buffer>(MAX_HANC_BUFFER_SIZE));\r
unsigned long fieldCount = 0;\r
sdk_->wait_output_video_synch(UPD_FMT_FRAME, fieldCount);\r
\r
- if(embeed_audio_)\r
+ if(embed_audio_)\r
{ \r
encode_hanc(reinterpret_cast<BLUE_UINT32*>(hanc->data()), frame_audio_data.data(), audio_samples, audio_nchannels);\r
\r
\r
std::vector<page_locked_buffer_ptr> hanc_buffers_;\r
int current_id_;\r
- bool embeed_audio_;\r
+ bool embed_audio_;\r
};\r
\r
-consumer::consumer(const frame_format_desc& format_desc, unsigned int device_index, bool embeed_audio) : impl_(new implementation(format_desc, device_index, embeed_audio)){} \r
+consumer::consumer(const frame_format_desc& format_desc, unsigned int device_index, bool embed_audio) : impl_(new implementation(format_desc, device_index, embed_audio)){} \r
void consumer::display(const gpu_frame_ptr& frame){impl_->display(frame);}\r
const frame_format_desc& consumer::get_frame_format_desc() const { return impl_->format_desc_;}\r
\r
-}}\r
+}}}\r
\r
#endif
\ No newline at end of file
#include "../../frame/frame_fwd.h"\r
#include "../../consumer/frame_consumer.h"\r
\r
-namespace caspar { namespace bluefish {\r
+namespace caspar { namespace core { namespace bluefish {\r
\r
class consumer : public frame_consumer\r
{\r
public:\r
- consumer(const frame_format_desc& format_desc, unsigned int deviceIndex, bool embedd_audio = false);\r
+ consumer(const frame_format_desc& format_desc, unsigned int deviceIndex, bool embed_audio = false);\r
\r
void display(const gpu_frame_ptr&);\r
\r
};\r
typedef std::tr1::shared_ptr<consumer> BlueFishFrameConsumerPtr;\r
\r
-}}\r
+}}}\r
\r
#include "../../../common/exception/exceptions.h"\r
\r
-#include <exception>\r
+namespace caspar { namespace core { namespace bluefish {\r
\r
-namespace caspar { namespace bluefish {\r
+struct bluefish_exception : public caspar_exception{};\r
\r
-struct bluefish_exception : public caspar_exception\r
-{\r
- bluefish_exception(){}\r
- explicit bluefish_exception(const char* msg) : std::exception(msg) {}\r
-};\r
-\r
-}}
\ No newline at end of file
+}}}
\ No newline at end of file
\r
class CBlueVelvet4;\r
\r
-namespace caspar { namespace bluefish {\r
+namespace caspar { namespace core { namespace bluefish {\r
\r
typedef std::tr1::shared_ptr<CBlueVelvet4> BlueVelvetPtr;\r
\r
class consumer;\r
typedef std::shared_ptr<consumer> consumer_ptr;\r
\r
-}}
\ No newline at end of file
+}}}
\ No newline at end of file
#include "../../frame/frame_format.h"\r
#include "exception.h"\r
\r
-namespace caspar { namespace bluefish {\r
+namespace caspar { namespace core { namespace bluefish {\r
\r
static const size_t MAX_HANC_BUFFER_SIZE = 256*1024;\r
static const size_t MAX_VBI_BUFFER_SIZE = 36*1920*4;\r
};\r
typedef std::shared_ptr<page_locked_buffer> page_locked_buffer_ptr;\r
\r
-}}
\ No newline at end of file
+}}}
\ No newline at end of file
\r
#include <memory>\r
\r
-namespace caspar { namespace bluefish {\r
+namespace caspar { namespace core { namespace bluefish {\r
\r
inline bool is_epoch_card(int card_type)\r
{\r
return set_card_property(pSdk.get(), prop, value);\r
}\r
\r
-}}
\ No newline at end of file
+}}}
\ No newline at end of file
\r
#pragma warning(push)\r
\r
-namespace caspar{ namespace decklink{\r
+namespace caspar { namespace core { namespace decklink{\r
\r
struct DecklinkVideoConsumer::Implementation : public IDeckLinkVideoOutputCallback\r
{\r
explicit DecklinkVideoFrame(DecklinkFrameManager* pFactory)\r
{\r
IDeckLinkMutableVideoFrame* frame = NULL;\r
- const caspar::frame_format_desc& format_desc = pFactory->pConsumerImpl_->get_frame_format_desc();\r
+ const frame_format_desc& format_desc = pFactory->pConsumerImpl_->get_frame_format_desc();\r
if(pFactory->pConsumerImpl_->pDecklinkOutput_->CreateVideoFrame(format_desc.width, format_desc.height, format_desc.size/format_desc.height, bmdFormat8BitBGRA, bmdFrameFlagDefault, &frame) != S_OK) \r
{\r
throw std::exception("DECKLINK: Failed to create frame");\r
return std::make_shared<DecklinkVideoFrame>(this);\r
}\r
\r
- const caspar::frame_format_desc& get_frame_format_desc() const {\r
+ const frame_format_desc& get_frame_format_desc() const {\r
return pConsumerImpl_->get_frame_format_desc();\r
}\r
\r
\r
// IDeckLinkMutableVideoFrame* pNextFrame_;\r
\r
- explicit Implementation(const caspar::frame_format_desc& format_desc, bool internalKey) \r
+ explicit Implementation(const frame_format_desc& format_desc, bool internalKey) \r
: format_desc_(format_desc), currentFormat_(frame_format::pal), internalKey_(internalKey)\r
{\r
\r
return S_OK;\r
}\r
\r
- const caspar::frame_format_desc& get_frame_format_desc() const \r
+ const frame_format_desc& get_frame_format_desc() const \r
{\r
return frame_format_desc::format_descs[currentFormat_];\r
}\r
}\r
};\r
\r
-DecklinkVideoConsumer::DecklinkVideoConsumer(const caspar::frame_format_desc& format_desc, bool internalKey) : pImpl_(new Implementation(format_desc, internalKey))\r
+DecklinkVideoConsumer::DecklinkVideoConsumer(const frame_format_desc& format_desc, bool internalKey) : pImpl_(new Implementation(format_desc, internalKey))\r
{}\r
\r
void DecklinkVideoConsumer::display(const gpu_frame_ptr& frame)\r
}\r
\r
} //namespace decklink\r
-} //namespace caspar
\ No newline at end of file
+}} //namespace caspar
\ No newline at end of file
\r
#include "../../frame/frame_fwd.h"\r
\r
-namespace caspar { namespace decklink {\r
+namespace caspar { namespace core { namespace decklink {\r
\r
class DecklinkVideoConsumer : public frame_consumer\r
{\r
public:\r
- explicit DecklinkVideoConsumer(const caspar::frame_format_desc& format_desc, bool internalKey = false);\r
+ explicit DecklinkVideoConsumer(const frame_format_desc& format_desc, bool internalKey = false);\r
\r
void display(const gpu_frame_ptr&);\r
const frame_format_desc& get_frame_format_desc() const;\r
std::tr1::shared_ptr<Implementation> pImpl_;\r
};\r
\r
-}}
\ No newline at end of file
+}}}
\ No newline at end of file
\r
#include <memory>\r
\r
-namespace caspar {\r
+namespace caspar { namespace core {\r
\r
struct frame_consumer : boost::noncopyable\r
{\r
typedef std::unique_ptr<frame_consumer> frame_consumer_uptr;\r
typedef std::unique_ptr<const frame_consumer> frame_consumer_const_uptr;\r
\r
-}
\ No newline at end of file
+}}
\ No newline at end of file
\r
#include <windows.h>\r
\r
-namespace caspar{ namespace audio{ \r
+namespace caspar { namespace core { namespace audio{ \r
\r
-class sound_channel : public sf::SoundStream\r
+struct consumer::implementation : public sf::SoundStream, boost::noncopyable\r
{\r
-public:\r
- sound_channel() : internal_chunks_(5), silence_(1920*2, 0)\r
+ implementation(const frame_format_desc& format_desc) : format_desc_(format_desc), internal_chunks_(5)\r
{\r
external_chunks_.set_capacity(3);\r
sf::SoundStream::Initialize(2, 48000);\r
}\r
\r
- ~sound_channel()\r
+ ~implementation()\r
{\r
external_chunks_.clear();\r
external_chunks_.push(nullptr);\r
\r
void push(const gpu_frame_ptr& frame)\r
{\r
- if(frame->audio_data().empty())\r
- frame->audio_data() = silence_;\r
-\r
- //if(!external_chunks_.try_push(frame))\r
- //{\r
- //CASPAR_LOG(debug) << "Sound Buffer Overrun";\r
- external_chunks_.push(frame);\r
- //}\r
+ static std::vector<short> silence(1920*2, 0);\r
\r
+ if(frame->audio_data().empty())\r
+ frame->audio_data() = silence;\r
+ \r
+ external_chunks_.push(frame);\r
if(GetStatus() != Playing && external_chunks_.size() >= 3)\r
Play();\r
}\r
-\r
-private:\r
-\r
+ \r
bool OnStart() \r
{\r
external_chunks_.clear();\r
}\r
\r
internal_chunks_.push_back(frame);\r
- //SetVolume(pChunk->volume());\r
data.Samples = reinterpret_cast<sf::Int16*>(frame->audio_data().data());\r
data.NbSamples = frame->audio_data().size();\r
return true;\r
}\r
\r
- std::vector<short> silence_;\r
boost::circular_buffer<gpu_frame_ptr> internal_chunks_;\r
tbb::concurrent_bounded_queue<gpu_frame_ptr> external_chunks_;\r
-};\r
-typedef std::shared_ptr<sound_channel> sound_channelPtr;\r
-\r
-struct consumer::implementation : boost::noncopyable\r
-{ \r
- implementation(const frame_format_desc& format_desc) : format_desc_(format_desc)\r
- {\r
- }\r
- \r
- void push(const gpu_frame_ptr& frame)\r
- {\r
- channel_.push(frame);\r
- }\r
- \r
- sound_channel channel_;\r
-\r
- caspar::frame_format_desc format_desc_;\r
+ frame_format_desc format_desc_;\r
};\r
\r
-consumer::consumer(const caspar::frame_format_desc& format_desc) : impl_(new implementation(format_desc)){}\r
-const caspar::frame_format_desc& consumer::get_frame_format_desc() const{return impl_->format_desc_;}\r
+consumer::consumer(const frame_format_desc& format_desc) : impl_(new implementation(format_desc)){}\r
+const frame_format_desc& consumer::get_frame_format_desc() const{return impl_->format_desc_;}\r
void consumer::prepare(const gpu_frame_ptr& frame){impl_->push(frame);}\r
-}}\r
+}}}\r
\r
#include "../../consumer/frame_consumer.h"\r
\r
-namespace caspar { namespace audio {\r
+namespace caspar { namespace core { namespace audio {\r
\r
class consumer : public frame_consumer\r
{\r
std::shared_ptr<implementation> impl_;\r
};\r
\r
-}}
\ No newline at end of file
+}}}
\ No newline at end of file
\r
#include <windows.h>\r
\r
-namespace caspar{ namespace ogl{ \r
+namespace caspar { namespace core { namespace ogl{ \r
\r
void GL_CHECK()\r
{\r
\r
std::unique_ptr<sf::Window> window_;\r
stretch stretch_;\r
- caspar::frame_format_desc format_desc_;\r
+ frame_format_desc format_desc_;\r
\r
std::exception_ptr exception_;\r
boost::thread thread_;\r
tbb::concurrent_bounded_queue<gpu_frame_ptr> frame_buffer_;\r
};\r
\r
-consumer::consumer(const caspar::frame_format_desc& format_desc, unsigned int screen_index, stretch stretch, bool windowed)\r
+consumer::consumer(const frame_format_desc& format_desc, unsigned int screen_index, stretch stretch, bool windowed)\r
: impl_(new implementation(format_desc, screen_index, stretch, windowed)){}\r
-const caspar::frame_format_desc& consumer::get_frame_format_desc() const{return impl_->format_desc_;}\r
+const frame_format_desc& consumer::get_frame_format_desc() const{return impl_->format_desc_;}\r
void consumer::display(const gpu_frame_ptr& frame){impl_->display(frame);}\r
-}}\r
+}}}\r
\r
#include "../../consumer/frame_consumer.h"\r
\r
-namespace caspar { namespace ogl {\r
+namespace caspar { namespace core { namespace ogl {\r
\r
struct ogl_error : virtual caspar_exception{};\r
\r
std::shared_ptr<implementation> impl_;\r
};\r
\r
-}}
\ No newline at end of file
+}}}
\ No newline at end of file
<None Include="My Amplifier Results\r002lw\r002lw.ampl" />\r
<None Include="My Amplifier Results\r003lw\r003lw.ampl" />\r
<None Include="My Amplifier Results\r004hs\r004hs.ampl" />\r
+ <None Include="My Amplifier Results\r005hs\r005hs.ampl" />\r
+ <None Include="My Amplifier Results\r006hs\r006hs.ampl" />\r
</ItemGroup>\r
<ItemGroup>\r
<ProjectReference Include="..\common\common.vcxproj">\r
<ClInclude Include="producer\ffmpeg\video\video_transformer.h">\r
<Filter>Source\producer\ffmpeg\video</Filter>\r
</ClInclude>\r
- <ClInclude Include="frame\composite_gpu_frame.h">\r
- <Filter>Source\frame\gpu</Filter>\r
- </ClInclude>\r
<ClInclude Include="producer\flash\bitmap.h">\r
<Filter>Source\producer\flash</Filter>\r
</ClInclude>\r
<ClInclude Include="consumer\bluefish\bluefish_consumer.h">\r
<Filter>Source\consumer\bluefish</Filter>\r
</ClInclude>\r
+ <ClInclude Include="frame\composite_gpu_frame.h">\r
+ <Filter>Source\frame\gpu</Filter>\r
+ </ClInclude>\r
</ItemGroup>\r
<ItemGroup>\r
<ClCompile Include="StdAfx.cpp">\r
<ClCompile Include="frame\gpu_frame.cpp">\r
<Filter>Source\frame\gpu</Filter>\r
</ClCompile>\r
- <ClCompile Include="frame\composite_gpu_frame.cpp">\r
- <Filter>Source\frame\gpu</Filter>\r
- </ClCompile>\r
<ClCompile Include="producer\ffmpeg\video\video_transformer.cpp">\r
<Filter>Source\producer\ffmpeg\video</Filter>\r
</ClCompile>\r
<ClCompile Include="consumer\bluefish\bluefish_consumer.cpp">\r
<Filter>Source\consumer\bluefish</Filter>\r
</ClCompile>\r
+ <ClCompile Include="frame\composite_gpu_frame.cpp">\r
+ <Filter>Source\frame\gpu</Filter>\r
+ </ClCompile>\r
</ItemGroup>\r
<ItemGroup>\r
<Midl Include="consumer\decklink\DeckLinkAPI_v7_3.idl">\r
<None Include="My Amplifier Results\r004hs\r004hs.ampl">\r
<Filter>My Amplifier Results</Filter>\r
</None>\r
+ <None Include="My Amplifier Results\r005hs\r005hs.ampl">\r
+ <Filter>My Amplifier Results</Filter>\r
+ </None>\r
+ <None Include="My Amplifier Results\r006hs\r006hs.ampl">\r
+ <Filter>My Amplifier Results</Filter>\r
+ </None>\r
</ItemGroup>\r
</Project>
\ No newline at end of file
#include <algorithm>\r
#include <numeric>\r
\r
-namespace caspar {\r
+namespace caspar { namespace core {\r
\r
struct composite_gpu_frame::implementation : boost::noncopyable\r
{\r
{\r
frames_.push_back(frame);\r
\r
- if(audio_data_.empty())\r
- audio_data_ = std::move(frame->audio_data());\r
+ if(self_->audio_data().empty())\r
+ self_->audio_data() = std::move(frame->audio_data());\r
else\r
{\r
for(size_t n = 0; n < frame->audio_data().size(); ++n)\r
- audio_data_[n] = static_cast<short>(static_cast<int>(audio_data_[n]) + static_cast<int>(frame->audio_data()[n]) & 0xFFFF); \r
+ self_->audio_data()[n] = static_cast<short>(static_cast<int>(self_->audio_data()[n]) + static_cast<int>(frame->audio_data()[n]) & 0xFFFF); \r
}\r
}\r
\r
composite_gpu_frame* self_;\r
std::vector<gpu_frame_ptr> frames_;\r
size_t size_;\r
- std::vector<short> audio_data_;\r
};\r
\r
#pragma warning (disable : 4355)\r
bool composite_gpu_frame::read_unlock(){return impl_->read_unlock();}\r
void composite_gpu_frame::draw(){impl_->draw();}\r
unsigned char* composite_gpu_frame::data(){return impl_->data();}\r
-const std::vector<short>& composite_gpu_frame::audio_data() const { return impl_->audio_data_; } \r
-std::vector<short>& composite_gpu_frame::audio_data() { return impl_->audio_data_; }\r
-void composite_gpu_frame::reset(){impl_->audio_data_.clear();}\r
void composite_gpu_frame::add(const gpu_frame_ptr& frame){impl_->add(frame);}\r
\r
-}
\ No newline at end of file
+gpu_frame_ptr composite_gpu_frame::interlace(const gpu_frame_ptr& frame1 ,const gpu_frame_ptr& frame2, video_mode mode)\r
+{ \r
+ auto result = std::make_shared<composite_gpu_frame>(frame1->width(), frame1->height());\r
+ result->add(frame1);\r
+ result->add(frame2);\r
+ if(mode == video_mode::upper)\r
+ {\r
+ frame1->mode(video_mode::upper);\r
+ frame2->mode(video_mode::lower);\r
+ }\r
+ else\r
+ {\r
+ frame1->mode(video_mode::lower);\r
+ frame2->mode(video_mode::upper);\r
+ }\r
+ return result;\r
+}\r
+\r
+}}
\ No newline at end of file
\r
#include "gpu_frame.h"\r
\r
-namespace caspar {\r
+namespace caspar { namespace core {\r
\r
class composite_gpu_frame : public gpu_frame\r
{\r
void read_lock(GLenum mode);\r
bool read_unlock();\r
void draw();\r
- void reset();\r
- \r
+\r
virtual unsigned char* data();\r
\r
- virtual const std::vector<short>& audio_data() const; \r
- virtual std::vector<short>& audio_data();\r
-\r
void add(const gpu_frame_ptr& frame);\r
+\r
+ static gpu_frame_ptr interlace(const gpu_frame_ptr& frame1 ,const gpu_frame_ptr& frame2, video_mode mode);\r
\r
private:\r
struct implementation;\r
};\r
typedef std::shared_ptr<composite_gpu_frame> composite_gpu_frame_ptr;\r
\r
-}
\ No newline at end of file
+}}
\ No newline at end of file
\r
#include <memory>\r
\r
-namespace caspar { \r
+namespace caspar { namespace core { \r
\r
struct frame_factory\r
{\r
\r
typedef std::shared_ptr<frame_factory> frame_factory_ptr;\r
\r
-}
\ No newline at end of file
+}}
\ No newline at end of file
\r
#define DEFINE_VIDEOFORMATDESC(w, h, m, f, s, fmt) { (w), (h), (m), (f), (w)*(h)*4, s, (fmt) }\r
\r
-namespace caspar {\r
+namespace caspar { namespace core {\r
\r
const frame_format_desc frame_format_desc::format_descs[frame_format::count] = \r
{ \r
DEFINE_VIDEOFORMATDESC(1920, 1080,video_mode:: progressive, 30, TEXT("1080p3000"), frame_format::x1080p3000)\r
};\r
\r
-frame_format get_video_format(const std::wstring& strVideoMode)\r
+frame_format get_video_format(const std::wstring& str)\r
{\r
for(int n = 0; n < frame_format::count; ++n)\r
{\r
- if(boost::iequals(frame_format_desc::format_descs[n].name, strVideoMode))\r
+ if(boost::iequals(frame_format_desc::format_descs[n].name, str))\r
return static_cast<frame_format>(n);\r
}\r
\r
return frame_format::invalid;\r
}\r
\r
-} //namespace caspar\r
+}} //namespace caspar\r
\r
\r
#include <string>\r
\r
-namespace caspar{\r
+namespace caspar { namespace core {\r
\r
enum video_mode\r
{\r
{ \r
auto casparVideoFormat = defaultFormat;\r
if(!strVideoMode.empty())\r
- casparVideoFormat = caspar::get_video_format(std::wstring(strVideoMode.begin(), strVideoMode.end()));\r
+ casparVideoFormat = get_video_format(std::wstring(strVideoMode.begin(), strVideoMode.end()));\r
return frame_format_desc::format_descs[casparVideoFormat];\r
}\r
\r
return out;\r
}\r
\r
-}
\ No newline at end of file
+}}
\ No newline at end of file
\r
#include <memory>\r
\r
-namespace caspar{\r
+namespace caspar { namespace core {\r
\r
class gpu_frame;\r
typedef std::shared_ptr<gpu_frame> gpu_frame_ptr;\r
typedef std::shared_ptr<audio_chunk> audio_chunk_ptr;\r
typedef std::unique_ptr<audio_chunk> audio_chunk_uptr;\r
\r
-}
\ No newline at end of file
+}}
\ No newline at end of file
#include "../../common/utility/memory.h"\r
#include "../../common/gl/utility.h"\r
\r
-namespace caspar {\r
+namespace caspar { namespace core {\r
\r
GLubyte progressive_pattern[] = {\r
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\r
void gpu_frame::translate(double x, double y) { impl_->x_ += x; impl_->y_ += y; }\r
void gpu_frame::mode(video_mode mode){ impl_->mode_ = mode;}\r
video_mode gpu_frame::mode() const{ return impl_->mode_;}\r
-}
\ No newline at end of file
+}}
\ No newline at end of file
\r
#include <Glee.h>\r
\r
-namespace caspar {\r
+namespace caspar { namespace core {\r
\r
class gpu_frame : boost::noncopyable\r
{\r
};\r
typedef std::shared_ptr<gpu_frame> gpu_frame_ptr;\r
\r
-}
\ No newline at end of file
+}}
\ No newline at end of file
#include <unordered_map>\r
#include <numeric>\r
\r
-namespace caspar {\r
+namespace caspar { namespace core {\r
\r
class frame_buffer : boost::noncopyable\r
{\r
index_ = 0;\r
});\r
\r
- empty_frame_ = create_frame(format_desc.width, format_desc.height);\r
- common::clear(empty_frame_->data(), empty_frame_->size());\r
+ auto empty_frame = create_frame(format_desc.width, format_desc.height);\r
+ common::clear(empty_frame->data(), empty_frame->size());\r
for(int n = 0; n < 3; ++n)\r
- finished_frames_.push(empty_frame_);\r
+ finished_frames_.push(empty_frame);\r
}\r
\r
~implementation()\r
{\r
- finished_frames_.push(nullptr);\r
executor_.stop();\r
}\r
\r
\r
tbb::concurrent_unordered_map<size_t, tbb::concurrent_bounded_queue<gpu_frame_ptr>> input_frame_pools_;\r
\r
- tbb::concurrent_bounded_queue<gpu_frame_ptr> out_frame_pool_;\r
- \r
frame_buffer_ptr fbo_;\r
\r
- int index_;\r
+ size_t index_;\r
std::vector<composite_gpu_frame_ptr> input_;\r
std::vector<composite_gpu_frame_ptr> writing_;\r
\r
frame_format_desc format_desc_;\r
\r
std::unique_ptr<sf::Context> context_;\r
+ \r
common::executor executor_;\r
-\r
- gpu_frame_ptr empty_frame_;\r
};\r
\r
gpu_frame_processor::gpu_frame_processor(const frame_format_desc& format_desc) : impl_(new implementation(format_desc)){}\r
void gpu_frame_processor::pop(gpu_frame_ptr& frame){ impl_->pop(frame);}\r
gpu_frame_ptr gpu_frame_processor::create_frame(size_t width, size_t height){return impl_->create_frame(width, height);}\r
\r
-}
\ No newline at end of file
+}}
\ No newline at end of file
#include "frame_fwd.h"\r
#include "frame_factory.h"\r
\r
-namespace caspar {\r
+namespace caspar { namespace core {\r
\r
class gpu_frame_processor : public frame_factory, boost::noncopyable\r
{\r
};\r
typedef std::shared_ptr<gpu_frame_processor> gpu_frame_processor_ptr;\r
\r
-}
\ No newline at end of file
+}}
\ No newline at end of file
\r
#include "server.h"\r
#include "protocol/amcp/AMCPProtocolStrategy.h"\r
+#include "../common/exception/win32_exception.h"\r
+\r
+using namespace caspar;\r
+using namespace caspar::core;\r
+using namespace caspar::common;\r
\r
class win32_handler_tbb_installer : public tbb::task_scheduler_observer\r
{\r
public:\r
win32_handler_tbb_installer() {observe(true);}\r
- void on_scheduler_entry(bool is_worker) {caspar::win32_exception::install_handler();} \r
+ void on_scheduler_entry(bool is_worker) \r
+ {\r
+ CASPAR_LOG(debug) << L"Started TBB Worker Thread.";\r
+ win32_exception::install_handler();\r
+ } \r
};\r
\r
int _tmain(int argc, _TCHAR* argv[])\r
str << "CasparCG " << CASPAR_VERSION_STR << " " << CASPAR_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"Copyright (c) 2010 Sveriges Television AB <info@casparcg.com>\n\n" << std::endl;\r
+\r
EnableMenuItem(GetSystemMenu(GetConsoleWindow(), FALSE), SC_CLOSE , MF_GRAYED);\r
DrawMenuBar(GetConsoleWindow());\r
MoveWindow(GetConsoleWindow(), 800, 0, 800, 1000, true);\r
MessageBox(nullptr, TEXT("Now is the time to connect for remote debugging..."), TEXT("Debug"), MB_OK | MB_TOPMOST);\r
#endif\r
\r
- caspar::log::add_file_sink(caspar::server::log_folder());\r
+ log::add_file_sink(server::log_folder());\r
+ \r
+ CASPAR_LOG(debug) << "Started Main Thread";\r
\r
win32_handler_tbb_installer win32_handler_tbb_installer;\r
- caspar::win32_exception::install_handler();\r
- \r
- std::wcout << L"Starting CasparCG Video Playout Server Ver: " << CASPAR_VERSION_STR << " tag: " << CASPAR_VERSION_TAG << std::endl;\r
- std::wcout << L"Copyright (c) 2010 Sveriges Television AB <info@casparcg.com>\n\n" << std::endl;\r
- \r
- CASPAR_LOG(debug) << "Started Main Thread";\r
+ win32_exception::install_handler();\r
+ \r
try \r
{\r
- caspar::server caspar_device;\r
+ server caspar_device;\r
\r
- auto dummy = std::make_shared<caspar::IO::DummyClientInfo>();\r
- caspar::amcp::AMCPProtocolStrategy amcp(caspar_device.get_channels());\r
+ auto dummy = std::make_shared<IO::DummyClientInfo>();\r
+ amcp::AMCPProtocolStrategy amcp(caspar_device.get_channels());\r
bool is_running = true;\r
while(is_running)\r
{\r
#include <intrin.h>\r
#pragma intrinsic(__movsd, __stosd)\r
\r
-namespace caspar {\r
+namespace caspar { namespace core {\r
\r
class color_producer : public frame_producer\r
{\r
return std::make_shared<color_producer>(get_pixel_color_value(params[0]), format_desc);\r
}\r
\r
-}
\ No newline at end of file
+}}
\ No newline at end of file
#include <string>\r
#include <vector>\r
\r
-namespace caspar {\r
+namespace caspar { namespace core {\r
\r
frame_producer_ptr create_color_producer(const std::vector<std::wstring>& params, const frame_format_desc& format_desc);\r
\r
-}\r
+}}\r
\r
#include <queue>\r
\r
-namespace caspar{ namespace ffmpeg{\r
+namespace caspar { namespace core { namespace ffmpeg{\r
\r
struct audio_decoder::implementation : boost::noncopyable\r
{\r
\r
audio_decoder::audio_decoder() : impl_(new implementation()){}\r
audio_packet_ptr audio_decoder::execute(const audio_packet_ptr& audio_packet){return impl_->execute(audio_packet);}\r
-}}
\ No newline at end of file
+}}}
\ No newline at end of file
\r
#include "../packet.h"\r
\r
-namespace caspar{ namespace ffmpeg {\r
+namespace caspar { namespace core { namespace ffmpeg {\r
\r
class audio_decoder : boost::noncopyable\r
{\r
typedef std::shared_ptr<audio_decoder> audio_decoder_ptr;\r
typedef std::unique_ptr<audio_decoder> audio_decoder_uptr;\r
\r
-}}
\ No newline at end of file
+}}}
\ No newline at end of file
\r
using namespace boost::assign;\r
\r
-namespace caspar{ namespace ffmpeg{\r
+namespace caspar { namespace core { namespace ffmpeg{\r
\r
struct ffmpeg_producer : public frame_producer\r
{\r
return std::make_shared<ffmpeg_producer>(result_filename, params, format_desc);\r
}\r
\r
-}}
\ No newline at end of file
+}}}
\ No newline at end of file
#include <string>\r
#include <vector>\r
\r
-namespace caspar { namespace ffmpeg {\r
+namespace caspar { namespace core { namespace ffmpeg {\r
\r
frame_producer_ptr create_ffmpeg_producer(const std::vector<std::wstring>& params, const frame_format_desc& format_desc);\r
\r
-}}
\ No newline at end of file
+}}}
\ No newline at end of file
\r
#pragma warning(disable : 4482)\r
\r
-namespace caspar{ namespace ffmpeg{\r
+namespace caspar { namespace core { namespace ffmpeg{\r
\r
struct input::implementation : boost::noncopyable\r
{\r
audio_packet_ptr input::get_audio_packet(){return impl_->get_audio_packet();}\r
bool input::seek(unsigned long long frame){return impl_->seek(frame);}\r
void input::start(){impl_->start();}\r
-}}
\ No newline at end of file
+}}}
\ No newline at end of file
#include <system_error>\r
#include "../../frame/frame_fwd.h"\r
\r
-namespace caspar{ namespace ffmpeg{ \r
+namespace caspar { namespace core { namespace ffmpeg{ \r
\r
typedef std::shared_ptr<AVFormatContext> AVFormatContextPtr;\r
\r
typedef std::unique_ptr<input> input_uptr;\r
\r
}\r
-}\r
+}}\r
#pragma warning (pop)\r
#endif\r
\r
-namespace caspar{ namespace ffmpeg{\r
+namespace caspar { namespace core { namespace ffmpeg{\r
\r
typedef std::tr1::shared_ptr<AVFrame> AVFramePtr; \r
typedef std::tr1::shared_ptr<AVPacket> AVPacketPtr;\r
typedef std::shared_ptr<audio_packet> audio_packet_ptr;\r
\r
}\r
-}\r
+}}\r
\r
#include "video_decoder.h"\r
\r
-namespace caspar{ namespace ffmpeg{\r
+namespace caspar { namespace core { namespace ffmpeg{\r
\r
struct video_decoder::implementation : boost::noncopyable\r
{\r
\r
video_decoder::video_decoder() : impl_(new implementation()){}\r
video_packet_ptr video_decoder::execute(const video_packet_ptr& video_packet){return impl_->execute(video_packet);}\r
-}}
\ No newline at end of file
+}}}
\ No newline at end of file
\r
#include "../packet.h"\r
\r
-namespace caspar{ namespace ffmpeg{\r
+namespace caspar { namespace core { namespace ffmpeg{\r
\r
typedef std::tr1::shared_ptr<AVCodecContext> AVCodecContextPtr;\r
\r
typedef std::unique_ptr<video_decoder> video_decoder_uptr;\r
\r
}\r
-}
\ No newline at end of file
+}}
\ No newline at end of file
#pragma warning (pop)\r
#endif\r
\r
-namespace caspar{ namespace ffmpeg{\r
+namespace caspar { namespace core { namespace ffmpeg{\r
\r
struct video_transformer::implementation : boost::noncopyable\r
{\r
video_transformer::video_transformer() : impl_(new implementation()){}\r
video_packet_ptr video_transformer::execute(const video_packet_ptr& video_packet){return impl_->execute(video_packet);}\r
void video_transformer::initialize(const frame_factory_ptr& factory){impl_->factory_ = factory; }\r
-}}
\ No newline at end of file
+}}}
\ No newline at end of file
\r
#include "../../../frame/frame_fwd.h"\r
\r
-namespace caspar{ namespace ffmpeg{\r
+namespace caspar { namespace core { namespace ffmpeg{\r
\r
class video_transformer : boost::noncopyable\r
{\r
typedef std::shared_ptr<video_transformer> video_transformer_ptr;\r
typedef std::unique_ptr<video_transformer> video_transformer_uptr;\r
\r
-}}
\ No newline at end of file
+}}}
\ No newline at end of file
#pragma warning (push, 1) // TODO: Legacy code, just disable warnings\r
#endif\r
\r
-namespace caspar {\r
+namespace caspar { namespace core {\r
namespace flash {\r
\r
CComBSTR FlashAxContainer::flashGUID_(_T("{D27CDB6E-AE6D-11CF-96B8-444553540000}"));\r
return S_OK;\r
}\r
\r
-HRESULT FlashAxContainer::SetFormat(const caspar::frame_format_desc& format_desc) \r
+HRESULT FlashAxContainer::SetFormat(const frame_format_desc& format_desc) \r
{\r
if(m_spInPlaceObjectWindowless == nullptr)\r
return E_FAIL;\r
assert(SUCCEEDED(hr));\r
bInvalidRect_ = false;\r
\r
-/* const caspar::frame_format_desc& format_desc = caspar::frame_format_desc::format_descs[format_];\r
+/* const frame_format_desc& format_desc = frame_format_desc::format_descs[format_];\r
\r
//Trying to redraw just the dirty rectangles. Doesn't seem to work when the movie uses "filters", such as glow, dropshadow etc.\r
std::vector<flash::DirtyRect>::iterator it = bDirtyRects_.begin();\r
\r
\r
} //namespace flash\r
-} //namespace caspar
\ No newline at end of file
+}} //namespace caspar
\ No newline at end of file
#include "axflash.h"\r
//#import "progid:ShockwaveFlash.ShockwaveFlash.9" no_namespace, named_guids\r
\r
-namespace caspar { namespace flash {\r
+namespace caspar { namespace core { namespace flash {\r
\r
class flash_producer;\r
\r
flash::flash_producer* pflash_producer_;\r
std::vector<DirtyRect> bDirtyRects_;\r
\r
- HRESULT SetFormat(const caspar::frame_format_desc&);\r
+ HRESULT SetFormat(const frame_format_desc&);\r
bool IsReadyToRender() const;\r
void EnterFullscreen();\r
\r
};\r
\r
} //namespace flash\r
-} //namespace caspar\r
+}} //namespace caspar\r
\r
#endif //_FLASHAXCONTAINER_H__
\ No newline at end of file
* along with CasparCG. If not, see <http://www.gnu.org/licenses/>.\r
*\r
*/\r
- \r
-#ifndef _TIMER_HELPER_H__\r
-#define _TIMER_HELPER_H__\r
+#pragma once\r
\r
-#include "FlashAxContainer.h"\r
+#include <boost/noncopyable.hpp>\r
\r
-namespace caspar {\r
-namespace flash {\r
+namespace caspar { namespace core { namespace flash {\r
\r
- class TimerHelper\r
+class TimerHelper : boost::noncopyable\r
+{\r
+public:\r
+ TimerHelper(){}\r
+ TimerHelper(DWORD first, DWORD interv, ITimerSink* pTS) : firstTime(first), interval(interv), currentTime(first), pTimerSink(pTS), ID(first){}\r
+ void Setup(DWORD first, DWORD interv, ITimerSink* pTS)\r
{\r
- TimerHelper(const TimerHelper&);\r
- const TimerHelper& operator=(const TimerHelper&);\r
-\r
- public:\r
- TimerHelper()\r
- {}\r
- TimerHelper(DWORD first, DWORD interv, ITimerSink* pTS) : firstTime(first), interval(interv), currentTime(first), pTimerSink(pTS)\r
- {\r
- ID = first;\r
- }\r
- ~TimerHelper()\r
- {\r
- }\r
- void Setup(DWORD first, DWORD interv, ITimerSink* pTS)\r
- {\r
- firstTime = first;\r
- interval = interv;\r
- currentTime = first;\r
- pTimerSink = pTS;\r
- ID = first;\r
- }\r
-\r
- DWORD Invoke()\r
+ firstTime = first;\r
+ interval = interv;\r
+ currentTime = first;\r
+ pTimerSink = pTS;\r
+ ID = first;\r
+ }\r
+\r
+ DWORD Invoke()\r
+ {\r
+ if(pTimerSink != 0)\r
{\r
- if(pTimerSink != 0)\r
- {\r
- VARIANT value;\r
- value.vt = VT_UI4;\r
- value.ulVal = currentTime;\r
+ VARIANT value;\r
+ value.vt = VT_UI4;\r
+ value.ulVal = currentTime;\r
\r
- pTimerSink->OnTimer(value);\r
- currentTime += interval;\r
- }\r
- return currentTime;\r
+ pTimerSink->OnTimer(value);\r
+ currentTime += interval;\r
}\r
+ return currentTime;\r
+ }\r
\r
- DWORD firstTime;\r
- DWORD interval;\r
- DWORD currentTime;\r
- ATL::CComPtr<ITimerSink> pTimerSink;\r
- DWORD ID;\r
- };\r
-\r
-} //namespace flash\r
-} //namespace caspar\r
+ DWORD firstTime;\r
+ DWORD interval;\r
+ DWORD currentTime;\r
+ ATL::CComPtr<ITimerSink> pTimerSink;\r
+ DWORD ID;\r
+};\r
\r
-#endif //_TIMER_HELPER_H__
\ No newline at end of file
+}}}
\ No newline at end of file
\r
#include <windows.h>\r
\r
-namespace caspar{\r
+namespace caspar { namespace core {\r
\r
struct bitmap::implementation : boost::noncopyable\r
{\r
unsigned char* bitmap::data() { return impl_->bitmap_data_; }\r
HDC bitmap::hdc() { return impl_->hdc_; }\r
\r
-}
\ No newline at end of file
+}}
\ No newline at end of file
\r
#include <memory>\r
\r
-namespace caspar{\r
+namespace caspar { namespace core {\r
\r
class bitmap\r
{\r
typedef std::shared_ptr<bitmap> bitmap_ptr;\r
typedef std::unique_ptr<bitmap> bitmap_uptr;\r
\r
-}\r
+}}\r
\r
#include <boost/assign.hpp>\r
#include <tbb/concurrent_unordered_map.h>\r
\r
-namespace caspar{ namespace flash{\r
+namespace caspar { namespace core { namespace flash{\r
\r
struct flash_cg_proxy\r
{\r
{\r
return flash_producer_ ? flash_producer_->get_frame() : nullptr;\r
}\r
-\r
- \r
+ \r
void initialize(const frame_factory_ptr& factory)\r
{\r
factory_ = factory;\r
frame_factory_ptr factory_;\r
};\r
\r
-\r
// This is somewhat a hack... needs redesign\r
-cg_producer_ptr get_default_cg_producer(const renderer::render_device_ptr& prender_device, unsigned int exLayer)\r
+cg_producer_ptr get_default_cg_producer(const renderer::render_device_ptr& render_device, unsigned int exLayer)\r
{\r
- if(!prender_device)\r
- BOOST_THROW_EXCEPTION(null_argument() << msg_info("prender_device"));\r
+ if(!render_device)\r
+ BOOST_THROW_EXCEPTION(null_argument() << msg_info("render_device"));\r
\r
- auto pProducer = std::dynamic_pointer_cast<cg_producer>(prender_device->active(exLayer));\r
- if(!pProducer) \r
+ auto producer = std::dynamic_pointer_cast<cg_producer>(render_device->active(exLayer));\r
+ if(!producer)\r
{\r
- pProducer = std::make_shared<cg_producer>(prender_device->frame_format_desc()); \r
- prender_device->load(exLayer, pProducer, renderer::load_option::auto_play); \r
+ producer = std::make_shared<cg_producer>(render_device->get_frame_format_desc()); \r
+ render_device->load(exLayer, producer, renderer::load_option::auto_play); \r
}\r
\r
- return pProducer;\r
+ return producer;\r
}\r
\r
cg_producer::cg_producer(const frame_format_desc& fmtDesc) : impl_(new implementation(fmtDesc)){}\r
void cg_producer::update(int layer, const std::wstring& data){impl_->update(layer, data);}\r
void cg_producer::invoke(int layer, const std::wstring& label){impl_->invoke(layer, label);}\r
const frame_format_desc& cg_producer::get_frame_format_desc() const { return impl_->format_desc_; }\r
-void cg_producer::initialize(const caspar::frame_factory_ptr& factory){impl_->initialize(factory);}\r
-}}
\ No newline at end of file
+void cg_producer::initialize(const frame_factory_ptr& factory){impl_->initialize(factory);}\r
+}}}
\ No newline at end of file
#include "../../frame/frame_fwd.h"\r
#include "../../renderer/render_device.h"\r
\r
-namespace caspar{ namespace flash{\r
+namespace caspar { namespace core { namespace flash{\r
\r
class cg_producer : public frame_producer\r
{\r
void invoke(int layer, const std::wstring& label);\r
\r
const frame_format_desc& get_frame_format_desc() const;\r
- void initialize(const caspar::frame_factory_ptr& factory);\r
+ void initialize(const frame_factory_ptr& factory);\r
private:\r
struct implementation;\r
std::shared_ptr<implementation> impl_;\r
\r
cg_producer_ptr get_default_cg_producer(const renderer::render_device_ptr& render_device, unsigned int layer_index = CG_DEFAULT_LAYER);\r
\r
-}}
\ No newline at end of file
+}}}
\ No newline at end of file
\r
using namespace boost::assign;\r
\r
-namespace caspar { namespace flash {\r
+namespace caspar { namespace core { namespace flash {\r
\r
frame_producer_ptr create_ct_producer(const std::vector<std::wstring>& params, const frame_format_desc& format_desc) \r
{\r
\r
}\r
\r
-} //namespace caspar
\ No newline at end of file
+}} //namespace caspar
\ No newline at end of file
\r
#include "../frame_producer.h"\r
\r
-namespace caspar{ namespace flash{\r
+namespace caspar { namespace core { namespace flash{\r
\r
-caspar::frame_producer_ptr create_ct_producer(const std::vector<std::wstring>& params, const frame_format_desc& format_desc);\r
+frame_producer_ptr create_ct_producer(const std::vector<std::wstring>& params, const frame_format_desc& format_desc);\r
\r
-}}
\ No newline at end of file
+}}}
\ No newline at end of file
\r
#include <type_traits>\r
\r
-namespace caspar { namespace flash {\r
+namespace caspar { namespace core { namespace flash {\r
\r
using namespace boost::assign;\r
\r
return;\r
}\r
\r
- bool isProgressive = format_desc_.mode == video_mode::progressive || (flashax_container_->GetFPS() - format_desc_.fps/2 == 0);\r
+ bool is_progressive = format_desc_.mode == video_mode::progressive || (flashax_container_->GetFPS() - format_desc_.fps/2 == 0);\r
\r
gpu_frame_ptr result;\r
\r
- if(isProgressive) \r
+ if(is_progressive) \r
result = render_frame(); \r
else\r
{\r
- auto result = std::make_shared<composite_gpu_frame>(format_desc_.width, format_desc_.height);\r
- auto frame1 = render_frame();\r
- auto frame2 = render_frame();\r
- result->add(frame1);\r
- result->add(frame2);\r
- if(format_desc_.mode == video_mode::upper)\r
- {\r
- frame1->mode(video_mode::upper);\r
- frame2->mode(video_mode::lower);\r
- }\r
- else\r
- {\r
- frame1->mode(video_mode::lower);\r
- frame2->mode(video_mode::upper);\r
- }\r
+ gpu_frame_ptr frame1 = render_frame();\r
+ gpu_frame_ptr frame2 = render_frame();\r
+ result = composite_gpu_frame::interlace(frame1, frame2, format_desc_.mode);\r
}\r
\r
frame_buffer_.push(result);\r
auto pool = bitmap_pool_;\r
current_frame_.reset(frame.get(), [=](bitmap*)\r
{\r
- common::function_task::enqueue([=]\r
- {\r
- if(pool->try_push(frame))\r
- common::clear(frame->data(), frame->size());\r
- });\r
+ if(pool->try_push(frame))\r
+ common::clear(frame->data(), frame->size());\r
});\r
} \r
\r
std::shared_ptr<bitmap_pool> bitmap_pool_;\r
frame_format_desc format_desc_;\r
\r
- CComObject<caspar::flash::FlashAxContainer>* flashax_container_;\r
+ CComObject<flash::FlashAxContainer>* flashax_container_;\r
\r
tbb::concurrent_bounded_queue<gpu_frame_ptr> frame_buffer_;\r
gpu_frame_ptr last_frame_;\r
return result_filename.empty() ? nullptr : std::make_shared<flash_producer>(result_filename, format_desc);\r
}\r
\r
-}}
\ No newline at end of file
+}}}
\ No newline at end of file
\r
#include "../frame_producer.h"\r
\r
-namespace caspar {\r
+namespace caspar { namespace core {\r
\r
class Monitor;\r
\r
\r
flash_producer_ptr create_flash_producer(const std::vector<std::wstring>& params, const frame_format_desc& format_desc);\r
\r
-}}
\ No newline at end of file
+}}}
\ No newline at end of file
\r
#include <memory>\r
\r
-namespace caspar {\r
+namespace caspar { namespace core {\r
\r
class frame_producer : boost::noncopyable\r
{\r
};\r
typedef std::shared_ptr<frame_producer> frame_producer_ptr;\r
\r
-}
\ No newline at end of file
+}}
\ No newline at end of file
#include <boost/filesystem.hpp>\r
#include <boost/exception/errinfo_file_name.hpp>\r
\r
-namespace caspar{ namespace image{\r
+namespace caspar { namespace core { namespace image{\r
+\r
+struct FreeImage_initializer\r
+{\r
+ FreeImage_initializer(){FreeImage_Initialise(true);}\r
+ ~FreeImage_initializer(){FreeImage_DeInitialise();}\r
+};\r
+\r
+FreeImage_initializer init;\r
\r
std::shared_ptr<FIBITMAP> load_image(const std::string& filename)\r
{\r
return load_image(common::narrow(filename));\r
}\r
\r
-}}
\ No newline at end of file
+}}}
\ No newline at end of file
#include <memory>\r
#include <string>\r
\r
-namespace caspar{ namespace image{\r
+namespace caspar { namespace core { namespace image{\r
\r
std::shared_ptr<FIBITMAP> load_image(const std::string& filename);\r
std::shared_ptr<FIBITMAP> load_image(const std::wstring& filename);\r
\r
-}}\r
+}}}\r
\r
using namespace boost::assign;\r
\r
-namespace caspar{ namespace image{\r
+namespace caspar { namespace core { namespace image{\r
\r
struct image_producer : public frame_producer\r
{\r
return nullptr;\r
}\r
\r
-}}
\ No newline at end of file
+}}}
\ No newline at end of file
#include <string>\r
#include <vector>\r
\r
-namespace caspar { namespace image {\r
+namespace caspar { namespace core { namespace image {\r
\r
frame_producer_ptr create_image_producer(const std::vector<std::wstring>& params, const frame_format_desc& format_desc);\r
\r
-}}
\ No newline at end of file
+}}}
\ No newline at end of file
\r
using namespace boost::assign;\r
\r
-namespace caspar{ namespace image{\r
+namespace caspar { namespace core { namespace image{\r
\r
enum direction\r
{\r
\r
gpu_frame_ptr get_frame()\r
{ \r
- gpu_frame_ptr result;\r
- if(format_desc_.mode == video_mode::progressive) \r
- result = render_frame(); \r
- else\r
+ if(format_desc_.mode != video_mode::progressive) \r
{\r
- auto result = std::make_shared<composite_gpu_frame>(format_desc_.width, format_desc_.height);\r
gpu_frame_ptr frame1;\r
gpu_frame_ptr frame2;\r
tbb::parallel_invoke([&]{ frame1 = render_frame(); }, [&]{ frame2 = render_frame(); });\r
- result->add(frame1);\r
- result->add(frame2);\r
- if(format_desc_.mode == video_mode::upper)\r
- {\r
- frame1->mode(video_mode::upper);\r
- frame2->mode(video_mode::lower);\r
- }\r
- else\r
- {\r
- frame1->mode(video_mode::lower);\r
- frame2->mode(video_mode::upper);\r
- }\r
- }\r
+ return composite_gpu_frame::interlace(frame1, frame2, format_desc_.mode);\r
+ } \r
\r
- return result;\r
+ return render_frame(); \r
}\r
-\r
\r
void initialize(const frame_factory_ptr& factory)\r
{\r
return nullptr;\r
}\r
\r
-}}
\ No newline at end of file
+}}}
\ No newline at end of file
#include <string>\r
#include <vector>\r
\r
-namespace caspar { namespace image {\r
+namespace caspar { namespace core { namespace image {\r
\r
frame_producer_ptr create_image_scroll_producer(const std::vector<std::wstring>& params, const frame_format_desc& format_desc);\r
\r
-}}
\ No newline at end of file
+}}}
\ No newline at end of file
\r
#include <boost/range/algorithm/copy.hpp>\r
\r
-namespace caspar{ \r
+namespace caspar { namespace core { \r
\r
struct transition_producer::implementation : boost::noncopyable\r
{\r
implementation(const frame_producer_ptr& dest, const transition_info& info, const frame_format_desc& format_desc) \r
- : current_frame_(0), info_(info), border_color_(0), format_desc_(format_desc), dest_(dest)\r
+ : current_frame_(0), info_(info), format_desc_(format_desc), dest_(dest)\r
{\r
if(!dest)\r
BOOST_THROW_EXCEPTION(null_argument() << arg_name_info("dest"));\r
\r
gpu_frame_ptr get_frame()\r
{\r
- if(++current_frame_ >= info_.duration)\r
- return nullptr;\r
-\r
- return compose(get_producer_frame(dest_), get_producer_frame(source_));\r
+ return ++current_frame_ >= info_.duration ? nullptr : compose(get_producer_frame(dest_), get_producer_frame(source_));\r
}\r
\r
gpu_frame_ptr get_producer_frame(frame_producer_ptr& producer)\r
catch(...)\r
{\r
CASPAR_LOG_CURRENT_EXCEPTION();\r
+ producer = nullptr;\r
CASPAR_LOG(warning) << "Removed renderer from transition.";\r
}\r
\r
- if(frame == nullptr && producer->get_following_producer() != nullptr)\r
+ if(frame == nullptr && producer != nullptr && producer->get_following_producer() != nullptr)\r
{\r
auto following = producer->get_following_producer();\r
+ following->initialize(factory_);\r
following->set_leading_producer(producer);\r
producer = following;\r
return get_producer_frame(producer);\r
if(info_.type == transition_type::cut || !dest_frame) \r
return src_frame;\r
\r
- int volume = static_cast<int>(static_cast<float>(current_frame_)/static_cast<float>(info_.duration)*256.0f);\r
+ int volume = static_cast<int>(static_cast<double>(current_frame_)/static_cast<double>(info_.duration)*256.0);\r
\r
for(size_t n = 0; n < dest_frame->audio_data().size(); ++n)\r
dest_frame->audio_data()[n] = static_cast<short>((static_cast<int>(dest_frame->audio_data()[n])*volume)>>8);\r
unsigned short current_frame_;\r
\r
const transition_info info_;\r
- const unsigned long border_color_;\r
frame_factory_ptr factory_;\r
};\r
\r
const frame_format_desc& transition_producer::get_frame_format_desc() const { return impl_->format_desc_; } \r
void transition_producer::initialize(const frame_factory_ptr& factory) { impl_->initialize(factory);}\r
\r
-}\r
+}}\r
\r
#include <string>\r
#include <vector>\r
\r
-namespace caspar {\r
+namespace caspar { namespace core {\r
\r
enum transition_type\r
{\r
enum transition_direction\r
{\r
from_left = 1,\r
- from_right,\r
- from_top,\r
- from_bottom\r
+ from_right\r
};\r
\r
struct transition_info\r
{\r
- transition_info() : type(transition_type::cut), duration(0), border_width(0), border_color(TEXT("#00000000")), direction(transition_direction::from_left){}\r
+ transition_info() : type(transition_type::cut), duration(0), direction(transition_direction::from_left){}\r
\r
- unsigned short duration;\r
- unsigned short border_width;\r
- transition_direction direction;\r
- transition_type type;\r
- std::wstring border_color;\r
- std::wstring border_image;\r
+ size_t duration;\r
+ transition_direction direction;\r
+ transition_type type;\r
};\r
\r
class transition_producer : public frame_producer\r
};\r
typedef std::shared_ptr<transition_producer> transition_producer_ptr;\r
\r
-}
\ No newline at end of file
+}}
\ No newline at end of file
#include <boost/algorithm/string.hpp>\r
#include "../../renderer/render_device.h"\r
\r
-namespace caspar {\r
+namespace caspar { namespace core {\r
namespace amcp {\r
\r
enum AMCPCommandScheduling\r
\r
void AddParameter(const std::wstring& param){_parameters.push_back(param);}\r
\r
- void SetClientInfo(caspar::IO::ClientInfoPtr& s){pClientInfo_ = s;}\r
- caspar::IO::ClientInfoPtr GetClientInfo(){return pClientInfo_;}\r
+ void SetClientInfo(IO::ClientInfoPtr& s){pClientInfo_ = s;}\r
+ IO::ClientInfoPtr GetClientInfo(){return pClientInfo_;}\r
\r
void SetChannel(const renderer::render_device_ptr& pChannel){pChannel_ = pChannel;}\r
renderer::render_device_ptr GetChannel(){return pChannel_;}\r
private:\r
unsigned int channelIndex_;\r
int layerIndex_;\r
- caspar::IO::ClientInfoPtr pClientInfo_;\r
+ IO::ClientInfoPtr pClientInfo_;\r
renderer::render_device_ptr pChannel_;\r
AMCPCommandScheduling scheduling_;\r
std::wstring replyString_;\r
virtual bool DoExecute() = 0;\r
}; \r
\r
-}}\r
+}}}\r
\r
#include "AMCPCommandQueue.h"\r
\r
-namespace caspar { namespace amcp {\r
+namespace caspar { namespace core { namespace amcp {\r
\r
using namespace common;\r
\r
return bDoRestart;\r
}\r
\r
-}}
\ No newline at end of file
+}}}
\ No newline at end of file
\r
#include <tbb\mutex.h>\r
\r
-namespace caspar { namespace amcp {\r
+namespace caspar { namespace core { namespace amcp {\r
\r
class AMCPCommandQueue : public common::IRunnable\r
{\r
};\r
typedef std::tr1::shared_ptr<AMCPCommandQueue> AMCPCommandQueuePtr;\r
\r
-}}\r
+}}}\r
600 [kommando] FAILED funktion ej implementerad\r
*/\r
\r
-namespace caspar {\r
+namespace caspar { namespace core {\r
\r
std::wstring ListMedia()\r
{ \r
//Perform loading of the clip\r
try\r
{\r
- auto pFP = load_media(_parameters, GetChannel()->frame_format_desc()); \r
+ auto pFP = load_media(_parameters, GetChannel()->get_frame_format_desc()); \r
bool autoPlay = std::find(_parameters.begin(), _parameters.end(), TEXT("AUTOPLAY")) != _parameters.end(); \r
GetChannel()->load(GetLayerIndex(), pFP, autoPlay ? renderer::load_option::auto_play : renderer::load_option::preview);\r
\r
transitionInfo.direction = transition_direction::from_right;\r
else if(direction == TEXT("RIGHT"))\r
transitionInfo.direction = transition_direction::from_left;\r
-\r
- if(_parameters.size() > static_cast<unsigned short>(transitionParameterIndex+3)) //border\r
- {\r
- std::wstring border = _parameters[transitionParameterIndex+3];\r
- if(border.size()>0)\r
- {\r
- if(border[0] == TEXT('#'))\r
- transitionInfo.border_color = border;\r
- else\r
- transitionInfo.border_image = border;\r
- }\r
-\r
- if(_parameters.size() > static_cast<unsigned short>(transitionParameterIndex+4)) //border width\r
- transitionInfo.border_width = _ttoi(_parameters[transitionParameterIndex+4].c_str());\r
- }\r
}\r
}\r
}\r
//Perform loading of the clip\r
try\r
{\r
- auto pFP = load_media(_parameters, GetChannel()->frame_format_desc());\r
+ auto pFP = load_media(_parameters, GetChannel()->get_frame_format_desc());\r
if(pFP == nullptr)\r
BOOST_THROW_EXCEPTION(file_not_found() << msg_info(_parameters.size() > 0 ? common::narrow(_parameters[0]) : ""));\r
\r
- pFP = std::make_shared<transition_producer>(pFP, transitionInfo, GetChannel()->frame_format_desc());\r
+ pFP = std::make_shared<transition_producer>(pFP, transitionInfo, GetChannel()->get_frame_format_desc());\r
bool autoPlay = std::find(_parameters.begin(), _parameters.end(), TEXT("AUTOPLAY")) != _parameters.end();\r
GetChannel()->load(GetLayerIndex(), pFP, autoPlay ? renderer::load_option::auto_play : renderer::load_option::none); // TODO: LOOP\r
\r
\r
void GenerateChannelInfo(int index, const renderer::render_device_ptr& pChannel, std::wstringstream& replyString)\r
{\r
- replyString << index << TEXT(" ") << pChannel->frame_format_desc().name << TEXT("\r\n") << (pChannel->active(0) != nullptr ? TEXT(" PLAYING") : TEXT(" STOPPED"));\r
+ replyString << index << TEXT(" ") << pChannel->get_frame_format_desc().name << TEXT("\r\n") << (pChannel->active(0) != nullptr ? TEXT(" PLAYING") : TEXT(" STOPPED"));\r
}\r
\r
bool InfoCommand::DoExecute()\r
\r
\r
} //namespace amcp\r
-} //namespace caspar
\ No newline at end of file
+}} //namespace caspar
\ No newline at end of file
\r
#include "AMCPCommand.h"\r
\r
-namespace caspar {\r
+namespace caspar { namespace core {\r
\r
std::wstring ListMedia();\r
std::wstring ListTemplates();\r
//};\r
\r
} //namespace amcp\r
-} //namespace caspar\r
+}} //namespace caspar\r
\r
#endif //__AMCPCOMMANDSIMPL_H__
\ No newline at end of file
#pragma warning (push, 1) // TODO: Legacy code, just disable warnings\r
#endif\r
\r
-namespace caspar { namespace amcp {\r
+namespace caspar { namespace core { namespace amcp {\r
\r
using namespace common;\r
using IO::ClientInfoPtr;\r
}\r
\r
} //namespace amcp\r
-} //namespace caspar
\ No newline at end of file
+}} //namespace caspar
\ No newline at end of file
#include "AMCPCommand.h"\r
#include "AMCPCommandQueue.h"\r
\r
-namespace caspar { namespace amcp {\r
+namespace caspar { namespace core { namespace amcp {\r
\r
class AMCPProtocolStrategy : public IO::IProtocolStrategy\r
{\r
AMCPProtocolStrategy(const std::vector<renderer::render_device_ptr>& channels);\r
virtual ~AMCPProtocolStrategy();\r
\r
- virtual void Parse(const TCHAR* pData, int charCount, caspar::IO::ClientInfoPtr pClientInfo);\r
+ virtual void Parse(const TCHAR* pData, int charCount, IO::ClientInfoPtr pClientInfo);\r
virtual UINT GetCodepage() {\r
return CP_UTF8;\r
}\r
private:\r
friend class AMCPCommand;\r
\r
- void ProcessMessage(const std::wstring& message, caspar::IO::ClientInfoPtr& pClientInfo);\r
+ void ProcessMessage(const std::wstring& message, IO::ClientInfoPtr& pClientInfo);\r
std::size_t TokenizeMessage(const std::wstring& message, std::vector<std::wstring>* pTokenVector);\r
AMCPCommandPtr CommandFactory(const std::wstring& str);\r
\r
static const std::wstring MessageDelimiter;\r
};\r
\r
-}}\r
+}}}\r
\r
#pragma once\r
\r
-namespace caspar {\r
+namespace caspar { namespace core {\r
namespace cii {\r
\r
class ICIICommand\r
typedef std::tr1::shared_ptr<ICIICommand> CIICommandPtr;\r
\r
} //namespace cii\r
-} //namespace caspar
\ No newline at end of file
+}} //namespace caspar
\ No newline at end of file
#include <algorithm>\r
#include "../../producer/flash/cg_producer.h"\r
\r
-namespace caspar { namespace cii {\r
+namespace caspar { namespace core { namespace cii {\r
\r
/////////////////\r
// MediaCommand\r
state_ = 3;\r
}\r
\r
-}}
\ No newline at end of file
+}}}
\ No newline at end of file
\r
#include "ciicommand.h"\r
\r
-namespace caspar {\r
+namespace caspar { namespace core {\r
\r
namespace cii {\r
\r
};\r
\r
} //namespace cii\r
-} //namespace caspar
\ No newline at end of file
+}} //namespace caspar
\ No newline at end of file
#pragma warning (push, 1) // TODO: Legacy code, just disable warnings\r
#endif\r
\r
-namespace caspar { namespace cii {\r
+namespace caspar { namespace core { namespace cii {\r
\r
using namespace common;\r
\r
executor_.start();\r
}\r
\r
-void CIIProtocolStrategy::Parse(const TCHAR* pData, int charCount, caspar::IO::ClientInfoPtr pClientInfo) \r
+void CIIProtocolStrategy::Parse(const TCHAR* pData, int charCount, IO::ClientInfoPtr pClientInfo) \r
{\r
std::size_t pos;\r
std::wstring msg(pData, charCount);\r
\r
std::vector<std::wstring> params;\r
params.push_back(server::template_folder()+TEXT("CG.fth"));\r
- auto pFP = flash::create_flash_producer(params, GetChannel()->frame_format_desc());\r
+ auto pFP = flash::create_flash_producer(params, GetChannel()->get_frame_format_desc());\r
if(pFP != 0)\r
{\r
//TODO: Initialize with valid FrameFactory\r
transition.type = transition_type::mix;\r
transition.duration = 12;\r
\r
- auto pFP = load_media(boost::assign::list_of(filename), pChannel_->frame_format_desc());\r
- auto pTransition = std::make_shared<transition_producer>(pFP, transition, pChannel_->frame_format_desc());\r
+ auto pFP = load_media(boost::assign::list_of(filename), pChannel_->get_frame_format_desc());\r
+ auto pTransition = std::make_shared<transition_producer>(pFP, transition, pChannel_->get_frame_format_desc());\r
\r
try\r
{\r
return lhs == rhs.titleName;\r
}\r
\r
-}}\r
+}}}\r
#include "../../../common/concurrency/executor.h"\r
#include "../../renderer/render_device.h"\r
\r
-namespace caspar { namespace cii {\r
+namespace caspar { namespace core { namespace cii {\r
\r
-class CIIProtocolStrategy : public caspar::IO::IProtocolStrategy\r
+class CIIProtocolStrategy : public IO::IProtocolStrategy\r
{\r
public:\r
CIIProtocolStrategy(const std::vector<renderer::render_device_ptr>& channels);\r
\r
- void Parse(const TCHAR* pData, int charCount, caspar::IO::ClientInfoPtr pClientInfo);\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
renderer::render_device_ptr pChannel_;\r
};\r
\r
-}}
\ No newline at end of file
+}}}
\ No newline at end of file
#include <locale>\r
#include "CLKCommand.h"\r
\r
-namespace caspar { namespace CLK {\r
+namespace caspar { namespace core { namespace CLK {\r
\r
CLKCommand::CLKCommand() : clockID_(0), command_(CLKInvalidCommand) {}\r
\r
parameters_.clear();\r
}\r
\r
-}}
\ No newline at end of file
+}}}
\ No newline at end of file
\r
#pragma once\r
\r
-namespace caspar{ namespace CLK {\r
+namespace caspar { namespace core { namespace CLK {\r
\r
class CLKCommand\r
{\r
std::vector<std::wstring> parameters_;\r
};\r
\r
-}}
\ No newline at end of file
+}}}
\ No newline at end of file
#include <sstream>\r
#include <algorithm>\r
\r
-namespace caspar { namespace CLK {\r
+namespace caspar { namespace core { namespace CLK {\r
\r
using namespace common;\r
\r
pChannel_ = channels[0];\r
}\r
\r
-void CLKProtocolStrategy::Parse(const TCHAR* pData, int charCount, caspar::IO::ClientInfoPtr pClientInfo) \r
+void CLKProtocolStrategy::Parse(const TCHAR* pData, int charCount, IO::ClientInfoPtr pClientInfo) \r
{\r
for(int index = 0; index < charCount; ++index) \r
{\r
}\r
\r
} //namespace CLK\r
-} //namespace caspar
\ No newline at end of file
+}} //namespace caspar
\ No newline at end of file
#include "../../../common/io/ProtocolStrategy.h"\r
#include "../../renderer/render_device.h"\r
\r
-namespace caspar { namespace CLK {\r
+namespace caspar { namespace core { namespace CLK {\r
\r
-class CLKProtocolStrategy : public caspar::IO::IProtocolStrategy\r
+class CLKProtocolStrategy : public IO::IProtocolStrategy\r
{\r
public:\r
CLKProtocolStrategy(const std::vector<renderer::render_device_ptr>& channels);\r
\r
- void Parse(const TCHAR* pData, int charCount, caspar::IO::ClientInfoPtr pClientInfo);\r
+ void Parse(const TCHAR* pData, int charCount, IO::ClientInfoPtr pClientInfo);\r
UINT GetCodepage() { return 28591; } //ISO 8859-1\r
\r
private:\r
bool bClockLoaded_;\r
};\r
\r
-}}\r
+}}}\r
\r
using namespace boost::assign;\r
\r
-namespace caspar { \r
+namespace caspar { namespace core { \r
\r
frame_producer_ptr load_media(const std::vector<std::wstring>& params, const frame_format_desc& format_desc)\r
{ \r
const auto producerFactories = list_of<ProducerFactory>\r
(&flash::create_flash_producer)\r
(&flash::create_ct_producer)\r
- (&caspar::image::create_image_producer)\r
- (&caspar::image::create_image_scroll_producer)\r
+ (&image::create_image_producer)\r
+ (&image::create_image_scroll_producer)\r
(&ffmpeg::create_ffmpeg_producer)\r
(&create_color_producer);\r
\r
return pProducer;\r
}\r
\r
-}\r
+}}\r
#include <string>\r
#include <vector>\r
\r
-namespace caspar { \r
+namespace caspar { namespace core { \r
\r
frame_producer_ptr load_media(const std::vector<std::wstring>& params, const frame_format_desc& format_desc);\r
\r
-}\r
+}}\r
\r
#include "../frame/frame_format.h"\r
\r
-namespace caspar { namespace renderer {\r
+namespace caspar { namespace core { namespace renderer {\r
\r
-struct layer::implementation : boost::noncopyable\r
+struct layer::implementation\r
{ \r
implementation() : preview_frame_(nullptr), active_(nullptr), background_(nullptr), last_frame_(nullptr) {}\r
\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->get_frame();\r
if(last_frame_ != nullptr)\r
last_frame_->audio_data().clear(); // No audio\r
active_ = nullptr; \r
- background_ = frame_producer;\r
}\r
else if(option == load_option::auto_play)\r
- {\r
- background_ = frame_producer;\r
- play(); \r
- }\r
- else\r
- background_ = frame_producer;\r
+ play(); \r
}\r
\r
void play()\r
gpu_frame_ptr layer::get_frame() {return impl_->get_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
+}}}
\ No newline at end of file
\r
#include "../producer/frame_producer.h"\r
\r
-namespace caspar { namespace renderer {\r
+namespace caspar { namespace core { namespace renderer {\r
\r
enum load_option\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
+}}}
\ No newline at end of file
\r
using namespace boost::assign;\r
\r
-namespace caspar{ namespace renderer{\r
+namespace caspar { namespace core { namespace renderer {\r
\r
std::vector<gpu_frame_ptr> render_frames(std::map<int, layer>& layers)\r
{ \r
\r
struct render_device::implementation : boost::noncopyable\r
{ \r
- implementation(const caspar::frame_format_desc& format_desc, unsigned int index, const std::vector<frame_consumer_ptr>& consumers) \r
+ implementation(const frame_format_desc& format_desc, unsigned int index, const std::vector<frame_consumer_ptr>& consumers) \r
: consumers_(consumers), fmt_(format_desc), frame_processor_(new gpu_frame_processor(format_desc)), needs_clock_(false)\r
{ \r
is_running_ = true;\r
\r
struct video_sync_clock\r
{\r
- video_sync_clock(const caspar::frame_format_desc& format_desc)\r
+ video_sync_clock(const frame_format_desc& format_desc)\r
{\r
period_ = static_cast<long>(get_frame_format_period(format_desc)*1000000.0);\r
time_ = boost::posix_time::microsec_clock::local_time();\r
boost::thread render_thread_;\r
boost::thread display_thread_;\r
\r
- caspar::frame_format_desc fmt_;\r
+ frame_format_desc fmt_;\r
tbb::concurrent_bounded_queue<gpu_frame_ptr> frame_buffer_;\r
\r
std::vector<frame_consumer_ptr> consumers_;\r
bool needs_clock_;\r
};\r
\r
-render_device::render_device(const caspar::frame_format_desc& format_desc, unsigned int index, const std::vector<frame_consumer_ptr>& consumers) \r
+render_device::render_device(const frame_format_desc& format_desc, unsigned int index, const std::vector<frame_consumer_ptr>& consumers) \r
: impl_(new implementation(format_desc, index, consumers)){}\r
void render_device::load(int exLayer, const frame_producer_ptr& pProducer, load_option option){impl_->load(exLayer, pProducer, option);}\r
void render_device::pause(int exLayer){impl_->pause(exLayer);}\r
void render_device::clear(){impl_->clear();}\r
frame_producer_ptr render_device::active(int exLayer) const {return impl_->active(exLayer);}\r
frame_producer_ptr render_device::background(int exLayer) const {return impl_->background(exLayer);}\r
-const frame_format_desc& render_device::frame_format_desc() const{return impl_->fmt_;}\r
-}}\r
+const frame_format_desc& render_device::get_frame_format_desc() const{return impl_->fmt_;}\r
+}}}\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{\r
- \r
-class Monitor;\r
-\r
-namespace renderer{\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, unsigned int index, const std::vector<frame_consumer_ptr>& consumers);\r
\r
- void load(int exLayer, const frame_producer_ptr& pProducer, load_option option = load_option::none); \r
+ void load(int exLayer, const frame_producer_ptr& producer, load_option option = load_option::none); \r
void pause(int exLayer);\r
void play(int exLayer);\r
void stop(int exLayer);\r
frame_producer_ptr active(int exLayer) const;\r
frame_producer_ptr background(int exLayer) const;\r
\r
- const frame_format_desc& frame_format_desc() const; \r
+ const frame_format_desc& get_frame_format_desc() const; \r
private:\r
struct implementation;\r
std::shared_ptr<implementation> impl_;\r
typedef std::shared_ptr<render_device> render_device_ptr;\r
typedef std::unique_ptr<render_device> render_device_uptr;\r
\r
-}}\r
+}}}\r
\r
#include <memory>\r
\r
-namespace caspar {\r
+namespace caspar { namespace core {\r
\r
class Monitor;\r
\r
typedef std::shared_ptr<layer> layer_ptr;\r
typedef std::unique_ptr<layer> layer_uptr;\r
\r
-}}\r
+}}}\r
#include "consumer/decklink/DecklinkVideoConsumer.h"\r
#include "consumer/ogl/ogl_consumer.h"\r
\r
-#include <FreeImage.h>\r
-\r
#include "protocol/amcp/AMCPProtocolStrategy.h"\r
#include "protocol/cii/CIIProtocolStrategy.h"\r
#include "protocol/CLK/CLKProtocolStrategy.h"\r
#include <boost/property_tree/ptree.hpp>\r
#include <boost/property_tree/xml_parser.hpp>\r
\r
-namespace caspar{\r
+namespace caspar { namespace core {\r
\r
struct server::implementation : boost::noncopyable\r
{\r
implementation() \r
- {\r
- FreeImage_Initialise(true); \r
- \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_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
+ if(!flash::FlashAxContainer::CheckForFlashSupport())\r
+ CASPAR_LOG(error) << "No flashplayer activex-control installed. Flash support will be disabled";\r
}\r
\r
~implementation()\r
- { \r
- FreeImage_DeInitialise();\r
+ { \r
async_servers_.clear();\r
channels_.clear();\r
}\r
{ \r
unsigned int port = xml_controller.second.get<unsigned int>("port");\r
port = port != 0 ? port : 5250;\r
- auto asyncserver = std::make_shared<caspar::IO::AsyncEventServer>(create_protocol(protocol), port);\r
+ auto asyncserver = std::make_shared<IO::AsyncEventServer>(create_protocol(protocol), port);\r
asyncserver->Start();\r
async_servers_.push_back(asyncserver);\r
}\r
\r
const std::vector<renderer::render_device_ptr>& server::get_channels() const{ return impl_->channels_; }\r
\r
-}
\ No newline at end of file
+}}
\ No newline at end of file
\r
#include "renderer/renderer_fwd.h"\r
\r
-namespace caspar { \r
+namespace caspar { namespace core { \r
\r
struct invalid_configuration : virtual boost::exception, virtual std::exception {};\r
\r
std::shared_ptr<implementation> impl_;\r
};\r
\r
-}
\ No newline at end of file
+}}
\ No newline at end of file