]> git.sesse.net Git - casparcg/commitdiff
2.0.0.2: Header refactoring.
authorronag <ronag@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Wed, 9 Mar 2011 21:40:17 +0000 (21:40 +0000)
committerronag <ronag@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Wed, 9 Mar 2011 21:40:17 +0000 (21:40 +0000)
git-svn-id: https://casparcg.svn.sourceforge.net/svnroot/casparcg/server/branches/2.0.0.2@547 362d55ac-95cf-4e76-9f9a-cbaa9c17b72d

25 files changed:
core/channel.cpp
core/producer/frame/basic_frame.cpp
core/producer/frame/frame_factory.h
core/producer/frame/frame_visitor.h
core/producer/frame/image_transform.h
core/producer/frame/write_frame.h
core/producer/layer.cpp
core/producer/layer.h
mixer/frame_mixer_device.cpp
mixer/frame_mixer_device.h
mixer/fwd.h [deleted file]
mixer/gpu/gpu_write_frame.h
mixer/image/image_kernel.cpp
mixer/image/image_kernel.h
mixer/image/image_mixer.cpp
mixer/image/image_mixer.h
mixer/mixer.vcxproj
mixer/mixer.vcxproj.filters
modules/decklink/decklink.vcxproj
modules/decklink/interop/DeckLinkAPI_h.h
modules/decklink/interop/DeckLinkAPI_i.c
modules/ffmpeg/producer/ffmpeg_producer.cpp
modules/ffmpeg/producer/video/video_decoder.cpp
modules/flash/producer/flash_producer.cpp
modules/image/producer/image_producer.cpp

index 8df4c01e8633930869f2324b25a6a2046c36c4ef..a34abec802bec050e7e9bbb3658fbad1e3dcf3d3 100644 (file)
@@ -38,13 +38,12 @@ public:
        implementation(int index, const video_format_desc& format_desc)  \r
                : index_(index)\r
                , format_desc_(format_desc)\r
