+++ /dev/null
-/*\r
-* copyright (c) 2010 Sveriges Television AB <info@casparcg.com>\r
-*\r
-* This file is part of CasparCG.\r
-*\r
-* CasparCG is free software: you can redistribute it and/or modify\r
-* it under the terms of the GNU General Public License as published by\r
-* the Free Software Foundation, either version 3 of the License, or\r
-* (at your option) any later version.\r
-*\r
-* CasparCG is distributed in the hope that it will be useful,\r
-* but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
-* GNU General Public License for more details.\r
-\r
-* You should have received a copy of the GNU General Public License\r
-* along with CasparCG. If not, see <http://www.gnu.org/licenses/>.\r
-*\r
-*/\r
-#include "../../stdafx.h"\r
-\r
-#include "gpu_read_frame.h"\r
-\r
-#include "../gpu/host_buffer.h"\r
-\r
-#include <common/gl/gl_check.h>\r
-\r
-namespace caspar { namespace mixer {\r
- \r
-struct gpu_read_frame::implementation : boost::noncopyable\r
-{\r
- safe_ptr<const host_buffer> image_data_;\r
- std::vector<short> audio_data_;\r
-\r
-public:\r
- implementation(safe_ptr<const host_buffer>&& image_data, std::vector<short>&& audio_data) \r
- : image_data_(std::move(image_data))\r
- , audio_data_(std::move(audio_data)){} \r
-};\r
-\r
-gpu_read_frame::gpu_read_frame(safe_ptr<const host_buffer>&& image_data, std::vector<short>&& audio_data) : impl_(new implementation(std::move(image_data), std::move(audio_data))){}\r
-\r
-const boost::iterator_range<const unsigned char*> gpu_read_frame::image_data() const\r
-{\r
- if(!impl_->image_data_->data())\r
- return boost::iterator_range<const unsigned char*>();\r
- auto ptr = static_cast<const unsigned char*>(impl_->image_data_->data());\r
- return boost::iterator_range<const unsigned char*>(ptr, ptr + impl_->image_data_->size());\r
-}\r
-const boost::iterator_range<const short*> gpu_read_frame::audio_data() const\r
-{\r
- return boost::iterator_range<const short*>(impl_->audio_data_.data(), impl_->audio_data_.data() + impl_->audio_data_.size());\r
-}\r
-\r
-}}
\ No newline at end of file
+++ /dev/null
-/*\r
-* copyright (c) 2010 Sveriges Television AB <info@casparcg.com>\r
-*\r
-* This file is part of CasparCG.\r
-*\r
-* CasparCG is free software: you can redistribute it and/or modify\r
-* it under the terms of the GNU General Public License as published by\r
-* the Free Software Foundation, either version 3 of the License, or\r
-* (at your option) any later version.\r
-*\r
-* CasparCG is distributed in the hope that it will be useful,\r
-* but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
-* GNU General Public License for more details.\r
-\r
-* You should have received a copy of the GNU General Public License\r
-* along with CasparCG. If not, see <http://www.gnu.org/licenses/>.\r
-*\r
-*/\r
-#pragma once\r
-\r
-#include "../gpu/host_buffer.h" \r
-\r
-#include <core/consumer/frame/read_frame.h>\r
-\r
-#include <boost/noncopyable.hpp>\r
-#include <boost/range/iterator_range.hpp>\r
-\r
-#include <memory>\r
-#include <vector>\r
-\r
-#include <common/memory/safe_ptr.h>\r
-\r
-namespace caspar { namespace mixer {\r
- \r
-class gpu_read_frame : public core::read_frame\r
-{\r
-public:\r
- gpu_read_frame(safe_ptr<const host_buffer>&& image_data, std::vector<short>&& audio_data);\r
-\r
- const boost::iterator_range<const unsigned char*> image_data() const;\r
- const boost::iterator_range<const short*> audio_data() const;\r
- \r
-private:\r
- struct implementation;\r
- std::shared_ptr<implementation> impl_;\r
-};\r
-\r
-}}
\ No newline at end of file
+++ /dev/null
-/*\r
-* copyright (c) 2010 Sveriges Television AB <info@casparcg.com>\r
-*\r
-* This file is part of CasparCG.\r
-*\r
-* CasparCG is free software: you can redistribute it and/or modify\r
-* it under the terms of the GNU General Public License as published by\r
-* the Free Software Foundation, either version 3 of the License, or\r
-* (at your option) any later version.\r
-*\r
-* CasparCG is distributed in the hope that it will be useful,\r
-* but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
-* GNU General Public License for more details.\r
-\r
-* You should have received a copy of the GNU General Public License\r
-* along with CasparCG. If not, see <http://www.gnu.org/licenses/>.\r
-*\r
-*/\r
-#include "../../stdafx.h"\r
-\r
-#include "gpu_write_frame.h"\r
-\r
-#include <core/producer/frame/pixel_format.h>\r
-\r
-#include "../image/image_mixer.h"\r
-#include "../audio/audio_mixer.h"\r
-\r
-#include "../gpu/host_buffer.h"\r
-\r
-#include <common/gl/gl_check.h>\r
-\r
-#include <boost/range/algorithm.hpp>\r
-\r
-namespace caspar { namespace mixer {\r
- \r
-struct gpu_write_frame::implementation : boost::noncopyable\r
-{ \r
- std::vector<safe_ptr<host_buffer>> buffers_;\r
- std::vector<short> audio_data_;\r
- const core::pixel_format_desc desc_;\r
- int tag_;\r
-\r
-public:\r
- implementation(int tag, const core::pixel_format_desc& desc, const std::vector<safe_ptr<host_buffer>>& buffers) \r
- : desc_(desc)\r
- , buffers_(buffers)\r
- , tag_(tag){}\r
- \r
- void accept(gpu_write_frame& self, core::frame_visitor& visitor)\r
- {\r
- visitor.begin(self);\r
- visitor.visit(self);\r
- visitor.end();\r
- }\r
-\r
- boost::iterator_range<unsigned char*> image_data(size_t index)\r
- {\r
- if(index >= buffers_.size() || !buffers_[index]->data())\r
- return boost::iterator_range<const unsigned char*>();\r
- auto ptr = static_cast<unsigned char*>(buffers_[index]->data());\r
- return boost::iterator_range<unsigned char*>(ptr, ptr+buffers_[index]->size());\r
- }\r
-\r
- const boost::iterator_range<const unsigned char*> image_data(size_t index) const\r
- {\r
- if(index >= buffers_.size() || !buffers_[index]->data())\r
- return boost::iterator_range<const unsigned char*>();\r
- auto ptr = static_cast<const unsigned char*>(buffers_[index]->data());\r
- return boost::iterator_range<const unsigned char*>(ptr, ptr+buffers_[index]->size());\r
- }\r
-};\r
- \r
-gpu_write_frame::gpu_write_frame(int tag, const core::pixel_format_desc& desc, const std::vector<safe_ptr<host_buffer>>& buffers) : impl_(new implementation(tag, desc, buffers)){}\r
-void gpu_write_frame::accept(core::frame_visitor& visitor){impl_->accept(*this, visitor);}\r
-\r
-boost::iterator_range<unsigned char*> gpu_write_frame::image_data(size_t index){return impl_->image_data(index);}\r
-std::vector<short>& gpu_write_frame::audio_data() { return impl_->audio_data_; }\r
-const boost::iterator_range<const unsigned char*> gpu_write_frame::image_data(size_t index) const\r
-{\r
- return boost::iterator_range<const unsigned char*>(impl_->image_data(index).begin(), impl_->image_data(index).end());\r
-}\r
-const boost::iterator_range<const short*> gpu_write_frame::audio_data() const\r
-{\r
- return boost::iterator_range<const short*>(impl_->audio_data_.data(), impl_->audio_data_.data() + impl_->audio_data_.size());\r
-}\r
-int gpu_write_frame::tag() const {return impl_->tag_;}\r
-const core::pixel_format_desc& gpu_write_frame::get_pixel_format_desc() const{return impl_->desc_;}\r
-std::vector<safe_ptr<host_buffer>>& gpu_write_frame::get_plane_buffers(){return impl_->buffers_;}\r
-}}
\ No newline at end of file
+++ /dev/null
-/*\r
-* copyright (c) 2010 Sveriges Television AB <info@casparcg.com>\r
-*\r
-* This file is part of CasparCG.\r
-*\r
-* CasparCG is free software: you can redistribute it and/or modify\r
-* it under the terms of the GNU General Public License as published by\r
-* the Free Software Foundation, either version 3 of the License, or\r
-* (at your option) any later version.\r
-*\r
-* CasparCG is distributed in the hope that it will be useful,\r
-* but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
-* GNU General Public License for more details.\r
-\r
-* You should have received a copy of the GNU General Public License\r
-* along with CasparCG. If not, see <http://www.gnu.org/licenses/>.\r
-*\r
-*/\r
-#pragma once\r
-\r
-#include <common/memory/safe_ptr.h>\r
-#include <core/producer/frame/write_frame.h>\r
-#include <core/producer/frame/pixel_format.h>\r
-\r
-#include "../gpu/host_buffer.h"\r
-\r
-#include <boost/noncopyable.hpp>\r
-#include <boost/range/iterator_range.hpp>\r
-\r
-#include <memory>\r
-#include <vector>\r
-\r
-namespace caspar { namespace mixer {\r
- \r
-class gpu_write_frame : public core::write_frame\r
-{\r
-public: \r
- explicit gpu_write_frame(int tag, const core::pixel_format_desc& desc, const std::vector<safe_ptr<host_buffer>>& buffers);\r
-\r
- const core::pixel_format_desc& get_pixel_format_desc() const;\r
- std::vector<safe_ptr<host_buffer>>& get_plane_buffers();\r
- \r
- // core::write_frame\r
- virtual boost::iterator_range<unsigned char*> image_data(size_t plane_index = 0); \r
- virtual std::vector<short>& audio_data();\r
- \r
- virtual const boost::iterator_range<const unsigned char*> image_data(size_t plane_index = 0) const;\r
- virtual const boost::iterator_range<const short*> audio_data() const;\r
-\r
- virtual void accept(core::frame_visitor& visitor);\r
-\r
- virtual int tag() const;\r
- \r
-private:\r
- struct implementation;\r
- std::shared_ptr<implementation> impl_;\r
-};\r
-typedef std::shared_ptr<gpu_write_frame> gpu_write_frame_impl_ptr;\r
-\r
-\r
-}}
\ No newline at end of file
+++ /dev/null
-/*\r
-* copyright (c) 2010 Sveriges Television AB <info@casparcg.com>\r
-*\r
-* This file is part of CasparCG.\r
-*\r
-* CasparCG is free software: you can redistribute it and/or modify\r
-* it under the terms of the GNU General Public License as published by\r
-* the Free Software Foundation, either version 3 of the License, or\r
-* (at your option) any later version.\r
-*\r
-* CasparCG is distributed in the hope that it will be useful,\r
-* but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
-* GNU General Public License for more details.\r
-\r
-* You should have received a copy of the GNU General Public License\r
-* along with CasparCG. If not, see <http://www.gnu.org/licenses/>.\r
-*\r
-*/\r
-#pragma once\r
-\r
-#include "basic_frame.h"\r
-\r
-#include "../../video_format.h"\r
-\r
-#include <boost/noncopyable.hpp>\r
-#include <boost/range/iterator_range.hpp>\r
-\r
-#include <memory>\r
-#include <vector>\r
-\r
-namespace caspar { namespace core {\r
- \r
-class write_frame : public basic_frame, boost::noncopyable\r
-{\r
-public: \r
- virtual boost::iterator_range<unsigned char*> image_data(size_t plane_index = 0) = 0;\r
- virtual std::vector<short>& audio_data() = 0;\r
- \r
- virtual const boost::iterator_range<const unsigned char*> image_data(size_t plane_index = 0) const = 0;\r
- virtual const boost::iterator_range<const short*> audio_data() const = 0;\r
-\r
- virtual void accept(frame_visitor& visitor) = 0;\r
-\r
- virtual int tag() const = 0; // Tag which identifies current video-stream.\r
-};\r
-\r
-}}
\ No newline at end of file