]> git.sesse.net Git - casparcg/blob - core/video_channel_context.cpp
677c1180e9696daddd86c3c9a33587aee8f9d07a
[casparcg] / core / video_channel_context.cpp
1 #include "stdAfx.h"\r
2 \r
3 #include "video_channel_context.h"\r
4 \r
5 namespace caspar { namespace core {\r
6 \r
7 video_channel_context::video_channel_context(int index, ogl_device& ogl, const video_format_desc& format_desc) \r
8         : index_(index)\r
9         , format_desc_(format_desc)\r
10         , execution_(print() + L"/execution")\r
11         , destruction_(print() + L"/destruction")\r
12         , ogl_(ogl)\r
13 {\r
14         execution_.set_priority_class(above_normal_priority_class);\r
15         destruction_.set_priority_class(below_normal_priority_class);\r
16 }\r
17 \r
18 const int video_channel_context::index() const {return index_;}\r
19 \r
20 video_format_desc video_channel_context::get_format_desc()\r
21 {\r
22         tbb::spin_rw_mutex::scoped_lock lock(mutex_, false);\r
23         return format_desc_;\r
24 }\r
25 \r
26 void video_channel_context::set_format_desc(const video_format_desc& format_desc)\r
27 {\r
28         tbb::spin_rw_mutex::scoped_lock lock(mutex_, true);\r
29         format_desc_ = format_desc;\r
30 }\r
31 \r
32 executor& video_channel_context::execution() {return execution_;}\r
33 executor& video_channel_context::destruction() {return destruction_;}\r
34 ogl_device& video_channel_context::ogl() { return ogl_;}\r
35 \r
36 std::wstring video_channel_context::print() const\r
37 {\r
38         return L"video_channel[" + boost::lexical_cast<std::wstring>(index_+1) + L"|" +  format_desc_.name + L"]";\r
39 }\r
40 \r
41 }}