]> git.sesse.net Git - casparcg/commitdiff
2.0.0.2: Renamed draw_frame to basic_frame.
authorronag <ronag@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Wed, 9 Mar 2011 11:39:55 +0000 (11:39 +0000)
committerronag <ronag@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Wed, 9 Mar 2011 11:39:55 +0000 (11:39 +0000)
git-svn-id: https://casparcg.svn.sourceforge.net/svnroot/casparcg/server/branches/2.0.0.2@541 362d55ac-95cf-4e76-9f9a-cbaa9c17b72d

36 files changed:
core/channel.cpp
core/consumer/frame_consumer_device.h
core/producer/color/color_producer.cpp
core/producer/frame_producer.h
core/producer/frame_producer_device.cpp
core/producer/frame_producer_device.h
core/producer/layer.cpp
core/producer/layer.h
core/producer/transition/transition_producer.cpp
core/producer/transition/transition_producer.h
mixer/audio/audio_mixer.cpp
mixer/audio/audio_mixer.h
mixer/frame/basic_frame.cpp [new file with mode: 0644]
mixer/frame/basic_frame.h [new file with mode: 0644]
mixer/frame/draw_frame.cpp [deleted file]
mixer/frame/draw_frame.h [deleted file]
mixer/frame/frame_visitor.h
mixer/frame/write_frame.cpp
mixer/frame/write_frame.h
mixer/frame_mixer_device.cpp
mixer/frame_mixer_device.h
mixer/fwd.h
mixer/image/image_mixer.cpp
mixer/image/image_mixer.h
mixer/mixer.vcxproj
mixer/mixer.vcxproj.filters
modules/decklink/producer/decklink_producer.cpp
modules/ffmpeg/producer/ffmpeg_producer.cpp
modules/ffmpeg/producer/video/video_decoder.cpp
modules/flash/producer/cg_producer.cpp
modules/flash/producer/cg_producer.h
modules/flash/producer/flash_producer.cpp
modules/flash/producer/flash_producer.h
modules/image/producer/image_producer.cpp
modules/image/producer/image_scroll_producer.cpp
modules/silverlight/producer/silverlight_producer.cpp

index 702395792b85d8bb88471ff3110854fd7720d0f4..4323156057919687b24228f89e322be33957509c 100644 (file)
@@ -6,7 +6,7 @@
 #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
@@ -47,7 +47,7 @@ public:
                , 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
index 9c9279cfccd14b579e1a32f5e72c17f13ac454a9..dce523876fa2c18e38b8f6cd23ff6b0f0826b5d5 100644 (file)
@@ -11,7 +11,7 @@
 \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
