#include <type_traits>\r
#include <exception>\r
\r
-#include <tbb/spin_mutex.h>\r
-\r
namespace caspar {\r
\r
template<typename T>\r
class safe_ptr\r
{ \r
std::shared_ptr<T> impl_;\r
- tbb::spin_mutex mutex_;\r
template <typename> friend class safe_ptr;\r
public:\r
typedef T element_type;\r
virtual size_t buffer_depth() const{return 0;}\r
virtual void initialize(const video_format_desc&){}\r
virtual std::wstring print() const {return L"empty";}\r
+ virtual bool has_synchronization_clock() const {return false;}\r
};\r
static safe_ptr<frame_consumer> consumer = make_safe<empty_frame_consumer>();\r
return consumer;\r
#include <common/utility/timer.h>\r
#include <common/memory/memshfl.h>\r
\r
-#include <boost/range/algorithm_ext/erase.hpp>\r
-#include <boost/range/algorithm.hpp>\r
#include <boost/circular_buffer.hpp>\r
#include <boost/timer.hpp>\r
-#include <boost/range/algorithm.hpp>\r
\r
namespace caspar { namespace core {\r
\r
consumer->initialize(format_desc_);\r
executor_.invoke([&]\r
{\r
- if(buffer_.capacity() < consumer->buffer_depth())\r
- buffer_.set_capacity(consumer->buffer_depth());\r
+ buffer_.set_capacity(std::max(buffer_.capacity(), consumer->buffer_depth()));\r
\r
this->remove(index);\r
consumers_.insert(std::make_pair(index, consumer));\r
// Currently do key_only transform on cpu. Unsure if the extra 400MB/s (1080p50) overhead is worth it to do it on gpu.\r
auto key_data = ogl_device::create_host_buffer(frame->image_data().size(), host_buffer::write_only); \r
fast_memsfhl(key_data->data(), frame->image_data().begin(), frame->image_data().size(), 0x0F0F0F0F, 0x0B0B0B0B, 0x07070707, 0x03030303);\r
- std::vector<short> audio_data(frame->audio_data().begin(), frame->audio_data().end());\r
+ std::vector<int16_t> audio_data(frame->audio_data().begin(), frame->audio_data().end());\r
return make_safe<const read_frame>(std::move(key_data), std::move(audio_data));\r
}\r
\r
diag_->set_value("input-buffer", static_cast<float>(executor_.size())/static_cast<float>(executor_.capacity()));\r
frame_timer_.restart();\r
\r
- buffer_.push_back(std::make_pair(std::move(frame), get_key_frame(frame)));\r
+ buffer_.push_back(std::make_pair(frame, get_key_frame(frame)));\r
\r
if(!buffer_.full())\r
return;\r
\r
std::swap(draw_buffer_, write_buffer_);\r
});\r
-\r
- // While transferring do additional work which was queued during rendering.\r
- \r
+ \r
return std::move(result);\r
}\r
\r
\r
#include "read_frame.h"\r
\r
-#include <common/gl/gl_check.h>\r
+#include "gpu/host_buffer.h" \r
\r
namespace caspar { namespace core {\r
\r
*/\r
#pragma once\r
\r
-#include "gpu/host_buffer.h" \r
-\r
#include <common/memory/safe_ptr.h>\r
\r
#include <boost/noncopyable.hpp>\r
#include <boost/range/iterator_range.hpp>\r
-#include <boost/thread.hpp>\r
+#include <boost/thread/future.hpp>\r
\r
#include <memory>\r
#include <vector>\r
\r
namespace caspar { namespace core {\r
\r
+class host_buffer;\r
+\r
class read_frame : boost::noncopyable\r
{\r
read_frame(){}\r
#include "gpu/host_buffer.h"\r
#include "gpu/device_buffer.h"\r
\r
+#include <core/producer/frame/frame_visitor.h>\r
#include <core/producer/frame/pixel_format.h>\r
\r
-#include <common/gl/gl_check.h>\r
-\r
-#include <boost/range/algorithm.hpp>\r
-\r
namespace caspar { namespace core {\r
\r
struct write_frame::implementation : boost::noncopyable\r
#pragma once\r
\r
#include <common/memory/safe_ptr.h>\r
+\r
#include <core/producer/frame/basic_frame.h>\r
-#include <core/producer/frame/frame_visitor.h>\r
-#include <core/producer/frame/pixel_format.h>\r
\r
#include <boost/noncopyable.hpp>\r
#include <boost/range/iterator_range.hpp>\r
\r
class host_buffer;\r
class device_buffer;\r
+struct frame_visitor;\r
+struct pixel_format_desc;\r
\r
class write_frame : public core::basic_frame, boost::noncopyable\r
{\r