\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
+ audio_buffer 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, audio_buffer&& 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
auto ptr = static_cast<const uint8_t*>(image_data_->data());\r
return boost::iterator_range<const uint8_t*>(ptr, ptr + image_data_->size());\r
}\r
- const boost::iterator_range<const int16_t*> audio_data()\r
+ const boost::iterator_range<const int32_t*> audio_data()\r
{\r
- return boost::iterator_range<const int16_t*>(audio_data_.data(), audio_data_.data() + audio_data_.size());\r
+ return boost::iterator_range<const int32_t*>(audio_data_.data(), audio_data_.data() + audio_data_.size());\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, audio_buffer&& 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
return impl_ ? impl_->image_data() : boost::iterator_range<const uint8_t*>();\r
}\r
\r
-const boost::iterator_range<const int16_t*> read_frame::audio_data()\r
+const boost::iterator_range<const int32_t*> read_frame::audio_data()\r
{\r
- return impl_ ? impl_->audio_data() : boost::iterator_range<const int16_t*>();\r
+ return impl_ ? impl_->audio_data() : boost::iterator_range<const int32_t*>();\r
}\r
\r
size_t read_frame::image_size() const{return impl_ ? impl_->size_ : 0;}\r