ogl_device* ogl_;\r
std::vector<std::shared_ptr<host_buffer>> buffers_;\r
std::vector<safe_ptr<device_buffer>> textures_;\r
- std::vector<int16_t> audio_data_;\r
+ audio_buffer audio_data_;\r
const core::pixel_format_desc desc_;\r
const void* tag_;\r
- core::video_mode::type mode_;\r
+ core::field_mode::type mode_;\r
\r
implementation(const void* tag)\r
: tag_(tag)\r
: ogl_(&ogl)\r
, desc_(desc)\r
, tag_(tag)\r
- , mode_(core::video_mode::progressive)\r
+ , mode_(core::field_mode::progressive)\r
{\r
ogl_->invoke([&]\r
{\r
\r
ogl_->begin_invoke([=]\r
{ \r
- texture->read(*buffer);\r
+ buffer->unmap();\r
+ buffer->bind();\r
+ texture->begin_read();\r
+ buffer->unbind();\r
}, high_priority);\r
}\r
\r
write_frame::write_frame(ogl_device& ogl, const void* tag, const core::pixel_format_desc& desc) \r
: impl_(new implementation(ogl, tag, desc)){}\r
write_frame::write_frame(const write_frame& other) : impl_(new implementation(*other.impl_)){}\r
-void write_frame::accept(core::frame_visitor& visitor){impl_->accept(*this, visitor);}\r
+write_frame::write_frame(write_frame&& other) : impl_(std::move(*other.impl_)){}\r
+write_frame& write_frame::operator=(const write_frame& other)\r
+{\r
+ basic_frame temp(other);\r
+ temp.swap(*this);\r
+ return *this;\r
+}\r
+write_frame& write_frame::operator=(write_frame&& other)\r
+{\r
+ write_frame temp(std::move(other));\r
+ temp.swap(*this);\r
+ return *this;\r
+}\r
+void write_frame::swap(write_frame& other){impl_.swap(other.impl_);}\r
\r
boost::iterator_range<uint8_t*> write_frame::image_data(size_t index){return impl_->image_data(index);}\r
-std::vector<int16_t>& write_frame::audio_data() { return impl_->audio_data_; }\r
+audio_buffer& write_frame::audio_data() { return impl_->audio_data_; }\r
const boost::iterator_range<const uint8_t*> write_frame::image_data(size_t index) const\r
{\r
return boost::iterator_range<const uint8_t*>(impl_->image_data(index).begin(), impl_->image_data(index).end());\r
}\r
-const boost::iterator_range<const int16_t*> write_frame::audio_data() const\r
+const boost::iterator_range<const int32_t*> write_frame::audio_data() const\r
{\r
- return boost::iterator_range<const int16_t*>(impl_->audio_data_.data(), impl_->audio_data_.data() + impl_->audio_data_.size());\r
+ return boost::iterator_range<const int32_t*>(impl_->audio_data_.data(), impl_->audio_data_.data() + impl_->audio_data_.size());\r
}\r
const void* write_frame::tag() const {return impl_->tag_;}\r
const core::pixel_format_desc& write_frame::get_pixel_format_desc() const{return impl_->desc_;}\r
const std::vector<safe_ptr<device_buffer>>& write_frame::get_textures() const{return impl_->textures_;}\r
void write_frame::commit(size_t plane_index){impl_->commit(plane_index);}\r
void write_frame::commit(){impl_->commit();}\r
-void write_frame::set_type(const video_mode::type& mode){impl_->mode_ = mode;}\r
-core::video_mode::type write_frame::get_type() const{return impl_->mode_;}\r
+void write_frame::set_type(const field_mode::type& mode){impl_->mode_ = mode;}\r
+core::field_mode::type write_frame::get_type() const{return impl_->mode_;}\r
+\r
std::wstring write_frame::print() const{return impl_->print();}\r
+void write_frame::accept(core::frame_visitor& visitor){impl_->accept(*this, visitor);}\r
\r
}}
\ No newline at end of file