]> git.sesse.net Git - casparcg/commitdiff
git-svn-id: https://casparcg.svn.sourceforge.net/svnroot/casparcg/server/branches...
authorronag <ronag@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Tue, 28 Dec 2010 15:38:41 +0000 (15:38 +0000)
committerronag <ronag@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Tue, 28 Dec 2010 15:38:41 +0000 (15:38 +0000)
19 files changed:
core/consumer/bluefish/bluefish_consumer.cpp
core/consumer/decklink/decklink_consumer.cpp
core/consumer/frame_consumer.h
core/consumer/frame_consumer_device.h
core/consumer/oal/oal_consumer.cpp
core/consumer/oal/oal_consumer.h
core/consumer/ogl/ogl_consumer.cpp
core/consumer/ogl/ogl_consumer.h
core/core.vcxproj
core/core.vcxproj.filters
core/producer/ffmpeg/input.cpp
core/producer/flash/cg_producer.cpp
core/producer/flash/cg_producer.h
core/producer/flash/ct_producer.cpp [deleted file]
core/producer/flash/ct_producer.h [deleted file]
core/producer/flash/flash_producer.cpp
core/producer/flash/flash_producer.h
core/producer/image/image_loader.cpp
core/protocol/media.cpp

index 4164011222b86366016a47569b3ae5675b992b54..df7f72470300380245bf88e814c4741d775a920e 100644 (file)
@@ -28,7 +28,9 @@
 #include "exception.h"\r
 #include "memory.h"\r
 \r
-#include "../../../common/concurrency/executor.h"\r
+#include "../../processor/read_frame.h"\r
+\r
+#include <common/concurrency/executor.h>\r
 \r
 #include <boost/optional/optional.hpp>\r
 \r
index f41e063c44897e5038bd67e88d9b1d3d8cc1cb52..cc5a2a552be3fc64e6a6b4d3d49ef0daafe3c57c 100644 (file)
@@ -32,6 +32,7 @@
 #include "DeckLinkAPI_h.h"\r
 \r
 #include "../../format/video_format.h"\r
+#include "../../processor/read_frame.h"\r
 \r
 #include <common/concurrency/executor.h>\r
 #include <common/exception/exceptions.h>\r
index 3cdd0ad0607f0d8bdc3f1f9f1eb444eba50ddaa6..f639b026ba50732e5cd594d249929db435b3970a 100644 (file)
 */\r
 #pragma once\r
 \r
-#include "../format/video_format.h"\r
-#include "../processor/read_frame.h"\r
+#include <common/utility/safe_ptr.h>\r
 \r
 #include <boost/noncopyable.hpp>\r
 \r
-#include <memory>\r
-\r
 namespace caspar { namespace core {\r
        \r
+class read_frame;\r
+\r
 struct frame_consumer : boost::noncopyable\r
 {\r
        enum sync_mode\r
@@ -42,10 +41,5 @@ struct frame_consumer : boost::noncopyable
        virtual sync_mode synchronize() = 0;\r
        virtual size_t buffer_depth() const = 0;\r
 };\r
-typedef std::shared_ptr<frame_consumer> frame_consumer_ptr;\r
-typedef std::shared_ptr<const frame_consumer> frame_consumer_const_ptr;\r
-\r
-typedef std::unique_ptr<frame_consumer> frame_consumer_uptr;\r
-typedef std::unique_ptr<const frame_consumer> frame_consumer_const_uptr;\r
 \r
 }}
\ No newline at end of file
index d98674e2fc38de386eb5205a698836d2ef5d99fe..1b100bcbdeb4fc4cdf119538d8f146075dba5f6f 100644 (file)
@@ -8,14 +8,10 @@
 \r
 #include <boost/noncopyable.hpp>\r
 \r
