From: Ronag Date: Sun, 14 Aug 2011 18:03:49 +0000 (+0000) Subject: git-svn-id: https://casparcg.svn.sourceforge.net/svnroot/casparcg/server/branches... X-Git-Tag: 2.0.1~167 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=40c4bd4d2cd9c055717d1bbaf664c428c9ddea7a;p=casparcg git-svn-id: https://casparcg.svn.sourceforge.net/svnroot/casparcg/server/branches/2.0.0.2@1173 362d55ac-95cf-4e76-9f9a-cbaa9c17b72d --- diff --git a/core/producer/stage.cpp b/core/producer/stage.cpp index d222b39d7..72a2e80e7 100644 --- a/core/producer/stage.cpp +++ b/core/producer/stage.cpp @@ -161,11 +161,7 @@ public: swap_layer(index, other_index); else { - if(channel_.get_format_desc() != other.impl_->channel_.get_format_desc() || &channel_.ogl() != &other.impl_->channel_.ogl()) - BOOST_THROW_EXCEPTION(not_supported() << msg_info("Cannot swap between incompatible channels.")); - - auto func = [&]{layers_[index].swap(other.impl_->layers_[other_index]);}; - + auto func = [&]{layers_[index].swap(other.impl_->layers_[other_index]);}; channel_.execution().invoke([&]{other.impl_->channel_.execution().invoke(func, high_priority);}, high_priority); } } @@ -175,9 +171,6 @@ public: if(other.impl_.get() == this) return; - if(channel_.get_format_desc() != other.impl_->channel_.get_format_desc() || &channel_.ogl() != &other.impl_->channel_.ogl()) - BOOST_THROW_EXCEPTION(not_supported() << msg_info("Cannot swap between incompatible channels.")); - auto func = [&] { auto sel_first = [](const std::pair& pair){return pair.first;}; @@ -203,14 +196,14 @@ public: }, high_priority ); } - boost::unique_future> foreground(int index) + safe_ptr foreground(int index) { - return channel_.execution().begin_invoke([=]{return layers_[index].foreground();}, high_priority); + return channel_.execution().invoke([=]{return layers_[index].foreground();}, high_priority); } - boost::unique_future> background(int index) + safe_ptr background(int index) { - return channel_.execution().begin_invoke([=]{return layers_[index].background();}, high_priority); + return channel_.execution().invoke([=]{return layers_[index].background();}, high_priority); } std::wstring print() const @@ -231,7 +224,7 @@ void stage::clear(){impl_->clear();} void stage::swap_layer(int index, size_t other_index){impl_->swap_layer(index, other_index);} void stage::swap_layer(int index, size_t other_index, stage& other){impl_->swap_layer(index, other_index, other);} layer_status stage::get_status(int index){return impl_->get_status(index);} -boost::unique_future> stage::foreground(size_t index) {return impl_->foreground(index);} -boost::unique_future> stage::background(size_t index) {return impl_->background(index);} +safe_ptr stage::foreground(size_t index) {return impl_->foreground(index);} +safe_ptr stage::background(size_t index) {return impl_->background(index);} std::map> stage::execute(){return impl_->execute();} }} \ No newline at end of file diff --git a/core/producer/stage.h b/core/producer/stage.h index b13e71257..8fb21a818 100644 --- a/core/producer/stage.h +++ b/core/producer/stage.h @@ -25,7 +25,6 @@ #include #include -#include namespace caspar { namespace core { @@ -52,8 +51,8 @@ public: void swap_layer(int index, size_t other_index, stage& other); layer_status get_status(int index); - boost::unique_future> foreground(size_t index); - boost::unique_future> background(size_t index); + safe_ptr foreground(size_t index); + safe_ptr background(size_t index); private: struct implementation; diff --git a/modules/flash/producer/cg_producer.cpp b/modules/flash/producer/cg_producer.cpp index 42a7af295..1cb9c09b6 100644 --- a/modules/flash/producer/cg_producer.cpp +++ b/modules/flash/producer/cg_producer.cpp @@ -111,7 +111,7 @@ public: safe_ptr get_default_cg_producer(const safe_ptr& video_channel, int render_layer) { - auto flash_producer = video_channel->stage()->foreground(render_layer).get(); + auto flash_producer = video_channel->stage()->foreground(render_layer); if(flash_producer->print().find(L"flash[") == std::string::npos) // UGLY hack {