-#include <tbb/mutex.h>\r
-\r
-namespace caspar { namespace core {\r
-\r
-class key_read_frame_muxer : public core::read_frame\r
-{\r
- ogl_device& ogl_;\r
- safe_ptr<read_frame> fill_;\r
- std::shared_ptr<host_buffer> key_;\r
- tbb::mutex mutex_;\r
-public:\r
- key_read_frame_muxer(ogl_device& ogl, const safe_ptr<read_frame>& fill)\r
- : ogl_(ogl)\r
- , fill_(fill)\r
- {\r
- }\r
-\r
- virtual const boost::iterator_range<const uint8_t*> image_data()\r
- {\r
- tbb::mutex::scoped_lock lock(mutex_);\r
- if(!key_)\r
- {\r
- key_ = ogl_.create_host_buffer(fill_->image_data().size(), host_buffer::write_only); \r
- fast_memsfhl(key_->data(), fill_->image_data().begin(), fill_->image_data().size(), 0x0F0F0F0F, 0x0B0B0B0B, 0x07070707, 0x03030303);\r
- }\r