]> git.sesse.net Git - casparcg/commitdiff
2.0.0.2: Some cleanup and compilation optimizations.
authorronag <ronag@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Sat, 28 May 2011 09:55:12 +0000 (09:55 +0000)
committerronag <ronag@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Sat, 28 May 2011 09:55:12 +0000 (09:55 +0000)
git-svn-id: https://casparcg.svn.sourceforge.net/svnroot/casparcg/server/branches/2.0.0.2@819 362d55ac-95cf-4e76-9f9a-cbaa9c17b72d

common/memory/safe_ptr.h
core/consumer/frame_consumer.h
core/consumer/frame_consumer_device.cpp
core/mixer/image/image_mixer.cpp
core/mixer/read_frame.cpp
core/mixer/read_frame.h
core/mixer/write_frame.cpp
core/mixer/write_frame.h

index fb8cfeb5c6d052f51a957f308385a9820179f105..346455d1bdc90acf3db7f0960d89d73bbe1925b1 100644 (file)
 #include <type_traits>\r
 #include <exception>\r
 \r
-#include <tbb/spin_mutex.h>\r
-\r
 namespace caspar {\r
        \r
 template<typename T>\r
 class safe_ptr\r
 {      \r
        std::shared_ptr<T> impl_;\r
-       tbb::spin_mutex mutex_;\r
        template <typename> friend class safe_ptr;\r
 public:\r
        typedef T element_type;\r
index 48f414b33640ed785577961a8ede10b278ef35ca..4fc099ca808490c2d2b0d780ef3a40569fae2e7b 100644 (file)
@@ -51,6 +51,7 @@ struct frame_consumer : boost::noncopyable
                        virtual size_t buffer_depth() const{return 0;}\r
                        virtual void initialize(const video_format_desc&){}\r
                        virtual std::wstring print() const {return L"empty";}\r
+                       virtual bool has_synchronization_clock() const {return false;}\r
                };\r
                static safe_ptr<frame_consumer> consumer = make_safe<empty_frame_consumer>();\r
                return consumer;\r
index 0df1f77c9730ef61115d17b314c08d14565c4ad1..500db50ac5546184ab2a2dfbdb7a1592a5843509 100644 (file)
 #include <common/utility/timer.h>\r
 #include <common/memory/memshfl.h>\r
 \r
-#include <boost/range/algorithm_ext/erase.hpp>\r
-#include <boost/range/algorithm.hpp>\r
 #include <boost/circular_buffer.hpp>\r
 #include <boost/timer.hpp>\r
-#include <boost/range/algorithm.hpp>\r
 \r
 namespace caspar { namespace core {\r
        \r
@@ -84,8 +81,7 @@ public:
                consumer->initialize(format_desc_);\r
                executor_.invoke([&]\r
                {\r
-                       if(buffer_.capacity() < consumer->buffer_depth())\r
-                               buffer_.set_capacity(consumer->buffer_depth());\r
+                       buffer_.set_capacity(std::max(buffer_.capacity(), consumer->buffer_depth()));\r
 \r
                        this->remove(index);\r
                        consumers_.insert(std::make_pair(index, consumer));\r
@@ -126,7 +122,7 @@ public:
                        // Currently do key_only transform on cpu. Unsure if the extra 400MB/s (1080p50) overhead is worth it to do it on gpu.\r
                        auto key_data = ogl_device::create_host_buffer(frame->image_data().size(), host_buffer::write_only);                            \r
                        fast_memsfhl(key_data->data(), frame->image_data().begin(), frame->image_data().size(), 0x0F0F0F0F, 0x0B0B0B0B, 0x07070707, 0x03030303);\r
-                       std::vector<short> audio_data(frame->audio_data().begin(), frame->audio_data().end());\r
+                       std::vector<int16_t> audio_data(frame->audio_data().begin(), frame->audio_data().end());\r
                        return make_safe<const read_frame>(std::move(key_data), std::move(audio_data));\r
                }\r
                \r
@@ -143,7 +139,7 @@ public:
                        diag_->set_value("input-buffer", static_cast<float>(executor_.size())/static_cast<float>(executor_.capacity()));\r
                        frame_timer_.restart();\r
                        \r
-                       buffer_.push_back(std::make_pair(std::move(frame), get_key_frame(frame)));\r
+                       buffer_.push_back(std::make_pair(frame, get_key_frame(frame)));\r
 \r
                        if(!buffer_.full())\r
                                return;\r
index 5b59474c90e431c0b552335ad7d63125ee524a88..bc47e5a6b3ca2948f38251fe8a72e013cec4a269 100644 (file)
@@ -161,9 +161,7 @@ public:
 \r
                        std::swap(draw_buffer_, write_buffer_);\r
                });\r
-\r
-               // While transferring do additional work which was queued during rendering.\r
-               \r
+                               \r
                return std::move(result);\r
        }\r
        \r
index 189980ce8775009aa44b26328383b15ff2e33b91..0c0b80fe04a297890f52240c5b38debd18bd890c 100644 (file)
@@ -21,7 +21,7 @@
 \r
 #include "read_frame.h"\r
 \r
-#include <common/gl/gl_check.h>\r
+#include "gpu/host_buffer.h"   \r
 \r
 namespace caspar { namespace core {\r
                                                                                                                                                                                                                                                                                                                        \r
index ca7cba1194dc98b324bcf7b0c5f8b2a7744b8475..2e3817d09f37dc9a34bf069fecfa993050e9fd8e 100644 (file)
 */\r
 #pragma once\r
 \r
-#include "gpu/host_buffer.h"   \r
-\r
 #include <common/memory/safe_ptr.h>\r
 \r
 #include <boost/noncopyable.hpp>\r
 #include <boost/range/iterator_range.hpp>\r
-#include <boost/thread.hpp>\r
+#include <boost/thread/future.hpp>\r
 \r
 #include <memory>\r
 #include <vector>\r
 \r
 namespace caspar { namespace core {\r
        \r
+class host_buffer;\r
+\r
 class read_frame : boost::noncopyable\r
 {\r
        read_frame(){}\r
index db5258fbc9f07d29e39bb349d86fe7a0dce63846..afce28a38404dfbd35a39730ef614beb61528ca8 100644 (file)
 #include "gpu/host_buffer.h"\r
 #include "gpu/device_buffer.h"\r
 \r
+#include <core/producer/frame/frame_visitor.h>\r
 #include <core/producer/frame/pixel_format.h>\r
 \r
-#include <common/gl/gl_check.h>\r
-\r
-#include <boost/range/algorithm.hpp>\r
-\r
 namespace caspar { namespace core {\r
                                                                                                                                                                                                                                                                                                                        \r
 struct write_frame::implementation : boost::noncopyable\r
index 35640605e29c11341d6bc8d8b620f36767b7b357..893e859ad79ba627d97e0a74f634fc77f1c52877 100644 (file)
@@ -20,9 +20,8 @@
 #pragma once\r
 \r
 #include <common/memory/safe_ptr.h>\r
+\r
 #include <core/producer/frame/basic_frame.h>\r
-#include <core/producer/frame/frame_visitor.h>\r
-#include <core/producer/frame/pixel_format.h>\r
 \r
 #include <boost/noncopyable.hpp>\r
 #include <boost/range/iterator_range.hpp>\r
@@ -34,6 +33,8 @@ namespace caspar { namespace core {
 \r
 class host_buffer;\r
 class device_buffer;\r
+struct frame_visitor;\r
+struct pixel_format_desc;\r
        \r
 class write_frame : public core::basic_frame, boost::noncopyable\r
 {\r