#include <core/mixer/gpu/ogl_device.h>\r
#include <core/video_format.h>\r
\r
+#include <tbb/spin_rw_mutex.h>\r
+\r
#include <boost/noncopyable.hpp>\r
#include <boost/lexical_cast.hpp>\r
\r
\r
namespace caspar { namespace core {\r
\r
-struct video_channel_context\r
+class video_channel_context\r
{\r
- video_channel_context(int index, ogl_device& ogl, const video_format_desc& format_desc) \r
- : index(index)\r
- , format_desc(format_desc)\r
- , execution(print() + L"/execution")\r
- , destruction(print() + L"/destruction")\r
- , ogl(ogl)\r
- {\r
- execution.set_priority_class(above_normal_priority_class);\r
- }\r
-\r
- const int index;\r
- video_format_desc format_desc;\r
- executor execution;\r
- executor destruction;\r
- ogl_device& ogl;\r
-\r
- std::wstring print() const\r
- {\r
- return L"video_channel[" + boost::lexical_cast<std::wstring>(index+1) + L"-" + format_desc.name + L"]";\r
- }\r
+ mutable tbb::spin_rw_mutex mutex_;\r
+ const int index_;\r
+ video_format_desc format_desc_;\r
+ executor execution_;\r
+ executor destruction_;\r
+ ogl_device& ogl_;\r
+\r
+public:\r
+ video_channel_context(int index, ogl_device& ogl, const video_format_desc& format_desc);\r
+\r
+ const int index() const;\r
+ video_format_desc get_format_desc();\r
+ void set_format_desc(const video_format_desc& format_desc);\r
+ executor& execution();\r
+ executor& destruction();\r
+ ogl_device& ogl();\r
+ std::wstring print() const;\r
};\r
\r
}}
\ No newline at end of file