X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=core%2Fvideo_channel_context.h;h=4c06e3a9f3801dd9fafee0c48bd8232bec31d2c3;hb=a486c25d5e6ce0ebe08e9a2d793a447ff3cb797a;hp=7943582fe4925bdb022cea717477c9477f8de660;hpb=ff60b8649021d4d41bc15af633a1b4848ee7588c;p=casparcg diff --git a/core/video_channel_context.h b/core/video_channel_context.h index 7943582fe..4c06e3a9f 100644 --- a/core/video_channel_context.h +++ b/core/video_channel_context.h @@ -2,7 +2,6 @@ #include -#include #include #include @@ -12,51 +11,30 @@ #include -namespace caspar { namespace core { +namespace caspar { + +class executor; + +namespace core { + +class ogl_device; class video_channel_context { - mutable tbb::spin_rw_mutex mutex_; - const int index_; - video_format_desc format_desc_; - executor execution_; - executor destruction_; - ogl_device& ogl_; public: - video_channel_context(int index, ogl_device& ogl, const video_format_desc& format_desc) - : index_(index) - , format_desc_(format_desc) - , execution_(print() + L"/execution") - , destruction_(print() + L"/destruction") - , ogl_(ogl) - { - execution_.set_priority_class(above_normal_priority_class); - destruction_.set_priority_class(below_normal_priority_class); - } - - const int index() const {return index_;} - - video_format_desc get_format_desc() - { - tbb::spin_rw_mutex::scoped_lock lock(mutex_, false); - return format_desc_; - } - - void set_format_desc(const video_format_desc& format_desc) - { - tbb::spin_rw_mutex::scoped_lock lock(mutex_, true); - format_desc_ = format_desc; - } - - executor& execution() {return execution_;} - executor& destruction() {return destruction_;} - ogl_device& ogl() { return ogl_;} - - std::wstring print() const - { - return L"video_channel[" + boost::lexical_cast(index_+1) + L"-" + format_desc_.name + L"]"; - } + video_channel_context(int index, ogl_device& ogl, const video_format_desc& format_desc); + + const int index() const; + video_format_desc get_format_desc(); + void set_format_desc(const video_format_desc& format_desc); + executor& execution(); + executor& destruction(); + ogl_device& ogl(); + std::wstring print() const; +private: + struct implementation; + std::shared_ptr impl_; }; }} \ No newline at end of file