]> git.sesse.net Git - casparcg/commitdiff
2.1.0: Seal of appropriate classes.
authorronag <ronag@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Sun, 11 Dec 2011 11:12:10 +0000 (11:12 +0000)
committerronag <ronag@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Sun, 11 Dec 2011 11:12:10 +0000 (11:12 +0000)
git-svn-id: https://casparcg.svn.sourceforge.net/svnroot/casparcg/server/branches/2.1.0@1879 362d55ac-95cf-4e76-9f9a-cbaa9c17b72d

18 files changed:
core/consumer/output.cpp
core/consumer/output.h
core/mixer/audio/audio_mixer.h
core/mixer/image/image_kernel.h
core/mixer/image/image_mixer.h
core/mixer/mixer.cpp
core/mixer/mixer.h
core/mixer/read_frame.cpp
core/mixer/read_frame.h
core/mixer/write_frame.h
core/producer/frame/frame_transform.h
core/producer/frame/pixel_format.h
core/producer/layer.h
core/producer/stage.h
core/video_channel.h
core/video_format.h
modules/image/consumer/image_consumer.cpp
shell/server.h

index bb322fe5a0de772e021089013f610521cdc8c2e6..504898e927abe5ec075622bce8a788dfd31860f7 100644 (file)
@@ -174,7 +174,7 @@ public:
                                if(!has_synchronization_clock())\r
                                        sync_timer_.tick(1.0/format_desc_.fps);\r
 \r
