#include "mixer/frame_mixer_device.h"\r
#include "producer/frame_producer_device.h"\r
\r
-#include "mixer/frame/draw_frame.h"\r
+#include "mixer/frame/basic_frame.h"\r
#include "mixer/frame_mixer_device.h"\r
\r
#include "producer/layer.h"\r
, producer_(new frame_producer_device(std::bind(&implementation::print, this), safe_ptr<frame_factory>(mixer_))) \r
{\r
mixer_connection_ = mixer_->connect([=](const safe_ptr<const read_frame>& frame){consumer_->send(frame);});\r
- producer_connection_ = producer_->connect([=](const std::vector<safe_ptr<draw_frame>>& frames){mixer_->send(frames);});\r
+ producer_connection_ = producer_->connect([=](const std::vector<safe_ptr<basic_frame>>& frames){mixer_->send(frames);});\r
}\r
\r
std::wstring print() const\r
\r
namespace caspar { namespace core {\r
\r
-class draw_frame;\r
+class basic_frame;\r
struct video_format_desc;\r
\r
class frame_consumer_device : boost::noncopyable\r
\r
class color_producer : public frame_producer\r
{\r
- safe_ptr<draw_frame> frame_;\r
+ safe_ptr<basic_frame> frame_;\r
std::wstring color_str_;\r
printer parent_printer_;\r
\r
\r
explicit color_producer(const std::wstring& color) \r
: color_str_(color)\r
- , frame_(draw_frame::empty())\r
+ , frame_(basic_frame::empty())\r
{\r
if(color.length() != 9 || color[0] != '#')\r
BOOST_THROW_EXCEPTION(invalid_argument() << arg_name_info("color") << arg_value_info(narrow(color)) << msg_info("Invalid color code"));\r
\r
virtual void set_parent_printer(const printer& parent_printer){parent_printer_ = parent_printer;}\r
\r
- virtual safe_ptr<draw_frame> receive() { return frame_; }\r
+ virtual safe_ptr<basic_frame> receive() { return frame_; }\r
\r
virtual std::wstring print() const { return (parent_printer_ ? parent_printer_() + L"/" : L"") + L"color[" + color_str_ + L"]"; }\r
};\r
#include <common/memory/safe_ptr.h>\r
#include <common/utility/printer.h>\r
\r
-#include <mixer/frame/draw_frame.h>\r
+#include <mixer/frame/basic_frame.h>\r
#include <mixer/frame/frame_factory.h>\r
\r
#include <boost/noncopyable.hpp>\r
virtual ~frame_producer(){} \r
\r
////////////////////////////////////////////////////////////////////////////////////////////////////\r
- /// \fn virtual draw_frame :::receive() = 0;\r
+ /// \fn virtual basic_frame :::receive() = 0;\r
///\r
/// \brief Renders a frame.\r
/// \r
///\r
/// \return The frame. \r
////////////////////////////////////////////////////////////////////////////////////////////////////\r
- virtual safe_ptr<draw_frame> receive() = 0;\r
+ virtual safe_ptr<basic_frame> receive() = 0;\r
\r
////////////////////////////////////////////////////////////////////////////////////////////////////\r
/// \fn virtual std::shared_ptr<frame_producer> :::get_following_producer() const\r
{\r
struct empty_frame_producer : public frame_producer\r
{\r
- virtual safe_ptr<draw_frame> receive(){return draw_frame::empty();}\r
+ virtual safe_ptr<basic_frame> receive(){return basic_frame::empty();}\r
virtual void initialize(const safe_ptr<frame_factory>&){}\r
virtual std::wstring print() const { return L"empty";}\r
virtual void set_parent_printer(const printer& parent_printer) {}\r
\r
#include "frame_producer_device.h"\r
\r
-#include <mixer/frame/draw_frame.h>\r
+#include <mixer/frame/basic_frame.h>\r
#include <mixer/frame/frame_factory.h>\r
\r
#include "layer.h"\r
return it->second;\r
}\r
\r
- std::vector<safe_ptr<draw_frame>> draw()\r
+ std::vector<safe_ptr<basic_frame>> draw()\r
{ \r
- std::vector<safe_ptr<draw_frame>> frames(layers_.size(), draw_frame::empty());\r
+ std::vector<safe_ptr<basic_frame>> frames(layers_.size(), basic_frame::empty());\r
tbb::parallel_for(tbb::blocked_range<size_t>(0, frames.size(), 1), [&](const tbb::blocked_range<size_t>& r)\r
{\r
auto it = layers_.begin();\r
frames[i]->set_layer_index(it->first);\r
}\r
}); \r
- boost::range::remove_erase(frames, draw_frame::empty());\r
+ boost::range::remove_erase(frames, basic_frame::empty());\r
return frames;\r
}\r
\r
class frame_producer_device : boost::noncopyable\r
{\r
public:\r
- typedef boost::signals2::signal<void(const std::vector<safe_ptr<draw_frame>>&)> output_t;\r
+ typedef boost::signals2::signal<void(const std::vector<safe_ptr<basic_frame>>&)> output_t;\r
\r
boost::signals2::connection connect(const output_t::slot_type& subscriber);\r
\r
#include <common/utility/assert.h>\r
#include <common/utility/printer.h>\r
\r
-#include <mixer/frame/draw_frame.h>\r
+#include <mixer/frame/basic_frame.h>\r
#include <mixer/image/image_mixer.h>\r
#include <mixer/audio/audio_mixer.h>\r
#include <mixer/audio/audio_transform.h>\r
\r
safe_ptr<frame_producer> foreground_;\r
safe_ptr<frame_producer> background_;\r
- safe_ptr<draw_frame> last_frame_;\r
+ safe_ptr<basic_frame> last_frame_;\r
bool is_paused_;\r
public:\r
implementation(int index, const printer& parent_printer) \r
, index_(index)\r
, foreground_(frame_producer::empty())\r
, background_(frame_producer::empty())\r
- , last_frame_(draw_frame::empty())\r
+ , last_frame_(basic_frame::empty())\r
, is_paused_(false){}\r
\r
void load(const safe_ptr<frame_producer>& frame_producer, bool play_on_load, bool preview)\r
void stop()\r
{\r
pause();\r
- last_frame_ = draw_frame::empty();\r
+ last_frame_ = basic_frame::empty();\r
foreground_ = frame_producer::empty();\r
}\r
\r
- safe_ptr<draw_frame> receive()\r
+ safe_ptr<basic_frame> receive()\r
{ \r
if(is_paused_)\r
{\r
try\r
{\r
last_frame_ = foreground_->receive(); \r
- if(last_frame_ == draw_frame::eof())\r
+ if(last_frame_ == basic_frame::eof())\r
{\r
CASPAR_VERIFY(foreground_ != frame_producer::empty());\r
\r
void layer::play(){impl_->play();}\r
void layer::pause(){impl_->pause();}\r
void layer::stop(){impl_->stop();}\r
-safe_ptr<draw_frame> layer::receive() {return impl_->receive();}\r
+safe_ptr<basic_frame> layer::receive() {return impl_->receive();}\r
safe_ptr<frame_producer> layer::foreground() const { return impl_->foreground_;}\r
safe_ptr<frame_producer> layer::background() const { return impl_->background_;}\r
std::wstring layer::print() const { return impl_->print();}\r
namespace caspar { namespace core {\r
\r
class frame_producer;\r
-class draw_frame;\r
+class basic_frame;\r
\r
class layer : boost::noncopyable\r
{\r
safe_ptr<frame_producer> foreground() const; // nothrow\r
safe_ptr<frame_producer> background() const; // nothrow\r
\r
- safe_ptr<draw_frame> receive(); // nothrow\r
+ safe_ptr<basic_frame> receive(); // nothrow\r
\r
std::wstring print() const;\r
private:\r
\r
#include <core/video_format.h>\r
\r
-#include <mixer/frame/draw_frame.h>\r
+#include <mixer/frame/basic_frame.h>\r
#include <mixer/image/image_transform.h>\r
#include <mixer/audio/audio_mixer.h>\r
#include <mixer/audio/audio_transform.h>\r
std::shared_ptr<frame_factory> frame_factory_;\r
video_format_desc format_desc_;\r
\r
- std::vector<safe_ptr<draw_frame>> frame_buffer_;\r
+ std::vector<safe_ptr<basic_frame>> frame_buffer_;\r
\r
implementation(const safe_ptr<frame_producer>& dest, const transition_info& info) \r
: current_frame_(0)\r
, source_producer_(frame_producer::empty())\r
{\r
dest_producer_->set_parent_printer(std::bind(&implementation::dest_print, this));\r
- frame_buffer_.push_back(draw_frame::empty());\r
+ frame_buffer_.push_back(basic_frame::empty());\r
}\r
\r
void initialize(const safe_ptr<frame_factory>& frame_factory)\r
source_producer_->set_parent_printer(std::bind(&implementation::source_print, this));\r
}\r
\r
- safe_ptr<draw_frame> receive()\r
+ safe_ptr<basic_frame> receive()\r
{\r
if(current_frame_++ >= info_.duration)\r
- return draw_frame::eof();\r
+ return basic_frame::eof();\r
\r
- auto source = draw_frame::empty();\r
- auto dest = draw_frame::empty();\r
+ auto source = basic_frame::empty();\r
+ auto dest = basic_frame::empty();\r
\r
tbb::parallel_invoke\r
(\r
return compose(dest, source);\r
}\r
\r
- safe_ptr<draw_frame> render_sub_frame(safe_ptr<frame_producer>& producer)\r
+ safe_ptr<basic_frame> render_sub_frame(safe_ptr<frame_producer>& producer)\r
{\r
if(producer == frame_producer::empty())\r
- return draw_frame::eof();\r
+ return basic_frame::eof();\r
\r
- auto frame = draw_frame::eof();\r
+ auto frame = basic_frame::eof();\r
try\r
{\r
frame = producer->receive();\r
CASPAR_LOG(warning) << print() << " Failed to receive frame. Removed producer from transition.";\r
}\r
\r
- if(frame == draw_frame::eof())\r
+ if(frame == basic_frame::eof())\r
{\r
try\r
{\r
return frame;\r
}\r
\r
- safe_ptr<draw_frame> compose(const safe_ptr<draw_frame>& dest_frame, const safe_ptr<draw_frame>& src_frame) \r
+ safe_ptr<basic_frame> compose(const safe_ptr<basic_frame>& dest_frame, const safe_ptr<basic_frame>& src_frame) \r
{ \r
- if(dest_frame == draw_frame::eof() && src_frame == draw_frame::eof())\r
- return draw_frame::eof();\r
+ if(dest_frame == basic_frame::eof() && src_frame == basic_frame::eof())\r
+ return basic_frame::eof();\r
\r
if(info_.type == transition::cut) \r
- return src_frame != draw_frame::eof() ? src_frame : draw_frame::empty();\r
+ return src_frame != basic_frame::eof() ? src_frame : basic_frame::empty();\r
\r
double alpha = static_cast<double>(current_frame_)/static_cast<double>(info_.duration);\r
double half_alpha_step = 0.5*1.0/static_cast<double>(info_.duration);\r
\r
// For interlaced transitions. Seperate fields into seperate frames which are transitioned accordingly.\r
\r
- auto s_frame1 = make_safe<draw_frame>(src_frame);\r
- auto s_frame2 = make_safe<draw_frame>(src_frame);\r
+ auto s_frame1 = make_safe<basic_frame>(src_frame);\r
+ auto s_frame2 = make_safe<basic_frame>(src_frame);\r
\r
s_frame1->get_audio_transform().set_has_audio(false);\r
s_frame2->get_audio_transform().set_gain(1.0-alpha);\r
\r
- auto d_frame1 = make_safe<draw_frame>(dest_frame);\r
- auto d_frame2 = make_safe<draw_frame>(dest_frame);\r
+ auto d_frame1 = make_safe<basic_frame>(dest_frame);\r
+ auto d_frame2 = make_safe<basic_frame>(dest_frame);\r
\r
d_frame1->get_audio_transform().set_has_audio(false);\r
d_frame2->get_audio_transform().set_gain(alpha);\r
d_frame2->get_image_transform().set_key_scale(alpha, 1.0); \r
}\r
\r
- auto s_frame = s_frame1->get_image_transform() == s_frame2->get_image_transform() ? s_frame2 : draw_frame::interlace(s_frame1, s_frame2, format_desc_.mode);\r
- auto d_frame = draw_frame::interlace(d_frame1, d_frame2, format_desc_.mode);\r
+ auto s_frame = s_frame1->get_image_transform() == s_frame2->get_image_transform() ? s_frame2 : basic_frame::interlace(s_frame1, s_frame2, format_desc_.mode);\r
+ auto d_frame = basic_frame::interlace(d_frame1, d_frame2, format_desc_.mode);\r
\r
- return draw_frame(s_frame, d_frame);\r
+ return basic_frame(s_frame, d_frame);\r
}\r
\r
std::wstring print() const\r
\r
transition_producer::transition_producer(transition_producer&& other) : impl_(std::move(other.impl_)){}\r
transition_producer::transition_producer(const safe_ptr<frame_producer>& dest, const transition_info& info) : impl_(new implementation(dest, info)){}\r
-safe_ptr<draw_frame> transition_producer::receive(){return impl_->receive();}\r
+safe_ptr<basic_frame> transition_producer::receive(){return impl_->receive();}\r
safe_ptr<frame_producer> transition_producer::get_following_producer() const{return impl_->get_following_producer();}\r
void transition_producer::set_leading_producer(const safe_ptr<frame_producer>& producer) { impl_->set_leading_producer(producer); }\r
void transition_producer::initialize(const safe_ptr<frame_factory>& frame_factory) { impl_->initialize(frame_factory);}\r
explicit transition_producer(const safe_ptr<frame_producer>& destination, const transition_info& info);\r
transition_producer(transition_producer&& other);\r
\r
- virtual safe_ptr<draw_frame> receive();\r
+ virtual safe_ptr<basic_frame> receive();\r
\r
virtual safe_ptr<frame_producer> get_following_producer() const;\r
virtual void set_leading_producer(const safe_ptr<frame_producer>& producer);\r
#include "audio_mixer.h"\r
#include "audio_transform.h"\r
\r
-#include "../frame/draw_frame.h"\r
+#include "../frame/basic_frame.h"\r
#include "../frame/write_frame.h"\r
\r
namespace caspar { namespace core {\r
transform_stack_.push(audio_transform());\r
}\r
\r
- void begin(const draw_frame& frame)\r
+ void begin(const basic_frame& frame)\r
{\r
transform_stack_.push(transform_stack_.top()*frame.get_audio_transform());\r
}\r
};\r
\r
audio_mixer::audio_mixer() : impl_(new implementation()){}\r
-void audio_mixer::begin(const draw_frame& frame){impl_->begin(frame);}\r
+void audio_mixer::begin(const basic_frame& frame){impl_->begin(frame);}\r
void audio_mixer::visit(write_frame& frame){impl_->visit(frame);}\r
void audio_mixer::end(){impl_->end();}\r
std::vector<short> audio_mixer::begin_pass(){return impl_->begin_pass();} \r
public:\r
audio_mixer();\r
\r
- virtual void begin(const draw_frame& frame);\r
+ virtual void begin(const basic_frame& frame);\r
virtual void visit(write_frame& frame);\r
virtual void end();\r
\r
--- /dev/null
+#include "../stdafx.h"\r
+\r
+#include "basic_frame.h"\r
+\r
+#include "../image/image_transform.h"\r
+#include "../image/image_mixer.h"\r
+#include "../audio/audio_mixer.h"\r
+#include "../audio/audio_transform.h"\r
+#include "pixel_format.h"\r
+\r
+#include <core/video_format.h>\r
+\r
+#include <boost/range/algorithm.hpp>\r
+\r
+namespace caspar { namespace core {\r
+ \r
+struct basic_frame::implementation\r
+{ \r
+ std::vector<safe_ptr<basic_frame>> frames_;\r
+\r
+ image_transform image_transform_; \r
+ audio_transform audio_transform_;\r
+\r
+ int index_;\r
+\r
+public:\r
+ implementation(const std::vector<safe_ptr<basic_frame>>& frames) \r
+ : frames_(frames)\r
+ , index_(std::numeric_limits<int>::min()) {}\r
+ implementation(std::vector<safe_ptr<basic_frame>>&& frames) \r
+ : frames_(std::move(frames))\r
+ , index_(std::numeric_limits<int>::min()) {}\r
+ \r
+ void accept(basic_frame& self, frame_visitor& visitor)\r
+ {\r
+ visitor.begin(self);\r
+ BOOST_FOREACH(auto frame, frames_)\r
+ frame->accept(visitor);\r
+ visitor.end();\r
+ } \r
+};\r
+ \r
+basic_frame::basic_frame() : impl_(new implementation(std::vector<safe_ptr<basic_frame>>())){}\r
+basic_frame::basic_frame(const std::vector<safe_ptr<basic_frame>>& frames) : impl_(new implementation(frames)){}\r
+basic_frame::basic_frame(std::vector<safe_ptr<basic_frame>>&& frames) : impl_(new implementation(std::move(frames))){}\r
+basic_frame::basic_frame(const basic_frame& other) : impl_(new implementation(*other.impl_)){}\r
+basic_frame::basic_frame(const safe_ptr<basic_frame>& frame)\r
+{\r
+ std::vector<safe_ptr<basic_frame>> frames;\r
+ frames.push_back(frame);\r
+ impl_.reset(new implementation(std::move(frames)));\r
+}\r
+basic_frame::basic_frame(safe_ptr<basic_frame>&& frame)\r
+{\r
+ std::vector<safe_ptr<basic_frame>> frames;\r
+ frames.push_back(std::move(frame));\r
+ impl_.reset(new implementation(std::move(frames)));\r
+}\r
+basic_frame::basic_frame(const safe_ptr<basic_frame>& frame1, const safe_ptr<basic_frame>& frame2)\r
+{\r
+ std::vector<safe_ptr<basic_frame>> frames;\r
+ frames.push_back(frame1);\r
+ frames.push_back(frame2);\r
+ impl_.reset(new implementation(std::move(frames)));\r
+}\r
+basic_frame::basic_frame(safe_ptr<basic_frame>&& frame1, safe_ptr<basic_frame>&& frame2)\r
+{\r
+ std::vector<safe_ptr<basic_frame>> frames;\r
+ frames.push_back(std::move(frame1));\r
+ frames.push_back(std::move(frame2));\r
+ impl_.reset(new implementation(std::move(frames)));\r
+}\r
+\r
+void basic_frame::swap(basic_frame& other){impl_.swap(other.impl_);}\r
+basic_frame& basic_frame::operator=(const basic_frame& other)\r
+{\r
+ basic_frame temp(other);\r
+ temp.swap(*this);\r
+ return *this;\r
+}\r
+basic_frame::basic_frame(basic_frame&& other) : impl_(std::move(other.impl_)){}\r
+basic_frame& basic_frame::operator=(basic_frame&& other)\r
+{\r
+ basic_frame temp(std::move(other));\r
+ temp.swap(*this);\r
+ return *this;\r
+}\r
+void basic_frame::accept(frame_visitor& visitor){impl_->accept(*this, visitor);}\r
+\r
+const image_transform& basic_frame::get_image_transform() const { return impl_->image_transform_;}\r
+image_transform& basic_frame::get_image_transform() { return impl_->image_transform_;}\r
+const audio_transform& basic_frame::get_audio_transform() const { return impl_->audio_transform_;}\r
+audio_transform& basic_frame::get_audio_transform() { return impl_->audio_transform_;}\r
+\r
+safe_ptr<basic_frame> basic_frame::interlace(const safe_ptr<basic_frame>& frame1, const safe_ptr<basic_frame>& frame2, video_mode::type mode)\r
+{ \r
+ if(frame1 == frame2 || mode == video_mode::progressive)\r
+ return frame2;\r
+\r
+ auto my_frame1 = make_safe<basic_frame>(frame1);\r
+ auto my_frame2 = make_safe<basic_frame>(frame2);\r
+ if(mode == video_mode::upper)\r
+ {\r
+ my_frame1->get_image_transform().set_mode(video_mode::upper); \r
+ my_frame2->get_image_transform().set_mode(video_mode::lower); \r
+ } \r
+ else \r
+ { \r
+ my_frame1->get_image_transform().set_mode(video_mode::lower); \r
+ my_frame2->get_image_transform().set_mode(video_mode::upper); \r
+ }\r
+\r
+ std::vector<safe_ptr<basic_frame>> frames;\r
+ frames.push_back(my_frame1);\r
+ frames.push_back(my_frame2);\r
+ return make_safe<basic_frame>(frames);\r
+}\r
+\r
+void basic_frame::set_layer_index(int index) { impl_->index_ = index; }\r
+int basic_frame::get_layer_index() const { return impl_->index_; }\r
+std::vector<safe_ptr<basic_frame>> basic_frame::get_children(){return impl_->frames_;}\r
+ \r
+}}
\ No newline at end of file
--- /dev/null
+#pragma once\r
+\r
+#include "../fwd.h"\r
+\r
+#include "frame_visitor.h"\r
+\r
+#include <common/memory/safe_ptr.h>\r
+#include <core/video_format.h>\r
+\r
+#include <boost/noncopyable.hpp>\r
+#include <boost/range/iterator_range.hpp>\r
+\r
+#include <memory>\r
+#include <array>\r
+#include <vector>\r
+\r
+namespace caspar { namespace core {\r
+\r
+class image_transform;\r
+class audio_transform;\r
+ \r
+class basic_frame\r
+{\r
+public:\r
+ basic_frame(); \r
+ basic_frame(safe_ptr<write_frame>&& image, std::vector<short>&& audio);\r
+ basic_frame(const safe_ptr<basic_frame>& frame);\r
+ basic_frame(safe_ptr<basic_frame>&& frame);\r
+ basic_frame(const std::vector<safe_ptr<basic_frame>>& frames);\r
+ basic_frame(std::vector<safe_ptr<basic_frame>>&& frame);\r
+ basic_frame(const safe_ptr<basic_frame>& frame1, const safe_ptr<basic_frame>& frame2);\r
+ basic_frame(safe_ptr<basic_frame>&& frame1, safe_ptr<basic_frame>&& frame2);\r
+\r
+ void swap(basic_frame& other);\r
+ \r
+ basic_frame(const basic_frame& other);\r
+ basic_frame(basic_frame&& other);\r
+\r
+ basic_frame& operator=(const basic_frame& other);\r
+ basic_frame& operator=(basic_frame&& other);\r
+ \r
+ const image_transform& get_image_transform() const;\r
+ image_transform& get_image_transform();\r
+\r
+ const audio_transform& get_audio_transform() const;\r
+ audio_transform& get_audio_transform();\r
+ \r
+ static safe_ptr<basic_frame> interlace(const safe_ptr<basic_frame>& frame1, const safe_ptr<basic_frame>& frame2, video_mode::type mode);\r
+ \r
+ static const safe_ptr<basic_frame>& eof()\r
+ {\r
+ struct eof_frame : public basic_frame{};\r
+ static safe_ptr<basic_frame> frame = make_safe<eof_frame>();\r
+ return frame;\r
+ }\r
+\r
+ static const safe_ptr<basic_frame>& empty()\r
+ {\r
+ struct empty_frame : public basic_frame{};\r
+ static safe_ptr<basic_frame> frame = make_safe<empty_frame>();\r
+ return frame;\r
+ }\r
+\r
+ void remove_audio();\r
+ void remove_image();\r
+\r
+ virtual void accept(frame_visitor& visitor);\r
+\r
+ void set_layer_index(int index);\r
+ int get_layer_index() const;\r
+\r
+ std::vector<safe_ptr<basic_frame>> get_children();\r
+private:\r
+ struct implementation;\r
+ std::shared_ptr<implementation> impl_;\r
+};\r
+\r
+}}
\ No newline at end of file
+++ /dev/null
-#include "../stdafx.h"\r
-\r
-#include "draw_frame.h"\r
-\r
-#include "../image/image_transform.h"\r
-#include "../image/image_mixer.h"\r
-#include "../audio/audio_mixer.h"\r
-#include "../audio/audio_transform.h"\r
-#include "pixel_format.h"\r
-\r
-#include <core/video_format.h>\r
-\r
-#include <boost/range/algorithm.hpp>\r
-\r
-namespace caspar { namespace core {\r
- \r
-struct draw_frame::implementation\r
-{ \r
- std::vector<safe_ptr<draw_frame>> frames_;\r
-\r
- image_transform image_transform_; \r
- audio_transform audio_transform_;\r
-\r
- int index_;\r
-\r
-public:\r
- implementation(const std::vector<safe_ptr<draw_frame>>& frames) \r
- : frames_(frames)\r
- , index_(std::numeric_limits<int>::min()) {}\r
- implementation(std::vector<safe_ptr<draw_frame>>&& frames) \r
- : frames_(std::move(frames))\r
- , index_(std::numeric_limits<int>::min()) {}\r
- \r
- void accept(draw_frame& self, frame_visitor& visitor)\r
- {\r
- visitor.begin(self);\r
- BOOST_FOREACH(auto frame, frames_)\r
- frame->accept(visitor);\r
- visitor.end();\r
- } \r
-};\r
- \r
-draw_frame::draw_frame() : impl_(new implementation(std::vector<safe_ptr<draw_frame>>())){}\r
-draw_frame::draw_frame(const std::vector<safe_ptr<draw_frame>>& frames) : impl_(new implementation(frames)){}\r
-draw_frame::draw_frame(std::vector<safe_ptr<draw_frame>>&& frames) : impl_(new implementation(std::move(frames))){}\r
-draw_frame::draw_frame(const draw_frame& other) : impl_(new implementation(*other.impl_)){}\r
-draw_frame::draw_frame(const safe_ptr<draw_frame>& frame)\r
-{\r
- std::vector<safe_ptr<draw_frame>> frames;\r
- frames.push_back(frame);\r
- impl_.reset(new implementation(std::move(frames)));\r
-}\r
-draw_frame::draw_frame(safe_ptr<draw_frame>&& frame)\r
-{\r
- std::vector<safe_ptr<draw_frame>> frames;\r
- frames.push_back(std::move(frame));\r
- impl_.reset(new implementation(std::move(frames)));\r
-}\r
-draw_frame::draw_frame(const safe_ptr<draw_frame>& frame1, const safe_ptr<draw_frame>& frame2)\r
-{\r
- std::vector<safe_ptr<draw_frame>> frames;\r
- frames.push_back(frame1);\r
- frames.push_back(frame2);\r
- impl_.reset(new implementation(std::move(frames)));\r
-}\r
-draw_frame::draw_frame(safe_ptr<draw_frame>&& frame1, safe_ptr<draw_frame>&& frame2)\r
-{\r
- std::vector<safe_ptr<draw_frame>> frames;\r
- frames.push_back(std::move(frame1));\r
- frames.push_back(std::move(frame2));\r
- impl_.reset(new implementation(std::move(frames)));\r
-}\r
-\r
-void draw_frame::swap(draw_frame& other){impl_.swap(other.impl_);}\r
-draw_frame& draw_frame::operator=(const draw_frame& other)\r
-{\r
- draw_frame temp(other);\r
- temp.swap(*this);\r
- return *this;\r
-}\r
-draw_frame::draw_frame(draw_frame&& other) : impl_(std::move(other.impl_)){}\r
-draw_frame& draw_frame::operator=(draw_frame&& other)\r
-{\r
- draw_frame temp(std::move(other));\r
- temp.swap(*this);\r
- return *this;\r
-}\r
-void draw_frame::accept(frame_visitor& visitor){impl_->accept(*this, visitor);}\r
-\r
-const image_transform& draw_frame::get_image_transform() const { return impl_->image_transform_;}\r
-image_transform& draw_frame::get_image_transform() { return impl_->image_transform_;}\r
-const audio_transform& draw_frame::get_audio_transform() const { return impl_->audio_transform_;}\r
-audio_transform& draw_frame::get_audio_transform() { return impl_->audio_transform_;}\r
-\r
-safe_ptr<draw_frame> draw_frame::interlace(const safe_ptr<draw_frame>& frame1, const safe_ptr<draw_frame>& frame2, video_mode::type mode)\r
-{ \r
- if(frame1 == frame2 || mode == video_mode::progressive)\r
- return frame2;\r
-\r
- auto my_frame1 = make_safe<draw_frame>(frame1);\r
- auto my_frame2 = make_safe<draw_frame>(frame2);\r
- if(mode == video_mode::upper)\r
- {\r
- my_frame1->get_image_transform().set_mode(video_mode::upper); \r
- my_frame2->get_image_transform().set_mode(video_mode::lower); \r
- } \r
- else \r
- { \r
- my_frame1->get_image_transform().set_mode(video_mode::lower); \r
- my_frame2->get_image_transform().set_mode(video_mode::upper); \r
- }\r
-\r
- std::vector<safe_ptr<draw_frame>> frames;\r
- frames.push_back(my_frame1);\r
- frames.push_back(my_frame2);\r
- return make_safe<draw_frame>(frames);\r
-}\r
-\r
-void draw_frame::set_layer_index(int index) { impl_->index_ = index; }\r
-int draw_frame::get_layer_index() const { return impl_->index_; }\r
-std::vector<safe_ptr<draw_frame>> draw_frame::get_children(){return impl_->frames_;}\r
- \r
-}}
\ No newline at end of file
+++ /dev/null
-#pragma once\r
-\r
-#include "../fwd.h"\r
-\r
-#include "frame_visitor.h"\r
-\r
-#include <common/memory/safe_ptr.h>\r
-#include <core/video_format.h>\r
-\r
-#include <boost/noncopyable.hpp>\r
-#include <boost/range/iterator_range.hpp>\r
-\r
-#include <memory>\r
-#include <array>\r
-#include <vector>\r
-\r
-namespace caspar { namespace core {\r
-\r
-class image_transform;\r
-class audio_transform;\r
- \r
-class draw_frame\r
-{\r
-public:\r
- draw_frame(); \r
- draw_frame(safe_ptr<write_frame>&& image, std::vector<short>&& audio);\r
- draw_frame(const safe_ptr<draw_frame>& frame);\r
- draw_frame(safe_ptr<draw_frame>&& frame);\r
- draw_frame(const std::vector<safe_ptr<draw_frame>>& frames);\r
- draw_frame(std::vector<safe_ptr<draw_frame>>&& frame);\r
- draw_frame(const safe_ptr<draw_frame>& frame1, const safe_ptr<draw_frame>& frame2);\r
- draw_frame(safe_ptr<draw_frame>&& frame1, safe_ptr<draw_frame>&& frame2);\r
-\r
- void swap(draw_frame& other);\r
- \r
- draw_frame(const draw_frame& other);\r
- draw_frame(draw_frame&& other);\r
-\r
- draw_frame& operator=(const draw_frame& other);\r
- draw_frame& operator=(draw_frame&& other);\r
- \r
- const image_transform& get_image_transform() const;\r
- image_transform& get_image_transform();\r
-\r
- const audio_transform& get_audio_transform() const;\r
- audio_transform& get_audio_transform();\r
- \r
- static safe_ptr<draw_frame> interlace(const safe_ptr<draw_frame>& frame1, const safe_ptr<draw_frame>& frame2, video_mode::type mode);\r
- \r
- static const safe_ptr<draw_frame>& eof()\r
- {\r
- struct eof_frame : public draw_frame{};\r
- static safe_ptr<draw_frame> frame = make_safe<eof_frame>();\r
- return frame;\r
- }\r
-\r
- static const safe_ptr<draw_frame>& empty()\r
- {\r
- struct empty_frame : public draw_frame{};\r
- static safe_ptr<draw_frame> frame = make_safe<empty_frame>();\r
- return frame;\r
- }\r
-\r
- void remove_audio();\r
- void remove_image();\r
-\r
- virtual void accept(frame_visitor& visitor);\r
-\r
- void set_layer_index(int index);\r
- int get_layer_index() const;\r
-\r
- std::vector<safe_ptr<draw_frame>> get_children();\r
-private:\r
- struct implementation;\r
- std::shared_ptr<implementation> impl_;\r
-};\r
-\r
-}}
\ No newline at end of file
\r
namespace caspar{ namespace core{\r
\r
-class draw_frame;\r
+class basic_frame;\r
class write_frame;\r
\r
struct frame_visitor\r
{\r
- virtual void begin(const draw_frame& frame) = 0;\r
+ virtual void begin(const basic_frame& frame) = 0;\r
virtual void visit(write_frame& frame) = 0;\r
virtual void end() = 0;\r
};\r
\r
#include "write_frame.h"\r
\r
-#include "draw_frame.h"\r
+#include "basic_frame.h"\r
#include "pixel_format.h"\r
\r
#include "../image/image_mixer.h"\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
\r
#include "../fwd.h"\r
\r
-#include "draw_frame.h"\r
+#include "basic_frame.h"\r
\r
#include "../gpu/host_buffer.h"\r
\r
\r
struct pixel_format_desc;\r
\r
-class write_frame : public draw_frame, boost::noncopyable\r
+class write_frame : public basic_frame, boost::noncopyable\r
{\r
public: \r
explicit write_frame(const pixel_format_desc& desc, std::vector<safe_ptr<host_buffer>> buffers);\r
return output_.connect(subscriber);\r
}\r
\r
- boost::unique_future<safe_ptr<const host_buffer>> mix_image(const std::vector<safe_ptr<draw_frame>>& frames)\r
+ boost::unique_future<safe_ptr<const host_buffer>> mix_image(const std::vector<safe_ptr<basic_frame>>& frames)\r
{\r
auto image = image_mixer_.begin_pass();\r
BOOST_FOREACH(auto& frame, frames)\r
{\r
if(format_desc_.mode != video_mode::progressive)\r
{\r
- auto frame1 = make_safe<draw_frame>(frame);\r
- auto frame2 = make_safe<draw_frame>(frame);\r
+ auto frame1 = make_safe<basic_frame>(frame);\r
+ auto frame2 = make_safe<basic_frame>(frame);\r
\r
frame1->get_image_transform() = root_image_transform_.fetch_and_tick(1)*image_transforms_[frame->get_layer_index()].fetch_and_tick(1);\r
frame2->get_image_transform() = root_image_transform_.fetch_and_tick(1)*image_transforms_[frame->get_layer_index()].fetch_and_tick(1);\r
\r
if(frame1->get_image_transform() != frame2->get_image_transform())\r
- draw_frame::interlace(frame1, frame2, format_desc_.mode)->accept(image_mixer_);\r
+ basic_frame::interlace(frame1, frame2, format_desc_.mode)->accept(image_mixer_);\r
else\r
frame2->accept(image_mixer_);\r
}\r
else\r
{\r
- auto frame1 = make_safe<draw_frame>(frame);\r
+ auto frame1 = make_safe<basic_frame>(frame);\r
frame1->get_image_transform() = root_image_transform_.fetch_and_tick(1)*image_transforms_[frame->get_layer_index()].fetch_and_tick(1);\r
frame1->accept(image_mixer_);\r
}\r
return std::move(image);\r
}\r
\r
- std::vector<short> mix_audio(const std::vector<safe_ptr<draw_frame>>& frames)\r
+ std::vector<short> mix_audio(const std::vector<safe_ptr<basic_frame>>& frames)\r
{\r
auto audio = audio_mixer_.begin_pass();\r
BOOST_FOREACH(auto& frame, frames)\r
{\r
int num = format_desc_.mode == video_mode::progressive ? 1 : 2;\r
\r
- auto frame1 = make_safe<draw_frame>(frame);\r
+ auto frame1 = make_safe<basic_frame>(frame);\r
frame1->get_audio_transform() = root_audio_transform_.fetch_and_tick(num)*audio_transforms_[frame->get_layer_index()].fetch_and_tick(num);\r
frame1->accept(audio_mixer_);\r
}\r
return audio;\r
}\r
\r
- void send(const std::vector<safe_ptr<draw_frame>>& frames)\r
+ void send(const std::vector<safe_ptr<basic_frame>>& frames)\r
{ \r
executor_.begin_invoke([=]\r
{ \r
frame_mixer_device::frame_mixer_device(const printer& parent_printer, const video_format_desc& format_desc) : impl_(new implementation(parent_printer, format_desc)){}\r
frame_mixer_device::frame_mixer_device(frame_mixer_device&& other) : impl_(std::move(other.impl_)){}\r
boost::signals2::connection frame_mixer_device::connect(const output_t::slot_type& subscriber){return impl_->connect(subscriber);}\r
-void frame_mixer_device::send(const std::vector<safe_ptr<draw_frame>>& frames){impl_->send(frames);}\r
+void frame_mixer_device::send(const std::vector<safe_ptr<basic_frame>>& frames){impl_->send(frames);}\r
const video_format_desc& frame_mixer_device::get_video_format_desc() const { return impl_->format_desc_; }\r
safe_ptr<write_frame> frame_mixer_device::create_frame(const pixel_format_desc& desc){ return impl_->create_frame(desc); } \r
safe_ptr<write_frame> frame_mixer_device::create_frame(size_t width, size_t height, pixel_format::type pix_fmt)\r
frame_mixer_device(const printer& parent_printer, const video_format_desc& format_desc);\r
frame_mixer_device(frame_mixer_device&& other); // nothrow\r
\r
- void send(const std::vector<safe_ptr<draw_frame>>& frames); // nothrow\r
+ void send(const std::vector<safe_ptr<basic_frame>>& frames); // nothrow\r
\r
safe_ptr<write_frame> create_frame(const pixel_format_desc& desc); \r
safe_ptr<write_frame> create_frame(size_t width, size_t height, pixel_format::type pix_fmt = pixel_format::bgra); \r
\r
class read_frame;\r
class write_frame;\r
-class draw_frame;\r
+class basic_frame;\r
\r
class image_mixer;\r
struct frame_factory;\r
#include "image_kernel.h"\r
#include "image_transform.h"\r
\r
-#include "../frame/draw_frame.h"\r
+#include "../frame/basic_frame.h"\r
#include "../frame/write_frame.h"\r
\r
#include "../gpu/ogl_device.h"\r
glDeleteFramebuffersEXT(1, &fbo_);\r
}\r
\r
- void begin(const draw_frame& frame)\r
+ void begin(const basic_frame& frame)\r
{\r
transform_stack_.push(transform_stack_.top()*frame.get_image_transform());\r
}\r
};\r
\r
image_mixer::image_mixer(const video_format_desc& format_desc) : impl_(new implementation(format_desc)){}\r
-void image_mixer::begin(const draw_frame& frame){impl_->begin(frame);}\r
+void image_mixer::begin(const basic_frame& frame){impl_->begin(frame);}\r
void image_mixer::visit(write_frame& frame){impl_->visit(frame);}\r
void image_mixer::end(){impl_->end();}\r
boost::unique_future<safe_ptr<const host_buffer>> image_mixer::begin_pass(){ return impl_->begin_pass();}\r
public:\r
image_mixer(const video_format_desc& format_desc);\r
\r
- virtual void begin(const draw_frame& frame);\r
+ virtual void begin(const basic_frame& frame);\r
virtual void visit(write_frame& frame);\r
virtual void end();\r
\r
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">../StdAfx.h</PrecompiledHeaderFile>\r
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Develop|Win32'">../StdAfx.h</PrecompiledHeaderFile>\r
</ClCompile>\r
- <ClCompile Include="frame\draw_frame.cpp">\r
+ <ClCompile Include="frame\basic_frame.cpp">\r
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">../StdAfx.h</PrecompiledHeaderFile>\r
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">../StdAfx.h</PrecompiledHeaderFile>\r
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">../StdAfx.h</PrecompiledHeaderFile>\r
<ItemGroup>\r
<ClInclude Include="audio\audio_mixer.h" />\r
<ClInclude Include="audio\audio_transform.h" />\r
- <ClInclude Include="frame\draw_frame.h" />\r
+ <ClInclude Include="frame\basic_frame.h" />\r
<ClInclude Include="frame\frame_factory.h" />\r
<ClInclude Include="frame\frame_visitor.h" />\r
<ClInclude Include="frame\pixel_format.h" />\r
<ClCompile Include="image\image_transform.cpp">\r
<Filter>image</Filter>\r
</ClCompile>\r
- <ClCompile Include="frame\draw_frame.cpp">\r
+ <ClCompile Include="frame\basic_frame.cpp">\r
<Filter>frame</Filter>\r
</ClCompile>\r
</ItemGroup>\r
<ClInclude Include="frame\frame_visitor.h">\r
<Filter>frame</Filter>\r
</ClInclude>\r
- <ClInclude Include="frame\draw_frame.h">\r
+ <ClInclude Include="frame\frame_factory.h">\r
<Filter>frame</Filter>\r
</ClInclude>\r
- <ClInclude Include="frame\frame_factory.h">\r
+ <ClInclude Include="frame\basic_frame.h">\r
<Filter>frame</Filter>\r
</ClInclude>\r
</ItemGroup>\r
\r
std::shared_ptr<core::frame_factory> frame_factory_;\r
\r
- tbb::concurrent_bounded_queue<safe_ptr<core::draw_frame>> frame_buffer_;\r
- safe_ptr<core::draw_frame> tail_;\r
+ tbb::concurrent_bounded_queue<safe_ptr<core::basic_frame>> frame_buffer_;\r
+ safe_ptr<core::basic_frame> tail_;\r
\r
public:\r
\r
, device_index_(device_index)\r
, model_name_(L"DECKLINK")\r
, frame_factory_(frame_factory)\r
- , tail_(core::draw_frame::empty())\r
+ , tail_(core::basic_frame::empty())\r
{\r
frame_buffer_.set_capacity(4);\r
\r
return nullptr;\r
}\r
\r
- safe_ptr<core::draw_frame> get_frame()\r
+ safe_ptr<core::basic_frame> get_frame()\r
{\r
frame_buffer_.try_pop(tail_);\r
return tail_;\r
\r
virtual void set_parent_printer(const printer& parent_printer) { parent_printer_ = parent_printer;}\r
\r
- virtual safe_ptr<core::draw_frame> receive()\r
+ virtual safe_ptr<core::basic_frame> receive()\r
{\r
return input_->get_frame();\r
}\r
#include <core/video_format.h>\r
#include <common/utility/timer.h>\r
#include <common/diagnostics/graph.h>\r
-#include <mixer/frame/draw_frame.h>\r
+#include <mixer/frame/basic_frame.h>\r
#include <mixer/audio/audio_transform.h>\r
\r
#include <common/env.h>\r
std::deque<safe_ptr<core::write_frame>> video_frame_channel_; \r
std::deque<std::vector<short>> audio_chunk_channel_;\r
\r
- std::queue<safe_ptr<core::draw_frame>> ouput_channel_;\r
+ std::queue<safe_ptr<core::basic_frame>> ouput_channel_;\r
\r
- safe_ptr<core::draw_frame> last_frame_;\r
+ safe_ptr<core::basic_frame> last_frame_;\r
std::shared_ptr<core::frame_factory> frame_factory_;\r
\r
std::unique_ptr<input> input_; \r
explicit ffmpeg_producer(const std::wstring& filename, bool loop) \r
: filename_(filename)\r
, loop_(loop) \r
- , last_frame_(core::draw_frame(core::draw_frame::empty()))\r
+ , last_frame_(core::basic_frame(core::basic_frame::empty()))\r
\r
{\r
graph_ = diagnostics::create_graph(boost::bind(&ffmpeg_producer::print, this)); \r
parent_printer_ = parent_printer;\r
}\r
\r
- virtual safe_ptr<core::draw_frame> receive()\r
+ virtual safe_ptr<core::basic_frame> receive()\r
{\r
perf_timer_.reset();\r
\r
if(!ouput_channel_.empty())\r
{\r
result = std::move(ouput_channel_.front());\r
- last_frame_ = core::draw_frame(result);\r
+ last_frame_ = core::basic_frame(result);\r
last_frame_->get_audio_transform().set_gain(0.0); // last_frame should not have audio\r
ouput_channel_.pop();\r
}\r
else if(input_->is_eof())\r
- return core::draw_frame::eof();\r
+ return core::basic_frame::eof();\r
\r
return result;\r
}\r
\r
#include <core/video_format.h>\r
\r
-#include <mixer/frame/draw_frame.h>\r
+#include <mixer/frame/basic_frame.h>\r
#include <mixer/image/image_transform.h>\r
\r
#include <tbb/parallel_for.h>\r
flash_producer_->param((boost::wformat(L"<invoke name=\"Invoke\" returntype=\"xml\"><arguments><array><property id=\"0\"><number>%1%</number></property></array><string>%2%</string></arguments></invoke>") % layer % label).str());\r
}\r
\r
- safe_ptr<core::draw_frame> receive()\r
+ safe_ptr<core::basic_frame> receive()\r
{\r
return flash_producer_->receive();\r
}\r
\r
cg_producer::cg_producer() : impl_(new implementation()){}\r
cg_producer::cg_producer(cg_producer&& other) : impl_(std::move(other.impl_)){}\r
-safe_ptr<core::draw_frame> cg_producer::receive(){return impl_->receive();}\r
+safe_ptr<core::basic_frame> cg_producer::receive(){return impl_->receive();}\r
void cg_producer::clear(){impl_->clear();}\r
void cg_producer::add(int layer, const std::wstring& template_name, bool play_on_load, const std::wstring& startFromLabel, const std::wstring& data){impl_->add(layer, template_name, play_on_load, startFromLabel, data);}\r
void cg_producer::remove(int layer){impl_->remove(layer);}\r
explicit cg_producer();\r
cg_producer(cg_producer&& other);\r
\r
- virtual safe_ptr<core::draw_frame> receive();\r
+ virtual safe_ptr<core::basic_frame> receive();\r
virtual void initialize(const safe_ptr<core::frame_factory>& frame_factory);\r
virtual void set_parent_printer(const printer& parent_printer);\r
\r
\r
#include <core/video_format.h>\r
\r
-#include <mixer/frame/draw_frame.h>\r
+#include <mixer/frame/basic_frame.h>\r
#include <mixer/frame_mixer_device.h>\r
\r
#include <common/concurrency/executor.h>\r
std::shared_ptr<void> bmp_;\r
\r
CComObject<caspar::flash::FlashAxContainer>* ax_;\r
- safe_ptr<core::draw_frame> head_;\r
+ safe_ptr<core::basic_frame> head_;\r
\r
timer timer_;\r
\r
, bmp_data_(nullptr)\r
, hdc_(CreateCompatibleDC(0), DeleteDC)\r
, ax_(nullptr)\r
- , head_(core::draw_frame::empty())\r
+ , head_(core::basic_frame::empty())\r
{\r
graph_->add_guide("frame-time", 0.5f);\r
graph_->set_color("frame-time", diagnostics::color(1.0f, 0.0f, 0.0f)); \r
CASPAR_LOG(warning) << print() << " Invalid frame-rate: " << ax_->GetFPS() << L". Should be either " << format_desc_.fps << L" or " << format_desc_.fps*2.0 << L".";\r
}\r
\r
- safe_ptr<core::draw_frame> render_frame(bool has_underflow)\r
+ safe_ptr<core::basic_frame> render_frame(bool has_underflow)\r
{\r
if(ax_->IsEmpty())\r
- return core::draw_frame::empty();\r
+ return core::basic_frame::empty();\r
\r
auto frame = render_simple_frame(has_underflow);\r
if(interlaced(ax_->GetFPS(), format_desc_))\r
- frame = core::draw_frame::interlace(frame, render_simple_frame(has_underflow), format_desc_.mode);\r
+ frame = core::basic_frame::interlace(frame, render_simple_frame(has_underflow), format_desc_.mode);\r
return frame;\r
}\r
\r
\r
private:\r
\r
- safe_ptr<core::draw_frame> render_simple_frame(bool underflow)\r
+ safe_ptr<core::basic_frame> render_simple_frame(bool underflow)\r
{\r
if(underflow)\r
graph_->add_tag("underflow");\r
\r
std::shared_ptr<diagnostics::graph> graph_;\r
\r
- safe_ptr<core::draw_frame> tail_;\r
- tbb::concurrent_bounded_queue<safe_ptr<core::draw_frame>> frame_buffer_;\r
+ safe_ptr<core::basic_frame> tail_;\r
+ tbb::concurrent_bounded_queue<safe_ptr<core::basic_frame>> frame_buffer_;\r
\r
std::shared_ptr<flash_renderer> renderer_;\r
std::shared_ptr<core::frame_factory> frame_factory_;\r
public:\r
implementation(const std::wstring& filename) \r
: filename_(filename) \r
- , tail_(core::draw_frame::empty()) \r
+ , tail_(core::basic_frame::empty()) \r
, executor_(print())\r
{ \r
if(!boost::filesystem::exists(filename))\r
parent_printer_ = parent_printer;\r
}\r
\r
- virtual safe_ptr<core::draw_frame> receive()\r
+ virtual safe_ptr<core::basic_frame> receive()\r
{ \r
if(!renderer_)\r
- return core::draw_frame::empty();\r
+ return core::basic_frame::empty();\r
\r
graph_->set_value("output-buffer", static_cast<float>(frame_buffer_.size())/static_cast<float>(frame_buffer_.capacity()));\r
if(!frame_buffer_.try_pop(tail_))\r
\r
try\r
{\r
- auto frame = core::draw_frame::empty();\r
+ auto frame = core::basic_frame::empty();\r
do{frame = renderer_->render_frame(frame_buffer_.size() < frame_buffer_.capacity()-2);}\r
- while(frame_buffer_.try_push(frame) && frame == core::draw_frame::empty());\r
+ while(frame_buffer_.try_push(frame) && frame == core::basic_frame::empty());\r
graph_->set_value("output-buffer", static_cast<float>(frame_buffer_.size())/static_cast<float>(frame_buffer_.capacity())); \r
fps_.fetch_and_store(static_cast<int>(renderer_->fps()*100.0));\r
}\r
if(!renderer_)\r
{\r
renderer_.reset(new flash_renderer(safe_ptr<diagnostics::graph>(graph_), frame_factory_, filename_, [=]{return print();}));\r
- while(frame_buffer_.try_push(core::draw_frame::empty())){} \r
+ while(frame_buffer_.try_push(core::basic_frame::empty())){} \r
}\r
\r
try\r
\r
flash_producer::flash_producer(flash_producer&& other) : impl_(std::move(other.impl_)){}\r
flash_producer::flash_producer(const std::wstring& filename) : impl_(new implementation(filename)){}\r
-safe_ptr<core::draw_frame> flash_producer::receive(){return impl_->receive();}\r
+safe_ptr<core::basic_frame> flash_producer::receive(){return impl_->receive();}\r
void flash_producer::param(const std::wstring& param){impl_->param(param);}\r
void flash_producer::initialize(const safe_ptr<core::frame_factory>& frame_factory) { impl_->initialize(frame_factory);}\r
void flash_producer::set_parent_printer(const printer& parent_printer){impl_->set_parent_printer(parent_printer);}\r
explicit flash_producer(const std::wstring& filename);\r
flash_producer(flash_producer&& other);\r
\r
- virtual safe_ptr<core::draw_frame> receive();\r
+ virtual safe_ptr<core::basic_frame> receive();\r
virtual void initialize(const safe_ptr<core::frame_factory>& frame_factory);\r
virtual void set_parent_printer(const printer& parent_printer);\r
virtual std::wstring print() const;\r
#include <core/video_format.h>\r
\r
#include <mixer/frame_mixer_device.h>\r
-#include <mixer/frame/draw_frame.h>\r
+#include <mixer/frame/basic_frame.h>\r
\r
#include <common/env.h>\r
\r
printer parent_printer_;\r
std::shared_ptr<core::frame_factory> frame_factory_;\r
std::wstring filename_;\r
- safe_ptr<core::draw_frame> frame_;\r
+ safe_ptr<core::basic_frame> frame_;\r
\r
image_producer(const std::wstring& filename) \r
- : filename_(filename), frame_(core::draw_frame::empty()) {}\r
+ : filename_(filename), frame_(core::basic_frame::empty()) {}\r
\r
- virtual safe_ptr<core::draw_frame> receive(){return frame_;}\r
+ virtual safe_ptr<core::basic_frame> receive(){return frame_;}\r
\r
virtual void initialize(const safe_ptr<core::frame_factory>& frame_factory)\r
{\r
//\r
//#include "image_loader.h"\r
//\r
-//#include "../../mixer/draw_frame.h"\r
-//#include "../../mixer/draw_frame.h"\r
+//#include "../../mixer/basic_frame.h"\r
+//#include "../../mixer/basic_frame.h"\r
//#include "../../video_format.h"\r
//#include "../../mixer/frame_mixer_device.h"\r
//#include "../../configuration.h"\r
// std::copy_n(&pBits[i* width * 4], width * 4, &image_.get()[i * image_width_ * 4]);\r
// }\r
//\r
-// draw_frame do_receive()\r
+// basic_frame do_receive()\r
// {\r
// auto frame = frame_factory_->create_frame(format_desc_.width, format_desc_.height);\r
// std::fill(frame.image_data().begin(), frame.image_data().end(), 0);\r
// return std::move(frame);\r
// }\r
// \r
-// safe_ptr<draw_frame> receive()\r
+// safe_ptr<basic_frame> receive()\r
// { \r
// if(format_desc_.mode != video_mode::progressive) \r
// {\r
-// draw_frame frame1;\r
-// draw_frame frame2;\r
+// basic_frame frame1;\r
+// basic_frame frame2;\r
// tbb::parallel_invoke([&]{ frame1 = std::move(do_receive()); }, [&]{ frame2 = std::move(do_receive()); });\r
-// return draw_frame::interlace(std::move(frame1), std::move(frame2), format_desc_.mode);\r
+// return basic_frame::interlace(std::move(frame1), std::move(frame2), format_desc_.mode);\r
// } \r
//\r
// return receive(); \r
\r
CComObject<XcpControlHost>* host_;\r
tbb::spin_mutex mutex_;\r
- safe_ptr<core::draw_frame> last_frame_;\r
+ safe_ptr<core::basic_frame> last_frame_;\r
\r
sf::RenderWindow window_;\r
\r
silverlight_renderer(const std::shared_ptr<core::frame_factory>& frame_factory) \r
: frame_factory_(frame_factory)\r
, format_desc_(frame_factory->get_video_format_desc())\r
- , last_frame_(core::draw_frame::empty())\r
+ , last_frame_(core::basic_frame::empty())\r
, host_(nullptr)\r
, id_(rand())\r
, window_(sf::VideoMode(format_desc_.width, format_desc_.height, 32), boost::lexical_cast<std::string>(id_), sf::Style::None)\r
last_frame_ = frame;\r
}\r
\r
- safe_ptr<core::draw_frame> get_frame()\r
+ safe_ptr<core::basic_frame> get_frame()\r
{ \r
tbb::spin_mutex::scoped_lock lock(mutex_);\r
return last_frame_;\r
\r
}\r
\r
- virtual safe_ptr<core::draw_frame> receive()\r
+ virtual safe_ptr<core::basic_frame> receive()\r
{\r
executor_.begin_invoke([=]\r
{\r