-#include <tbb/concurrent_queue.h>\r
-\r
-#include <boost/thread/future.hpp>\r
-\r
 namespace caspar { namespace core {\r
        \r
-class frame_processor_device;\r
 class draw_frame;\r
+struct video_format_desc;\r
 \r
 class frame_consumer_device : boost::noncopyable\r
 {\r
index eb1495467b36969211ff77b39ddbfff3b5856053..21970943db3653251e167d7658662d5b91723d66 100644 (file)
 \r
 #include "oal_consumer.h"\r
 \r
-#include "../../processor/write_frame.h"\r
 #include "../../format/video_format.h"\r
 \r
+#include "../../processor/read_frame.h"\r
+\r
 #include <SFML/Audio.hpp>\r
 \r
 #include <boost/circular_buffer.hpp>\r
index 171254fdd0db8054dec1d0efa862f420c555b42a..77c9daefa2dab5d7dfe4e16a7b20d733fce85761 100644 (file)
 */\r
 #pragma once\r
 \r
+#include "../../format/video_format.h"\r
 #include "../../consumer/frame_consumer.h"\r
 \r
 namespace caspar { namespace core { namespace oal {\r
-\r
+       \r
 class consumer : public frame_consumer\r
 {\r
 public:        \r
index daffec0d6739301d8d9350c3185bf51cda01eb66..19fb879b183373f6e2dfc7e5ba67c641f39342a2 100644 (file)
 #include "ogl_consumer.h"\r
 \r
 #include "../../format/video_format.h"\r
+#include "../../processor/read_frame.h"\r
 \r
 #include <common/gl/utility.h>\r
 #include <common/concurrency/executor.h>\r
+#include <common/utility/safe_ptr.h>\r
 \r
 #include <boost/thread.hpp>\r
 \r
index a5ec84c510e097c9b91490d1906c5d2f5b876b95..0111192c90b9d763e712809f472ba4df58bf8623 100644 (file)
@@ -20,6 +20,7 @@
 #pragma once\r
 \r
 #include "../../consumer/frame_consumer.h"\r
+#include "../../format/video_format.h"\r
 \r
 namespace caspar { namespace core { namespace ogl {\r
 \r
index 9b27df3d002f43434d3678b69e889121192977f4..ae4ef040c4c36f2501ae13fcdd72330debd5ee1d 100644 (file)
     <ClInclude Include="producer\ffmpeg\video\video_decoder.h" />\r
     <ClInclude Include="producer\flash\axflash.h" />\r
     <ClInclude Include="producer\flash\cg_producer.h" />\r
-    <ClInclude Include="producer\flash\ct_producer.h" />\r
     <ClInclude Include="producer\flash\FlashAxContainer.h" />\r
     <ClInclude Include="producer\flash\flash_producer.h" />\r
     <ClInclude Include="producer\flash\TimerHelper.h" />\r
       <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">../../stdAfx.h</PrecompiledHeaderFile>\r
       <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">../../stdAfx.h</PrecompiledHeaderFile>\r
     </ClCompile>\r
-    <ClCompile Include="producer\flash\ct_producer.cpp">\r
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">../../stdAfx.h</PrecompiledHeaderFile>\r
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">../../stdAfx.h</PrecompiledHeaderFile>\r
-    </ClCompile>\r
     <ClCompile Include="producer\flash\Flash9e_i.c">\r
       <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">../../stdAfx.h</PrecompiledHeaderFile>\r
       <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
index d7b61bbc04cc63f603ff5a88d25b8cc96a5cc14d..f2eb6f4e23a812c7c1afee51e668404ed82d8623 100644 (file)
     <ClInclude Include="producer\flash\cg_producer.h">\r
       <Filter>Source\channel\producer\flash</Filter>\r
     </ClInclude>\r
-    <ClInclude Include="producer\flash\ct_producer.h">\r
-      <Filter>Source\channel\producer\flash</Filter>\r
-    </ClInclude>\r
     <ClInclude Include="producer\flash\flash_producer.h">\r
       <Filter>Source\channel\producer\flash</Filter>\r
     </ClInclude>\r
     <ClCompile Include="producer\flash\cg_producer.cpp">\r
       <Filter>Source\channel\producer\flash</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="producer\flash\ct_producer.cpp">\r
-      <Filter>Source\channel\producer\flash</Filter>\r
-    </ClCompile>\r
     <ClCompile Include="producer\flash\flash_producer.cpp">\r
       <Filter>Source\channel\producer\flash</Filter>\r
     </ClCompile>\r
index 72743a45f318324068fffc4101e59d291e8110bf..9f59a17a5d1f488e824e59b02a8d28664bc8e997 100644 (file)
@@ -165,14 +165,7 @@ struct input::implementation : boost::noncopyable
                tbb::queuing_mutex::scoped_lock lock(seek_mutex_);\r
                if(av_seek_frame(format_context_.get(), -1, seek_target*AV_TIME_BASE, 0) < 0)\r
                        return false;\r
-               \r
-               video_packet_buffer_.clear();\r
-               audio_packet_buffer_.clear();\r
-               // TODO: Not sure its enough to just flush in input class\r
-               if(video_codec_context_)\r
-                       avcodec_flush_buffers(video_codec_context_.get());\r
-               if(audio_codex_context_)\r
-                       avcodec_flush_buffers(audio_codex_context_.get());\r
+\r
                return true;\r
        }\r
 \r
index c0f936b8132f409871a12e7a7c15ecdeb4936c53..bc3ff6fd4e300875a8e4effb69be2b206b6ed12e 100644 (file)
@@ -125,6 +125,18 @@ safe_ptr<cg_producer> get_default_cg_producer(const safe_ptr<channel>& channel,
        }\r
 }\r
 \r
+safe_ptr<frame_producer> create_ct_producer(const std::vector<std::wstring>& params) \r
+{\r
+       std::wstring filename = params[0] + L".ct";\r
+       if(!boost::filesystem::exists(filename))\r
+               return frame_producer::empty();\r
+\r
+       auto producer = make_safe<cg_producer>();\r
+       producer->add(0, filename, 1);\r
+\r
+       return producer;\r
+}\r
+\r
 cg_producer::cg_producer() : impl_(new implementation()){}\r
 cg_producer::cg_producer(cg_producer&& other) : impl_(std::move(other.impl_)){}\r
 safe_ptr<draw_frame> cg_producer::receive(){return impl_->receive();}\r
index ab29d08c859ac9751f9e4341da917a9918bba8f4..8f67cfab9b478beef1c6ab73be4ccf65e4d7bb02 100644 (file)
@@ -35,4 +35,6 @@ private:
 \r
 safe_ptr<cg_producer> get_default_cg_producer(const safe_ptr<channel>& channel, int layer_index = cg_producer::DEFAULT_LAYER);\r
 \r
+safe_ptr<frame_producer> create_ct_producer(const std::vector<std::wstring>& params);\r
+\r
 }}}
\ No newline at end of file
diff --git a/core/producer/flash/ct_producer.cpp b/core/producer/flash/ct_producer.cpp
deleted file mode 100644 (file)
index 6e2e8fa..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-/*\r
-* copyright (c) 2010 Sveriges Television AB <info@casparcg.com>\r
-*\r
-*  This file is part of CasparCG.\r
-*\r
-*    CasparCG is free software: you can redistribute it and/or modify\r
-*    it under the terms of the GNU General Public License as published by\r
-*    the Free Software Foundation, either version 3 of the License, or\r
-*    (at your option) any later version.\r
-*\r
-*    CasparCG is distributed in the hope that it will be useful,\r
-*    but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
-*    GNU General Public License for more details.\r
-\r
-*    You should have received a copy of the GNU General Public License\r
-*    along with CasparCG.  If not, see <http://www.gnu.org/licenses/>.\r
-*\r
-*/\r
\r
-#include "../../stdafx.h"\r
-\r
-#include "ct_producer.h"\r
-\r
-#include "cg_producer.h"\r
-\r
-namespace caspar { namespace core { namespace flash {\r
-\r
-struct ct_producer : public cg_producer\r
-{\r
-       ct_producer(ct_producer&& other) : initialized_(std::move(other.initialized_)), filename_(std::move(other.filename_)){}\r
-       ct_producer(const std::wstring& filename) : filename_(filename), initialized_(false){}\r
-\r
-       virtual safe_ptr<draw_frame> receive()\r
-       {\r
-               if(!initialized_)\r
-               {\r
-                       cg_producer::add(0, filename_, 1);\r
-                       initialized_ = true;\r
-               }\r
-               return cg_producer::receive();\r
-       }\r
-\r
-       virtual std::wstring print() const\r
-       {\r
-               return L"ct[" + filename_ + L"]";\r
-       }\r
-\r
-       bool initialized_;\r
-       std::wstring filename_;\r
-};\r
-       \r
-safe_ptr<frame_producer> create_ct_producer(const std::vector<std::wstring>& params) \r
-{\r
-       std::wstring filename = params[0] + L".ct";\r
-       return boost::filesystem::exists(filename) ? make_safe<ct_producer>(filename) : frame_producer::empty();\r
-}\r
-\r
-}}}
\ No newline at end of file
diff --git a/core/producer/flash/ct_producer.h b/core/producer/flash/ct_producer.h
deleted file mode 100644 (file)
index 61890b8..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/*\r
-* copyright (c) 2010 Sveriges Television AB <info@casparcg.com>\r
-*\r
-*  This file is part of CasparCG.\r
-*\r
-*    CasparCG is free software: you can redistribute it and/or modify\r
-*    it under the terms of the GNU General Public License as published by\r
-*    the Free Software Foundation, either version 3 of the License, or\r
-*    (at your option) any later version.\r
-*\r
-*    CasparCG is distributed in the hope that it will be useful,\r
-*    but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
-*    GNU General Public License for more details.\r
-\r
-*    You should have received a copy of the GNU General Public License\r
-*    along with CasparCG.  If not, see <http://www.gnu.org/licenses/>.\r
-*\r
-*/\r
-#pragma once\r
-\r
-#include "../frame_producer.h"\r
-\r
-#include <common/utility/safe_ptr.h>\r
-\r
-#include <string>\r
-\r
-namespace caspar { namespace core { namespace flash{\r
-               \r
-safe_ptr<frame_producer> create_ct_producer(const std::vector<std::wstring>& params);\r
-\r
-}}}
\ No newline at end of file
index 25c169a83a8ab3e10643f2bc07c6d167ed1847c2..39a8bc36320518287cf1359c6702e745dccb7265 100644 (file)
@@ -144,7 +144,7 @@ public:
                if(ax_->IsReadyToRender() && ax_->InvalidRectangle())\r
                {\r
                        std::fill_n(bmp_data_, format_desc_.size, 0);                   \r
-                       //ax_->DrawControl((HDC)hdc_.get());\r
+                       ax_->DrawControl((HDC)hdc_.get());\r
                \r
                        auto frame = frame_processor_->create_frame();\r
                        std::copy_n(bmp_data_, format_desc_.size, frame->image_data().begin());\r
@@ -188,8 +188,6 @@ struct flash_producer::implementation
        {       \r
                if(!boost::filesystem::exists(filename))\r
                        BOOST_THROW_EXCEPTION(file_not_found() << boost::errinfo_file_name(narrow(filename)));\r
-\r
-               executor_.start();\r
        }\r
 \r
        ~implementation() \r
@@ -199,11 +197,10 @@ struct flash_producer::implementation
        \r
        void param(const std::wstring& param) \r
        {       \r
-               if(!factory_)\r
-                       BOOST_THROW_EXCEPTION(invalid_operation() << msg_info(narrow(print()) + "Uninitialized."));\r
-\r
-               executor_.invoke([&]\r
+               executor_.begin_invoke([=]\r
                {\r
+                       if(!factory_)\r
+                               BOOST_THROW_EXCEPTION(invalid_operation() << msg_info(narrow(print()) + "Uninitialized."));\r
                        if(!renderer_)\r
                        {\r
                                renderer_.reset(factory_());\r
@@ -240,6 +237,7 @@ struct flash_producer::implementation
        virtual void initialize(const safe_ptr<frame_processor_device>& frame_processor)\r
        {\r
                factory_ = [=]{return new flash_renderer(frame_processor, filename_);};\r
+               executor_.start();\r
        }\r
        \r
        std::wstring print() const{ return L"flash[" + boost::filesystem::wpath(filename_).filename() + L"]"; }\r
index 600f70d08bddc6d574a41f556af1abce091b065f..5d226fe7157ce40fd6c4c0f14545ff00ca02fdac 100644 (file)
@@ -25,9 +25,6 @@
 \r
 namespace caspar { namespace core { namespace flash {\r
 \r
-///=================================================================================================\r
-/// <summary>  Flash Producer. </summary>\r
-///=================================================================================================\r
 class flash_producer : public frame_producer\r
 {\r
 public:\r
@@ -46,7 +43,6 @@ public:
 private:       \r
        struct implementation;\r
        std::shared_ptr<implementation> impl_;\r
-\r
 };\r
 \r
 }}}
\ No newline at end of file
index ffa5c6b90294f591bd0d1a0f0be203e10bce162e..6b4ee26c443aa83ccc01c12c1b086ece61bec82e 100644 (file)
@@ -2,9 +2,7 @@
 \r
 #include "image_loader.h"\r
 \r
-#include "../../../common/exception/Exceptions.h"\r
-\r
-#include "../../processor/write_frame.h"\r
+#include <common/exception/Exceptions.h>\r
 \r
 #if defined(_MSC_VER)\r
 #pragma warning (disable : 4714) // marked as __forceinline not inlined\r
@@ -15,8 +13,6 @@
 \r
 namespace caspar { namespace core { namespace image{\r
 \r
-#include <boost/thread/once.hpp>\r
-\r
 struct FreeImage_initializer\r
 {\r
        FreeImage_initializer(){FreeImage_Initialise(true);}\r
@@ -37,7 +33,6 @@ std::shared_ptr<FIBITMAP> load_image(const std::string& filename)
                BOOST_THROW_EXCEPTION(invalid_argument() << msg_info("Unsupported image format."));\r
                \r
        auto bitmap = std::shared_ptr<FIBITMAP>(FreeImage_Load(fif, filename.c_str(), 0), FreeImage_Unload);\r
-       //FREE_IMAGE_TYPE ImageType = FreeImage_GetImageType(bitmap.get());\r
                  \r
        if(FreeImage_GetBPP(bitmap.get()) != 32)\r
        {\r
index cb3c24ec9e3793ca852aac162f9cbdaa141d6d4b..9ebebf13a1744777a2f5eca3e6e5aa68a7ad0cf2 100644 (file)
@@ -4,7 +4,7 @@
 \r
 #include "../producer/color/color_producer.h"\r
 #include "../producer/ffmpeg/ffmpeg_producer.h"\r
-#include "../producer/flash/ct_producer.h"\r
+#include "../producer/flash/cg_producer.h"\r
 #include "../producer/image/image_producer.h"\r
 //#include "../producer/image/image_scroll_producer.h"\r
 \r