index f0a887f51aa2640d47a5653bf16e8c32829a20dc..83fed4a7071e3e8af7fc41597c40e581941ed345 100644 (file)
@@ -30,7 +30,7 @@ namespace caspar { namespace core {
        \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
@@ -38,7 +38,7 @@ public:
 \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
@@ -55,7 +55,7 @@ public:
 \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
index 1763f9a57345aa86e939ecbf14590a5c486c2095..befe664c85be91d6ca0ed708788bdd49a6ccc86d 100644 (file)
@@ -22,7 +22,7 @@
 #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
@@ -38,7 +38,7 @@ public:
        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
@@ -46,7 +46,7 @@ public:
        ///\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
@@ -81,7 +81,7 @@ public:
        {\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
index 4aaf9f2c2508d9af3c76ab3f85aac36e3ca2262b..ce239f45b35c2742d3ee236175fe528214a73104 100644 (file)
@@ -2,7 +2,7 @@
 \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
@@ -73,9 +73,9 @@ public:
                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
@@ -86,7 +86,7 @@ public:
                                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
index 611ac9c94cbc47f37df00835849e2b10b3b43fe4..5f959a3a63223b23f7e27ea95601269db525dd80 100644 (file)
@@ -28,7 +28,7 @@ namespace caspar { namespace core {
 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
index 33e60ba15b350ce77e0baa5436ba9d57fdb025f2..e072b13c3e5e141e5fbf6b270a7236b7e9307da0 100644 (file)
@@ -9,7 +9,7 @@
 #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
@@ -55,7 +55,7 @@ struct layer::implementation : boost::noncopyable
        \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
@@ -63,7 +63,7 @@ public:
                , 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
@@ -102,11 +102,11 @@ public:
        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
@@ -117,7 +117,7 @@ public:
                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
@@ -167,7 +167,7 @@ void layer::load(const safe_ptr<frame_producer>& frame_producer, bool play_on_lo
 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
index cf66e1ea38d83d040f142be136130410ad3ecfce..a526764093e504226b33453663af7e93cfdc04f7 100644 (file)
@@ -12,7 +12,7 @@
 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
@@ -31,7 +31,7 @@ public:
        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
index e32901e261e919b0087c5717b68bfd8f0dcb75e9..855c0679748682daedbd5442a56f67b85a6ff7e3 100644 (file)
@@ -23,7 +23,7 @@
 \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
@@ -43,7 +43,7 @@ struct transition_producer::implementation : boost::noncopyable
        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
@@ -52,7 +52,7 @@ struct transition_producer::implementation : boost::noncopyable
                , 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
@@ -78,13 +78,13 @@ struct transition_producer::implementation : boost::noncopyable
                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
@@ -95,12 +95,12 @@ struct transition_producer::implementation : boost::noncopyable
                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
@@ -112,7 +112,7 @@ struct transition_producer::implementation : boost::noncopyable
                        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
@@ -133,13 +133,13 @@ struct transition_producer::implementation : boost::noncopyable
                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
@@ -148,14 +148,14 @@ struct transition_producer::implementation : boost::noncopyable
                \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
@@ -184,10 +184,10 @@ struct transition_producer::implementation : boost::noncopyable
                        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
@@ -201,7 +201,7 @@ struct transition_producer::implementation : boost::noncopyable
 \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
index 1cb2735f2b00a74cf22224ec14218bda342421c4..77ff0ffb7a9161836fda35682b2d270f15e7b49c 100644 (file)
@@ -76,7 +76,7 @@ public:
        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
index f03e92ed22e374496e7efb50b8927cd8219020ab..0c76b18c58038d6b0fb3368a7cea2305b2d7340c 100644 (file)
@@ -3,7 +3,7 @@
 #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
@@ -22,7 +22,7 @@ public:
                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
@@ -95,7 +95,7 @@ public:
 };\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
index 8fb013e9d304042b6a38c12f05bfc98f925b76f8..d8b49ede4092c4ecc6ddd9dbebdb249fef712b41 100644 (file)
@@ -11,7 +11,7 @@ class audio_mixer : public frame_visitor
 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
diff --git a/mixer/frame/basic_frame.cpp b/mixer/frame/basic_frame.cpp
new file mode 100644 (file)
index 0000000..5c8d47a
--- /dev/null
@@ -0,0 +1,123 @@
+#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
diff --git a/mixer/frame/basic_frame.h b/mixer/frame/basic_frame.h
new file mode 100644 (file)
index 0000000..c233266
--- /dev/null
@@ -0,0 +1,78 @@
+#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
diff --git a/mixer/frame/draw_frame.cpp b/mixer/frame/draw_frame.cpp
deleted file mode 100644 (file)
index 9d0c961..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-#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
diff --git a/mixer/frame/draw_frame.h b/mixer/frame/draw_frame.h
deleted file mode 100644 (file)
index a042898..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-#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
index f7d48a9068ae2bdc72afbf1ea71d89b8de345f0d..fa356ba5ddef7e8ff8c1bd865022fc47af6f5703 100644 (file)
@@ -2,12 +2,12 @@
 \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
index b90c3e8c97fd838c9792b73bded39a157f8da4c5..963f6c5938e46071592dcbf9411914c42343289b 100644 (file)
@@ -2,7 +2,7 @@
 \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
@@ -43,6 +43,7 @@ public:
                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
index b60baea513e0147c117407e0e711c9e392592e2d..e4abca355cdf0af5e3afa160da2ff13fb1586dd3 100644 (file)
@@ -2,7 +2,7 @@
 \r
 #include "../fwd.h"\r
 \r
-#include "draw_frame.h"\r
+#include "basic_frame.h"\r
 \r
 #include "../gpu/host_buffer.h"\r
 \r
@@ -18,7 +18,7 @@ namespace caspar { namespace core {
        \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
index 864ad6ac697a9b23c55ea6b310ab618d0db1e7c8..191936b0d1f36e9c80def46e749159b50ebe200f 100644 (file)
@@ -98,27 +98,27 @@ public:
                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
@@ -127,14 +127,14 @@ public:
                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
@@ -142,7 +142,7 @@ public:
                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
@@ -255,7 +255,7 @@ public:
 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
index 536295c31fb10557427e6955217c1c12ec89fa43..b618d2ee8af1b4371c9d4145fbddffa56502d932 100644 (file)
@@ -52,7 +52,7 @@ public:
        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
index 209971c110c9935bf817388cbdef5d0e3de21bd3..3181e5bc696cc16813b4733ba75bcee3435c69d4 100644 (file)
@@ -6,7 +6,7 @@ namespace caspar { namespace core {
        \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
index 840bb7e5d7d89e1ee6d3a771c0d1cb6c969fa06b..1d6188bc9d85920d673d5fe0bf094f46bf14da7e 100644 (file)
@@ -4,7 +4,7 @@
 #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
@@ -71,7 +71,7 @@ public:
                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
@@ -161,7 +161,7 @@ public:
 };\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
index 3b3ae6461c7a41ab6e3e6dd07830f88a72df296d..ebaff9fef88b2e1bd866ebc0c88b366027f0d1b3 100644 (file)
@@ -22,7 +22,7 @@ class image_mixer : public frame_visitor, boost::noncopyable
 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
index 8821dccc3423a79d865bbf7b2d03f4a42518e2c8..5e521b70cca5c9a52b22351e8524d226256a34e6 100644 (file)
@@ -31,7 +31,7 @@
       <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
@@ -96,7 +96,7 @@
   <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
index 4aa932ef4b8b591dfa8cf0051b8fb7fb0f914135..eb417b6569040303452b76bb9ec13dfae9998967 100644 (file)
@@ -47,7 +47,7 @@
     <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
index 935c0bb2ee6f951cefefe1d1948821de44186b7a..9f38d044acc0f37a4837349e7f4c67dd02504e08 100644 (file)
@@ -75,8 +75,8 @@ class decklink_input : public IDeckLinkInputCallback
 \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
@@ -86,7 +86,7 @@ public:
                , 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
@@ -231,7 +231,7 @@ public:
                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
@@ -278,7 +278,7 @@ public:
 \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
index 4ea470ca5655e9f5071e0a94549f5e01293ec3e5..2f3500818639631bb0c41596853c9b8ed2cc2689 100644 (file)
@@ -9,7 +9,7 @@
 #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
@@ -37,9 +37,9 @@ struct ffmpeg_producer : public core::frame_producer
        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
@@ -47,7 +47,7 @@ public:
        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
@@ -68,7 +68,7 @@ public:
                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
@@ -154,12 +154,12 @@ public:
                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
index 9c92af31a31a7707a260c11f19f6780d73cd6200..d32c7f5493e8aa8ffa92748ec08ada045b9ffe49 100644 (file)
@@ -6,7 +6,7 @@
 \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
index 721c9fa7cb174659d4a2f4a94532736040674def..b4f7698f64f822cafde67ecb4b172351e04ee208 100644 (file)
@@ -72,7 +72,7 @@ public:
                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
@@ -123,7 +123,7 @@ safe_ptr<core::frame_producer> create_ct_producer(const std::vector<std::wstring
 \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
index f089b7571f3d5b1b042fab92dddafdf877e6ab61..8bdd818bf797c13dad319951b046d4f311f6950e 100644 (file)
@@ -17,7 +17,7 @@ public:
        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
index e661ca0b6eaef3845904b768837a46259c8f6e4d..679375ff3f586ef1fcfef92b4a310e95b58862d2 100644 (file)
@@ -29,7 +29,7 @@
 \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
@@ -67,7 +67,7 @@ class flash_renderer
        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
@@ -89,7 +89,7 @@ public:
                , 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
@@ -153,14 +153,14 @@ public:
                        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
@@ -171,7 +171,7 @@ public:
        \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
@@ -205,8 +205,8 @@ struct flash_producer::implementation
 \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
@@ -224,7 +224,7 @@ struct flash_producer::implementation
 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
@@ -257,10 +257,10 @@ public:
                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
@@ -273,9 +273,9 @@ public:
 \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
@@ -296,7 +296,7 @@ public:
                        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
@@ -314,7 +314,7 @@ public:
 \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
index 8f726933809941631a97f925785ffbf844c92f4e..d719c5670807c37652c710119dccd254618f2f72 100644 (file)
@@ -31,7 +31,7 @@ public:
        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
index 339d6c5837c0fddca88b889a0413bbdada482aa5..4fa001ee1b7330601dfdd6a2c2b83724c7cff1c7 100644 (file)
@@ -5,7 +5,7 @@
 #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
@@ -23,12 +23,12 @@ struct image_producer : public core::frame_producer
        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
index f69f8a1746f0015325f387d965213b5ae8336161..59dc4a3335a237c773faf3e329dae2b3c848e9cd 100644 (file)
@@ -2,8 +2,8 @@
 //\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
@@ -65,7 +65,7 @@
 //                     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
index e5c05b66281039ff275c2e2e259bc3f608bc2f55..253f11957ce2489ef3e00296a9e9572160717d63 100644 (file)
@@ -58,7 +58,7 @@ class silverlight_renderer
        \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
@@ -71,7 +71,7 @@ public:
        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
@@ -126,7 +126,7 @@ public:
                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
@@ -160,7 +160,7 @@ public:
 \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