-                               if(input_frame->image_size() != format_desc_.size)\r
+                               if(input_frame->image_data().size() != format_desc_.size)\r
                                {\r
                                        sync_timer_.tick(1.0/format_desc_.fps);\r
                                        return;\r
index 02477b5022c2cca74afbe9177a7065c5910ed702..7741623a2888ce8029f32cc21e51d19fda0791b0 100644 (file)
@@ -33,7 +33,7 @@
 \r
 namespace caspar { namespace core {\r
        \r
-class output : public target<std::pair<safe_ptr<read_frame>, std::shared_ptr<void>>>\r
+class output sealed : public target<std::pair<safe_ptr<read_frame>, std::shared_ptr<void>>>\r
                         , boost::noncopyable\r
 {\r
 public:\r
index 622a09b1c3474713f1d9dba2d7e37e1d85e481c2..7ff1e5f22a4a3c08a76abe93251a7b251d1016d5 100644 (file)
@@ -45,7 +45,7 @@ struct video_format_desc;
        \r
 typedef std::vector<int32_t, tbb::cache_aligned_allocator<int32_t>> audio_buffer;\r
 \r
-class audio_mixer : public core::frame_visitor, boost::noncopyable\r
+class audio_mixer sealed : public core::frame_visitor, boost::noncopyable\r
 {\r
 public:\r
        audio_mixer(const safe_ptr<diagnostics::graph>& graph);\r
index ac378fc0680fb2e495b83919b3781051197ca5cd..8737c64bc5b6991600afb95c59b371d3d99ce2a2 100644 (file)
@@ -62,7 +62,7 @@ struct draw_params
        }\r
 };\r
 \r
-class image_kernel : boost::noncopyable\r
+class image_kernel sealed : boost::noncopyable\r
 {\r
 public:\r
        image_kernel(const safe_ptr<ogl_device>& ogl);\r
index 664d7c2377639faac2f84d056acf81173964a5e3..1b413fe1da6631df964fa307ab5af349c9fd75c3 100644 (file)
@@ -39,7 +39,7 @@ class ogl_device;
 struct video_format_desc;\r
 struct pixel_format_desc;\r
 \r
-class image_mixer : public core::frame_visitor, boost::noncopyable\r
+class image_mixer sealed : public core::frame_visitor, boost::noncopyable\r
 {\r
 public:\r
        image_mixer(const safe_ptr<ogl_device>& ogl);\r
index 750c9bbb06759325303609a6fa8ab9fd900961e6..6751375e648a5a79f941f95a50d9444fe4055593 100644 (file)
@@ -112,7 +112,7 @@ public:
 \r
                                graph_->update_value("mix-time", mix_timer_.elapsed()*format_desc_.fps*0.5);\r
 \r
-                               target_->send(std::make_pair(make_safe<read_frame>(ogl_, format_desc_.size, std::move(image.get()), std::move(audio)), packet.second));                                 \r
+                               target_->send(std::make_pair(make_safe<read_frame>(ogl_, format_desc_.width, format_desc_.height, std::move(image.get()), std::move(audio)), packet.second));                                   \r
                        }\r
                        catch(...)\r
                        {\r
index c01482527784c02081b934003bab95297ce836a8..c80dce6df90b82c91715adf57f0c5dea3a4ac1cf 100644 (file)
@@ -47,7 +47,7 @@ class ogl_device;
 struct frame_transform;\r
 struct pixel_format;\r
 \r
-class mixer : public target<std::pair<std::map<int, safe_ptr<core::basic_frame>>, std::shared_ptr<void>>>\r
+class mixer sealed : public target<std::pair<std::map<int, safe_ptr<core::basic_frame>>, std::shared_ptr<void>>>\r
                        , public core::frame_factory\r
 {\r
 public:        \r
index 67f0b58fa10acb350345d1c373fd06f9f732c991..31d7d0247f77dbda184533750b3afb5aaf006692 100644 (file)
@@ -34,15 +34,17 @@ namespace caspar { namespace core {
 struct read_frame::implementation : boost::noncopyable\r
 {\r
        safe_ptr<ogl_device>            ogl_;\r
-       int                                             size_;\r
+       int                                                     width_;\r
+       int                                                     height_;\r
        safe_ptr<host_buffer>           image_data_;\r
        tbb::mutex                                      mutex_;\r
        audio_buffer                            audio_data_;\r
 \r
 public:\r
-       implementation(const safe_ptr<ogl_device>& ogl, int size, safe_ptr<host_buffer>&& image_data, audio_buffer&& audio_data) \r
+       implementation(const safe_ptr<ogl_device>& ogl, int width, int height, safe_ptr<host_buffer>&& image_data, audio_buffer&& audio_data) \r
                : ogl_(ogl)\r
-               , size_(size)\r
+               , width_(width)\r
+               , height_(height)\r
                , image_data_(std::move(image_data))\r
                , audio_data_(std::move(audio_data)){}  \r
        \r
@@ -67,8 +69,8 @@ public:
        }\r
 };\r
 \r
-read_frame::read_frame(const safe_ptr<ogl_device>& ogl, int size, safe_ptr<host_buffer>&& image_data, audio_buffer&& audio_data) \r
-       : impl_(new implementation(ogl, size, std::move(image_data), std::move(audio_data))){}\r
+read_frame::read_frame(const safe_ptr<ogl_device>& ogl, int width, int height, safe_ptr<host_buffer>&& image_data, audio_buffer&& audio_data) \r
+       : impl_(new implementation(ogl, width, height, std::move(image_data), std::move(audio_data))){}\r
 read_frame::read_frame(){}\r
 const boost::iterator_range<const uint8_t*> read_frame::image_data()\r
 {\r
@@ -80,7 +82,8 @@ const boost::iterator_range<const int32_t*> read_frame::audio_data()
        return impl_ ? impl_->audio_data() : boost::iterator_range<const int32_t*>();\r
 }\r
 \r
-int read_frame::image_size() const{return impl_ ? impl_->size_ : 0;}\r
+int read_frame::width() const{return impl_ ? impl_->width_ : 0;}\r
+int read_frame::height() const{return impl_ ? impl_->height_ : 0;}\r
 \r
 //#include <tbb/scalable_allocator.h>\r
 //#include <tbb/parallel_for.h>\r
index 3a315abde9565476e3d99a1754b05693c19e3319..e6d2d059761f612f6c6c8a97157b895fe6aa547b 100644 (file)
@@ -37,16 +37,17 @@ namespace caspar { namespace core {
 class host_buffer;\r
 class ogl_device;\r
 \r
-class read_frame : boost::noncopyable\r
+class read_frame sealed : boost::noncopyable\r
 {\r
 public:\r
        read_frame();\r
-       read_frame(const safe_ptr<ogl_device>& ogl, int size, safe_ptr<host_buffer>&& image_data, audio_buffer&& audio_data);\r
+       read_frame(const safe_ptr<ogl_device>& ogl, int width, int height, safe_ptr<host_buffer>&& image_data, audio_buffer&& audio_data);\r
 \r
-       virtual const boost::iterator_range<const uint8_t*> image_data();\r
-       virtual const boost::iterator_range<const int32_t*> audio_data();\r
+       const boost::iterator_range<const uint8_t*> image_data();\r
+       const boost::iterator_range<const int32_t*> audio_data();\r
 \r
-       virtual int image_size() const;\r
+       int width() const;\r
+       int height() const;\r
                \r
 private:\r
        struct implementation;\r
index 0e0ee4edf84d4c0270eb4c91ca995a160409993c..29c25c8d379ee426c4e9bdb6f2d31a982ba63ee6 100644 (file)
@@ -40,7 +40,7 @@ struct frame_visitor;
 struct pixel_format_desc;\r
 class ogl_device;      \r
 \r
-class write_frame : public core::basic_frame, boost::noncopyable\r
+class write_frame sealed : public core::basic_frame, boost::noncopyable\r
 {\r
 public:        \r
        explicit write_frame(const void* tag);\r
index ab592c1834eb5ed713d5f1c425062fc870823d05..18a6f55229d314d9f330f116dfe50c440c38bfb9 100644 (file)
@@ -30,7 +30,7 @@ namespace caspar { namespace core {
 \r
 struct pixel_format_desc;\r
                \r
-struct levels\r
+struct levels sealed\r
 {\r
        levels() \r
                : min_input(0.0)\r
@@ -47,7 +47,7 @@ struct levels
        double max_output;\r
 };\r
 \r
-struct frame_transform \r
+struct frame_transform sealed\r
 {\r
 public:\r
 \r
index 7a2a1a97dd2e193aebda70a1a4b88479f5b67e12..4e7efbb1bd731c04f8d9bb7e4e298433c91f7c5d 100644 (file)
@@ -42,7 +42,7 @@ struct pixel_format
        };\r
 };\r
 \r
-struct pixel_format_desc\r
+struct pixel_format_desc sealed\r
 {\r
        struct plane\r
        {\r
index d7d190aa18a4ad2b0b27cf0edfc231df638660aa..8d29fb82d05871ce10b13cefe69110b4233de49d 100644 (file)
@@ -34,7 +34,7 @@ namespace caspar { namespace core {
 struct frame_producer;\r
 class basic_frame;\r
 \r
-class layer : boost::noncopyable\r
+class layer sealed : boost::noncopyable\r
 {\r
 public:\r
        layer(); // nothrow\r
index bdd39d6a74d122da4dc56b29ad910c5bf30e1d3c..0b366a1da57108a1e9759408cf3083025aee3f01 100644 (file)
@@ -38,7 +38,7 @@ namespace caspar { namespace core {
 struct video_format_desc;\r
 struct frame_transform;\r
 \r
-class stage : boost::noncopyable\r
+class stage sealed : boost::noncopyable\r
 {\r
 public:\r
        typedef target<std::pair<std::map<int, safe_ptr<basic_frame>>, std::shared_ptr<void>>> target_t;\r
index 51c2267ff2ba992e652cd89f7b2925c6ab36f892..b4bf7e34cf1d8ebd0a2e15e4fa6e0f2727dc9505 100644 (file)
@@ -35,7 +35,7 @@ class output;
 class ogl_device;\r
 struct video_format_desc;\r
 \r
-class video_channel : boost::noncopyable\r
+class video_channel sealed : boost::noncopyable\r
 {\r
 public:\r
        explicit video_channel(int index, const video_format_desc& format_desc, const safe_ptr<ogl_device>& ogl);\r
index 0ac3f0093acc223154c6008501688371ba777646..0152e70f78be497cdba947207d2feed22ac563cb 100644 (file)
@@ -77,9 +77,9 @@ struct field_mode
        }\r
 };\r
 \r
-struct video_format_desc\r
+struct video_format_desc sealed\r
 {\r
-       video_format::type              format;         // video output format\r
+       video_format::type      format;         // video output format\r
 \r
        int                                     width;          // output frame width\r
        int                                     height;         // output frame height\r
index a826ace23f3924e99aeb7325a57af19a882a520b..b0bfae429dbd24b1d7ef70be01749c45a5ce39bc 100644 (file)
@@ -45,27 +45,24 @@ namespace caspar { namespace image {
        \r
 struct image_consumer : public core::frame_consumer\r
 {\r
-       core::video_format_desc                                 format_desc_;\r
 public:\r
 \r
        // frame_consumer\r
 \r
-       virtual void initialize(const core::video_format_desc& format_desc, int) override\r
+       virtual void initialize(const core::video_format_desc&, int) override\r
        {\r
-               format_desc_ = format_desc;\r
        }\r
        \r
        virtual bool send(const safe_ptr<core::read_frame>& frame) override\r
        {                               \r
-               auto format_desc = format_desc_;\r
-               boost::thread async([format_desc, frame]\r
+               boost::thread async([frame]\r
                {\r
                        try\r
                        {\r
                                auto filename = u8(env::data_folder()) +  boost::posix_time::to_iso_string(boost::posix_time::second_clock::local_time()) + ".png";\r
 \r
-                               auto bitmap = std::shared_ptr<FIBITMAP>(FreeImage_Allocate(format_desc.width, format_desc.height, 32), FreeImage_Unload);\r
-                               A_memcpy(FreeImage_GetBits(bitmap.get()), frame->image_data().begin(), frame->image_size());\r
+                               auto bitmap = std::shared_ptr<FIBITMAP>(FreeImage_Allocate(frame->width(), frame->height(), 32), FreeImage_Unload);\r
+                               A_memcpy(FreeImage_GetBits(bitmap.get()), frame->image_data().begin(), frame->image_data().size());\r
                                FreeImage_FlipVertical(bitmap.get());\r
                                FreeImage_Save(FIF_PNG, bitmap.get(), filename.c_str(), 0);\r
                        }\r
index 9ee3a7f12ff51eccac385241cbe3ac8539f3fe2c..920735af55377d8b644bdd250f841fd234e78f34 100644 (file)
@@ -34,7 +34,7 @@ namespace core {
        class video_channel;\r
 }\r
 \r
-class server : boost::noncopyable\r
+class server sealed : boost::noncopyable\r
 {\r
 public:\r
        server();\r