-               , consumer_(new frame_consumer_device(std::bind(&implementation::print, this), format_desc))\r
-               , mixer_(new frame_mixer_device(std::bind(&implementation::print, this), format_desc))\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<basic_frame>>& frames){mixer_->send(frames);});\r
-       }\r
+               , consumer_(new frame_consumer_device([=]{return print();}, format_desc))\r
+               , mixer_(new frame_mixer_device([=]{return print();}, format_desc))\r
+               , producer_(new frame_producer_device([=]{return print();}, safe_ptr<frame_factory>(mixer_)))   \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<basic_frame>>& frames){mixer_->send(frames);}))\r
+       {}\r
                \r
        std::wstring print() const\r
        {\r
index 6aa7c4fca16900a6e1a1e1e7d54f2df43ae77048..7bfb4d939112a329811e1443ac20489ee82ee9bf 100644 (file)
@@ -28,7 +28,7 @@ public:
                : frames_(std::move(frames))\r
                , index_(std::numeric_limits<int>::min()) {}\r
        \r
-       void accept(basic_frame& self, frame_visitor& visitor)\r
+       void accept(const basic_frame& self, frame_visitor& visitor)\r
        {\r
                visitor.begin(self);\r
                BOOST_FOREACH(auto frame, frames_)\r
index 53b5ddced3b0f3b0937a655bd86ade4e5a3c971b..856c9fb6ca0afb8003e28dbaafa3108d4049d28f 100644 (file)
 */\r
 #pragma once\r
 \r
-#include "write_frame.h"\r
-\r
 #include "pixel_format.h"\r
-#include "../../video_format.h"\r
 \r
 #include <common/memory/safe_ptr.h>\r
 \r
 #include <boost/noncopyable.hpp>\r
 \r
 namespace caspar { namespace core {\r
+       \r
+class write_frame;\r
+struct pixel_format_desc;\r
+struct video_format_desc;\r
                \r
 struct frame_factory : boost::noncopyable\r
 {\r
index fa356ba5ddef7e8ff8c1bd865022fc47af6f5703..5962be42d789d66d355d80494a8717f6f7fc3910 100644 (file)
@@ -8,8 +8,8 @@ class write_frame;
 struct frame_visitor\r
 {\r
        virtual void begin(const basic_frame& frame) = 0;\r
-       virtual void visit(write_frame& frame) = 0;\r
        virtual void end() = 0;\r
+       virtual void visit(write_frame& frame) = 0;\r
 };\r
 \r
 }}
\ No newline at end of file
index 391473caddc6239a9556fe650f77d485e83f7d5e..e48f3fc79e4eedbc7b5ed0ddd2734382e8aba63a 100644 (file)
@@ -2,11 +2,6 @@
 \r
 #include <core/video_format.h>\r
 \r
-#include <boost/tuple/tuple.hpp>\r
-#include <boost/thread/future.hpp>\r
-#include <boost/noncopyable.hpp>\r
-\r
-#include <memory>\r
 #include <array>\r
 \r
 namespace caspar { namespace core {\r
index 7eeab259dfbbfc7ded5b23226aa05fed98583324..1265959d599a6b1313c37c5afe9ecfba1503d463 100644 (file)
@@ -12,8 +12,6 @@
 \r
 namespace caspar { namespace core {\r
        \r
-struct pixel_format_desc;\r
-\r
 class write_frame : public basic_frame, boost::noncopyable\r
 {\r
 public:                        \r
@@ -28,7 +26,5 @@ public:
        virtual void tag(int tag) = 0;\r
        virtual int tag() const = 0;\r
 };\r
-typedef std::shared_ptr<write_frame> write_frame_impl_ptr;\r
-\r
 \r
 }}
\ No newline at end of file
index e2b7f5929a46790bcc9377bf5deed94686e6cc9b..b50d08a4dcdb177d580132bf405e771a2e8a8962 100644 (file)
@@ -3,9 +3,8 @@
 #include "layer.h"\r
 #include "frame_producer.h"\r
 \r
-#include "../video_format.h"\r
-\r
 #include <common/concurrency/executor.h>\r
+#include <common/exception/exceptions.h>\r
 #include <common/utility/assert.h>\r
 #include <common/utility/printer.h>\r
 \r
@@ -19,7 +18,6 @@ namespace caspar { namespace core {
 class frame_producer_remover\r
 {\r
        executor executor_;\r
-       tbb::atomic<int> count_;\r
 \r
        void do_remove(safe_ptr<frame_producer>& producer)\r
        {\r
@@ -27,12 +25,12 @@ class frame_producer_remover
                producer = frame_producer::empty();\r
                CASPAR_LOG(info) << name << L" Removed.";\r
        }\r
+\r
 public:\r
 \r
-       frame_producer_remover()\r
+       frame_producer_remover() : executor_(L"frame_producer_remover")\r
        {\r
                executor_.start();\r
-               count_ = 0;\r
        }\r
 \r
        void remove(safe_ptr<frame_producer>&& producer)\r
@@ -44,7 +42,6 @@ public:
 \r
 frame_producer_remover g_remover;\r
 \r
-\r
 struct layer::implementation : boost::noncopyable\r
 {                              \r
        mutable tbb::spin_mutex         printer_mutex_;\r
@@ -121,7 +118,7 @@ public:
 \r
                                auto following = foreground_->get_following_producer();\r
                                following->set_leading_producer(foreground_);\r
-                               following->set_parent_printer(boost::bind(&implementation::print, this));\r
+                               following->set_parent_printer([=]{return print();});\r
                                g_remover.remove(std::move(foreground_));\r
                                foreground_ = following;\r
                                CASPAR_LOG(info) << foreground_->print() << L" Added.";\r
index a526764093e504226b33453663af7e93cfdc04f7..6b3635db2fba6b12ff77024a40a2acc5712f17de 100644 (file)
@@ -5,9 +5,8 @@
 \r
 #include <boost/noncopyable.hpp>\r
 \r
-#include <tbb/atomic.h>\r
-\r
 #include <memory>\r
+#include <numeric>\r
 \r
 namespace caspar { namespace core {\r
 \r
index e5995be7a9d3bc24e4651f09bed6e6c628947be6..84bb404b70e7e8c16e45631ea994f0b32f2d6248 100644 (file)
 #include <common/diagnostics/graph.h>\r
 #include <common/utility/assert.h>\r
 #include <common/utility/timer.h>\r
-#include <common/gl/gl_check.h>\r
 \r
 #include <core/video_format.h>\r
 \r
-#include <tbb/concurrent_queue.h>\r
-#include <tbb/concurrent_unordered_map.h>\r
-\r
-#include <boost/range/algorithm.hpp>\r
-\r
 #include <unordered_map>\r
 \r
 namespace caspar { namespace core {\r
@@ -100,8 +94,11 @@ public:
                return output_.connect(subscriber);\r
        }\r
 \r
-       boost::unique_future<safe_ptr<const host_buffer>> mix_image(const std::vector<safe_ptr<basic_frame>>& frames)\r
+       boost::unique_future<safe_ptr<const host_buffer>> mix_image(std::vector<safe_ptr<basic_frame>> frames)\r
        {\r
+               frames.erase(std::remove(frames.begin(), frames.end(), basic_frame::empty()), frames.end());\r
+               frames.erase(std::remove(frames.begin(), frames.end(), basic_frame::eof()), frames.end());\r
+\r
                auto image = image_mixer_.begin_pass();\r
                BOOST_FOREACH(auto& frame, frames)\r
                {\r
index 131cc703eac3ed01a9657f45d9c0aae241baf77d..897773ca5ed5c8d8b7fb18a981c2931cee5752cc 100644 (file)
 */\r
 #pragma once\r
 \r
-#include "fwd.h"\r
-\r
-#include <core/video_format.h>\r
-#include <core/producer/frame/pixel_format.h>\r
 #include <core/producer/frame/frame_factory.h>\r
+#include <core/producer/frame/pixel_format.h>\r
 \r
 #include "image/image_mixer.h"\r
 #include "audio/audio_mixer.h"\r
 \r
-#include "gpu/gpu_write_frame.h"\r
-\r
 #include <common/memory/safe_ptr.h>\r
 #include <common/utility/printer.h>\r
 \r
-#include <core/video_format.h>\r
-\r
 #include <boost/signals2.hpp>\r
 \r
 #include <functional>\r
 \r
 namespace caspar { namespace core {\r
        \r
-struct video_format;\r
+struct video_format_desc;\r
+class read_frame;\r
+class write_frame;\r
 \r
 class frame_mixer_device : public frame_factory\r
 {\r
diff --git a/mixer/fwd.h b/mixer/fwd.h
deleted file mode 100644 (file)
index 3181e5b..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-#pragma once\r
-\r
-#include <memory>\r
-\r
-namespace caspar { namespace core {\r
-       \r
-class read_frame;\r
-class write_frame;\r
-class basic_frame;\r
-\r
-class image_mixer;\r
-struct frame_factory;\r
-class audio_mixer;\r
-class frame_mixer_device;\r
-\r
-struct pixel_format_desc;\r
-\r
-}}
\ No newline at end of file
index 93971ee4c7468232a0d7aaf4fb06494264c4e6b4..08309be4dce36dfd39bf56317d79e0bcdec29de8 100644 (file)
@@ -1,9 +1,7 @@
 #pragma once\r
 \r
-#include "../fwd.h"\r
-\r
+#include <common/memory/safe_ptr.h>\r
 #include <core/producer/frame/write_frame.h>\r
-#include <core/video_format.h>\r
 \r
 #include "../gpu/host_buffer.h"\r
 \r
index 4f2dc6e71141b910fa4a7913022b0cfae660d993..c379aef6668b3e6e036a967adb21af4ba0df78fb 100644 (file)
@@ -5,6 +5,8 @@
 #include <common/exception/exceptions.h>\r
 #include <common/gl/gl_check.h>\r
 \r
+#include <core/video_format.h>\r
+#include <core/producer/frame/pixel_format.h>\r
 #include <core/producer/frame/image_transform.h>\r
 \r
 #include <Glee.h>\r
 \r
 namespace caspar { namespace core {\r
 \r
-class shader_program\r
+class shader_program : boost::noncopyable\r
 {\r
        GLuint program_;\r
 public:\r
 \r
        shader_program() : program_(0) {}\r
+       shader_program(shader_program&& other) : program_(other.program_){other.program_ = 0;}\r
        shader_program(const std::string& vertex_source_str, const std::string& fragment_source_str) : program_(0)\r
        {\r
                GLint success;\r
@@ -130,7 +133,7 @@ GLubyte lower_pattern[] = {
        0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,\r
        0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff};\r
 \r
-struct image_kernel::implementation\r
+struct image_kernel::implementation : boost::noncopyable\r
 {      \r
        std::unordered_map<pixel_format::type, shader_program> shaders_;\r
 \r
index 6a8ba62cb81e785fa68a77bfb7c4624ffc39715d..0494c68e7a98432b632e9086a781aafc1f235101 100644 (file)
@@ -1,12 +1,11 @@
 #pragma once\r
 \r
-#include <core/video_format.h>\r
-#include <core/producer/frame/pixel_format.h>\r
-\r
 #include <memory>\r
 \r
 namespace caspar { namespace core {\r
 \r
+struct pixel_format_desc;\r
+class image_transform;\r
 class image_transform;\r
 \r
 class image_kernel\r
index d500c5a1b7587c49b388d91486045b5a1961dd80..f9da7d24b3c5c8cc387044e694b68b1f82ec4ce5 100644 (file)
@@ -8,16 +8,20 @@
 #include "../gpu/device_buffer.h"\r
 #include "../gpu/gpu_write_frame.h"\r
 \r
+#include <common/concurrency/executor.h>\r
 #include <common/exception/exceptions.h>\r
 #include <common/gl/gl_check.h>\r
-#include <common/concurrency/executor.h>\r
 \r
 #include <core/producer/frame/image_transform.h>\r
+#include <core/producer/frame/pixel_format.h>\r
+#include <core/video_format.h>\r
 \r
 #include <boost/cast.hpp>\r
 \r
 #include <Glee.h>\r
 #include <SFML/Window/Context.hpp>\r
+\r
+#include <array>\r
 #include <unordered_map>\r
 \r
 namespace caspar { namespace core {\r
index d52d063252fb1a7b00ff0b7584c48ab62410dbfe..9763f2d416562c1043cfa13fc006cbac195c5149 100644 (file)
@@ -4,8 +4,6 @@
 \r
 #include "../gpu/host_buffer.h"\r
 \r
-#include <core/video_format.h>\r
-\r
 #include <boost/noncopyable.hpp>\r
 #include <boost/thread/future.hpp>\r
 \r
@@ -14,6 +12,7 @@
 \r
 namespace caspar { namespace core {\r
 \r
+struct video_format_desc;\r
 struct pixel_format_desc;      \r
 class image_transform;\r
 \r
index b042b8f24e2140f73f7aaa03c0a42037bf003981..59e6251059f8fe6a715e6785913719fc58c4e726 100644 (file)
@@ -78,7 +78,6 @@
   <ItemGroup>\r
     <ClInclude Include="audio\audio_mixer.h" />\r
     <ClInclude Include="frame_mixer_device.h" />\r
-    <ClInclude Include="fwd.h" />\r
     <ClInclude Include="gpu\device_buffer.h" />\r
     <ClInclude Include="gpu\gpu_read_frame.h" />\r
     <ClInclude Include="gpu\gpu_write_frame.h" />\r
index fe292c8d7eb6fa8624b43e66bfd1d11c78f20974..69ea9fc8aad0638998a7160ed559e56cdc066fdc 100644 (file)
@@ -54,7 +54,6 @@
     </ClInclude>\r
     <ClInclude Include="StdAfx.h" />\r
     <ClInclude Include="frame_mixer_device.h" />\r
-    <ClInclude Include="fwd.h" />\r
     <ClInclude Include="image\image_kernel.h">\r
       <Filter>image</Filter>\r
     </ClInclude>\r
index e2d148f659e6208dd23ab4ad36acd242eb4cd080..a894d017eb49fec355c34e2b41af5d2cdd13f9df 100644 (file)
       <OutputDirectory Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">interop\</OutputDirectory>\r
       <OutputDirectory Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">interop\</OutputDirectory>\r
       <OutputDirectory Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">interop\</OutputDirectory>\r
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">true</ExcludedFromBuild>\r
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>\r
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Develop|Win32'">true</ExcludedFromBuild>\r
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>\r
     </Midl>\r
     <Midl Include="interop\DeckLinkAPI_v7_1.idl">\r
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">true</ExcludedFromBuild>\r
index c3f22b3110ba95e09270bcfd93bf18165fb1e253..97e1cb32a4b2da8a07424a7f8f3b8ad46eed9aea 100644 (file)
@@ -4,7 +4,7 @@
 \r
 \r
  /* File created by MIDL compiler version 7.00.0555 */\r
-/* at Wed Mar 09 13:57:51 2011\r
+/* at Wed Mar 09 22:31:19 2011\r
  */\r
 /* Compiler settings for interop\DeckLinkAPI.idl:\r
     Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 7.00.0555 \r
index 593305ff989d408e6af05dfc29356abd3f3466b2..8405ab0110e5b3b346a8cfb61f9ba15a3dcccab3 100644 (file)
@@ -6,7 +6,7 @@
 \r
 \r
  /* File created by MIDL compiler version 7.00.0555 */\r
-/* at Wed Mar 09 13:57:51 2011\r
+/* at Wed Mar 09 22:31:19 2011\r
  */\r
 /* Compiler settings for interop\DeckLinkAPI.idl:\r
     Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 7.00.0555 \r
index ddfcc8ac19a300bcf1b3136176f901b4b7be1b22..ea732513128996c8688509998984e7cc90275c1d 100644 (file)
@@ -10,6 +10,7 @@
 #include <common/diagnostics/graph.h>\r
 \r
 #include <core/producer/frame/basic_frame.h>\r
+#include <core/producer/frame/write_frame.h>\r
 #include <core/producer/frame/audio_transform.h>\r
 #include <core/video_format.h>\r
 \r
index 68c8d11d98b39db9c786c7df980f212cc8f9d978..638ddd0b458ac4a39903c28c04bfe18be5db2717 100644 (file)
@@ -7,6 +7,7 @@
 #include <core/video_format.h>\r
 \r
 #include <core/producer/frame/basic_frame.h>\r
+#include <core/producer/frame/write_frame.h>\r
 #include <core/producer/frame/image_transform.h>\r
 \r
 #include <tbb/parallel_for.h>\r
index 564d9ce58779d34ba2ba574a2806452717bc5996..033a5d9ced15f04530bee6f0e7687a0008b80e74 100644 (file)
@@ -30,7 +30,7 @@
 #include <core/video_format.h>\r
 \r
 #include <core/producer/frame/basic_frame.h>\r
-#include <mixer/frame_mixer_device.h>\r
+#include <core/producer/frame/write_frame.h>\r
 \r
 #include <common/concurrency/executor.h>\r
 #include <common/utility/timer.h>\r
index d315e88df74cfd643d4612c1ef011f84a90605c8..a222ff5f9a6263207b39719877a73cd3a743f982 100644 (file)
@@ -4,8 +4,8 @@
 \r
 #include <core/video_format.h>\r
 \r
-#include <mixer/frame_mixer_device.h>\r
 #include <core/producer/frame/basic_frame.h>\r
+#include <core/producer/frame/write_frame.h>\r
 \r
 #include <common/env.h>\r
 \r