[&]{image = mix_image(frames);}, \r
[&]{audio = mix_audio(frames);});\r
\r
- return make_safe<read_frame>(channel_.ogl(), channel_.get_format_desc().size, std::move(image), std::move(audio));\r
+ return make_safe<read_frame>(channel_.ogl(), channel_.get_format_desc().size, std::move(image.get()), std::move(audio));\r
}\r
catch(...)\r
{\r
\r
struct read_frame::implementation : boost::noncopyable\r
{\r
- ogl_device& ogl_;\r
- size_t size_;\r
- boost::unique_future<safe_ptr<host_buffer>> future_image_data_;\r
- std::shared_ptr<host_buffer> image_data_;\r
- tbb::mutex mutex_;\r
- std::vector<int16_t> audio_data_;\r
+ ogl_device& ogl_;\r
+ size_t size_;\r
+ safe_ptr<host_buffer> image_data_;\r
+ tbb::mutex mutex_;\r
+ std::vector<int16_t> audio_data_;\r
\r
public:\r
- implementation(ogl_device& ogl, size_t size, boost::unique_future<safe_ptr<host_buffer>>&& image_data, std::vector<int16_t>&& audio_data) \r
+ implementation(ogl_device& ogl, size_t size, safe_ptr<host_buffer>&& image_data, std::vector<int16_t>&& audio_data) \r
: ogl_(ogl)\r
, size_(size)\r
- , future_image_data_(std::move(image_data))\r
+ , image_data_(std::move(image_data))\r
, audio_data_(std::move(audio_data)){} \r
\r
const boost::iterator_range<const uint8_t*> image_data()\r
{\r
tbb::mutex::scoped_lock lock(mutex_);\r
\r
- if(!image_data_)\r
+ if(!image_data_->data())\r
{\r
- image_data_ = future_image_data_.get();\r
image_data_.get()->wait(ogl_);\r
ogl_.invoke([=]{image_data_.get()->map();}, high_priority);\r
}\r
}\r
};\r
\r
-read_frame::read_frame(ogl_device& ogl, size_t size, boost::unique_future<safe_ptr<host_buffer>>&& image_data, std::vector<int16_t>&& audio_data) \r
+read_frame::read_frame(ogl_device& ogl, size_t size, safe_ptr<host_buffer>&& image_data, std::vector<int16_t>&& audio_data) \r
: impl_(new implementation(ogl, size, std::move(image_data), std::move(audio_data))){}\r
read_frame::read_frame(){}\r
const boost::iterator_range<const uint8_t*> read_frame::image_data()\r
\r
#include <boost/noncopyable.hpp>\r
#include <boost/range/iterator_range.hpp>\r
-#include <boost/thread/future.hpp>\r
\r
#include <cstdint>\r
#include <memory>\r
{\r
public:\r
read_frame();\r
- read_frame(ogl_device& ogl, size_t size, boost::unique_future<safe_ptr<host_buffer>>&& image_data, std::vector<int16_t>&& audio_data);\r
+ read_frame(ogl_device& ogl, size_t size, safe_ptr<host_buffer>&& image_data, std::vector<int16_t>&& audio_data);\r
\r
virtual const boost::iterator_range<const uint8_t*> image_data();\r
virtual const boost::iterator_range<const int16_t*> audio_data();\r