]> git.sesse.net Git - casparcg/commitdiff
2.0.0.2:
authorronag <ronag@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Thu, 16 Dec 2010 21:41:19 +0000 (21:41 +0000)
committerronag <ronag@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Thu, 16 Dec 2010 21:41:19 +0000 (21:41 +0000)
  - Fixed some threading issues.
  - Renamed some functions and classes for clarity.

git-svn-id: https://casparcg.svn.sourceforge.net/svnroot/casparcg/server/branches/2.0.0.2@295 362d55ac-95cf-4e76-9f9a-cbaa9c17b72d

20 files changed:
core/core.vcxproj
core/core.vcxproj.filters
core/processor/audio_processor.cpp [new file with mode: 0644]
core/processor/audio_processor.h [new file with mode: 0644]
core/processor/composite_frame.cpp
core/processor/composite_frame.h
core/processor/draw_frame.h
core/processor/frame_processor_device.cpp
core/processor/fwd.h
core/processor/image_processor.cpp [moved from core/processor/frame_renderer.cpp with 75% similarity]
core/processor/image_processor.h [moved from core/processor/frame_renderer.h with 84% similarity]
core/processor/image_shader.cpp [moved from core/processor/frame_shader.cpp with 93% similarity]
core/processor/image_shader.h [moved from core/processor/frame_shader.h with 80% similarity]
core/processor/transform_frame.cpp
core/processor/transform_frame.h
core/processor/write_frame.cpp
core/processor/write_frame.h
core/producer/ffmpeg/input.cpp
core/producer/flash/flash_producer.cpp
shell/caspar.config

index 7731c402dee62cb4bcaa09aa7e3cb34300ab6bb7..a03479b9bbf990f4bf6e217dd2e0e41ff017f388 100644 (file)
     <ClInclude Include="consumer\ogl\ogl_consumer.h" />\r
     <ClInclude Include="format\pixel_format.h" />\r
     <ClInclude Include="format\video_format.h" />\r
+    <ClInclude Include="processor\audio_processor.h" />\r
     <ClInclude Include="processor\composite_frame.h" />\r
     <ClInclude Include="processor\frame_processor_device.h" />\r
-    <ClInclude Include="processor\frame_renderer.h" />\r
-    <ClInclude Include="processor\frame_shader.h" />\r
+    <ClInclude Include="processor\image_processor.h" />\r
+    <ClInclude Include="processor\image_shader.h" />\r
     <ClInclude Include="processor\fwd.h" />\r
     <ClInclude Include="processor\draw_frame.h" />\r
     <ClInclude Include="processor\read_frame.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="processor\audio_processor.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="processor\composite_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)'=='Debug|Win32'">../StdAfx.h</PrecompiledHeaderFile>\r
       <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">../StdAfx.h</PrecompiledHeaderFile>\r
     </ClCompile>\r
-    <ClCompile Include="processor\frame_renderer.cpp">\r
+    <ClCompile Include="processor\image_processor.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="processor\frame_shader.cpp">\r
+    <ClCompile Include="processor\image_shader.cpp">\r
       <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">../StdAfx.h</PrecompiledHeaderFile>\r
       <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">../StdAfx.h</PrecompiledHeaderFile>\r
     </ClCompile>\r
index b3719eb4c08a2b22315bac6846bd48c028f7c862..789c0911c54ac254271183b9bda12dae2c28f1d7 100644 (file)
@@ -28,9 +28,6 @@
     <Filter Include="Source\channel\processor">\r
       <UniqueIdentifier>{53e41831-70b4-4214-bc38-77e0d7aa288b}</UniqueIdentifier>\r
     </Filter>\r
-    <Filter Include="Source\channel\processor\renderer">\r
-      <UniqueIdentifier>{30fe40ca-8bf0-4a46-a882-16d07b2b441e}</UniqueIdentifier>\r
-    </Filter>\r
     <Filter Include="Source\channel\consumer">\r
       <UniqueIdentifier>{35d7835f-f813-4b4b-8d8d-8a35dfef68d3}</UniqueIdentifier>\r
     </Filter>\r
     <Filter Include="Source\channel\producer\ffmpeg\io">\r
       <UniqueIdentifier>{eaa43a39-9ff0-4291-b717-4d4231d8295a}</UniqueIdentifier>\r
     </Filter>\r
+    <Filter Include="Source\channel\processor\image">\r
+      <UniqueIdentifier>{30fe40ca-8bf0-4a46-a882-16d07b2b441e}</UniqueIdentifier>\r
+    </Filter>\r
+    <Filter Include="Source\channel\processor\audio">\r
+      <UniqueIdentifier>{43ca44bb-d718-44df-9342-1913750f7e41}</UniqueIdentifier>\r
+    </Filter>\r
   </ItemGroup>\r
   <ItemGroup>\r
     <ClInclude Include="StdAfx.h">\r
     <ClInclude Include="processor\frame_processor_device.h">\r
       <Filter>Source\channel\processor</Filter>\r
     </ClInclude>\r
-    <ClInclude Include="processor\frame_shader.h">\r
-      <Filter>Source\channel\processor\renderer</Filter>\r
-    </ClInclude>\r
-    <ClInclude Include="processor\frame_renderer.h">\r
-      <Filter>Source\channel\processor\renderer</Filter>\r
-    </ClInclude>\r
     <ClInclude Include="format\pixel_format.h">\r
       <Filter>Source\channel\format</Filter>\r
     </ClInclude>\r
     <ClInclude Include="processor\draw_frame.h">\r
       <Filter>Source\channel\processor\frame</Filter>\r
     </ClInclude>\r
+    <ClInclude Include="processor\image_shader.h">\r
+      <Filter>Source\channel\processor\image</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="processor\image_processor.h">\r
+      <Filter>Source\channel\processor\image</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="processor\audio_processor.h">\r
+      <Filter>Source\channel\processor\audio</Filter>\r
+    </ClInclude>\r
   </ItemGroup>\r
   <ItemGroup>\r
     <ClCompile Include="StdAfx.cpp">\r
     <ClCompile Include="processor\frame_processor_device.cpp">\r
       <Filter>Source\channel\processor</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="processor\frame_renderer.cpp">\r
-      <Filter>Source\channel\processor\renderer</Filter>\r
-    </ClCompile>\r
-    <ClCompile Include="processor\frame_shader.cpp">\r
-      <Filter>Source\channel\processor\renderer</Filter>\r
-    </ClCompile>\r
     <ClCompile Include="format\video_format.cpp">\r
       <Filter>Source\channel\format</Filter>\r
     </ClCompile>\r
     <ClCompile Include="format\pixel_format.cpp">\r
       <Filter>Source\channel\format</Filter>\r
     </ClCompile>\r
+    <ClCompile Include="processor\image_shader.cpp">\r
+      <Filter>Source\channel\processor\image</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="processor\image_processor.cpp">\r
+      <Filter>Source\channel\processor\image</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="processor\audio_processor.cpp">\r
+      <Filter>Source\channel\processor\audio</Filter>\r
+    </ClCompile>\r
   </ItemGroup>\r
   <ItemGroup>\r
     <Midl Include="consumer\decklink\DeckLinkAPI_v7_3.idl">\r
diff --git a/core/processor/audio_processor.cpp b/core/processor/audio_processor.cpp
new file mode 100644 (file)
index 0000000..e16a5c9
--- /dev/null
@@ -0,0 +1,7 @@
+#include "../stdafx.h"\r
+\r
+#include "audio_processor.h"\r
+\r
+namespace caspar { namespace core {\r
+\r
+}}
\ No newline at end of file
diff --git a/core/processor/audio_processor.h b/core/processor/audio_processor.h
new file mode 100644 (file)
index 0000000..52e1783
--- /dev/null
@@ -0,0 +1,12 @@
+#pragma once\r
+\r
+namespace caspar { namespace core {\r
+\r
+class audio_processor\r
+{\r
+public:\r
+\r
+private:\r
+};\r
+\r
+}}
\ No newline at end of file
index 5f274d73c0e2a5265a4ad39151620b6642d2ebfb..0e91b7cbc1a95e3fdb6b45bca49c204fa65d337a 100644 (file)
@@ -3,7 +3,7 @@
 #include "draw_frame.h"\r
 #include "composite_frame.h"\r
 #include "transform_frame.h"\r
-#include "frame_shader.h"\r
+#include "image_shader.h"\r
 #include "../../common/utility/singleton_pool.h"\r
 \r
 #include <boost/range/algorithm.hpp>\r
@@ -43,7 +43,7 @@ struct composite_frame::implementation : public draw_frame_decorator
                boost::range::for_each(frames_, std::bind(&draw_frame_decorator::unmap, std::placeholders::_1));\r
        }\r
                \r
-       void draw(frame_shader& shader)\r
+       void draw(image_shader& shader)\r
        {\r
                boost::range::for_each(frames_, std::bind(&draw_frame_decorator::draw, std::placeholders::_1, std::ref(shader)));\r
        }\r
@@ -84,7 +84,7 @@ composite_frame::composite_frame(safe_ptr<draw_frame>&& frame1, safe_ptr<draw_fr
 }\r
 \r
 void composite_frame::unmap(){impl_->unmap();}\r
-void composite_frame::draw(frame_shader& shader){impl_->draw(shader);}\r
+void composite_frame::draw(image_shader& shader){impl_->draw(shader);}\r
 const std::vector<short>& composite_frame::audio_data() const {return impl_->audio_data();}\r
 \r
 safe_ptr<composite_frame> composite_frame::interlace(safe_ptr<draw_frame>&& frame1, safe_ptr<draw_frame>&& frame2, video_mode::type mode)\r
index 838a187cfd99ddf517d37ae3aca955f3af862198..d4c86e3d417a529920ef0079517442d9ce8d15a4 100644 (file)
@@ -31,7 +31,7 @@ public:
 \r
 private:       \r
        virtual void unmap();\r
-       virtual void draw(frame_shader& shader);\r
+       virtual void draw(image_shader& shader);\r
 \r
        struct implementation;\r
        std::shared_ptr<implementation> impl_;\r
index a61218b44b39da323c3f0540fccb0e951a9fa84e..9c9321d702f29d7c290581c894c60997a202b087 100644 (file)
@@ -19,7 +19,7 @@ struct draw_frame_decorator;
 class draw_frame : boost::noncopyable\r
 {      \r
        friend struct draw_frame_decorator;\r
-       friend class frame_renderer;\r
+       friend class image_processor;\r
 public:\r
        virtual ~draw_frame(){}\r
 \r
@@ -35,7 +35,7 @@ public:
                                return audio_data;\r
                        }\r
                        virtual void unmap(){}\r
-                       virtual void draw(frame_shader&){}\r
+                       virtual void draw(image_shader&){}\r
                };\r
                static safe_ptr<draw_frame> frame = make_safe<eof_frame>();\r
                return frame;\r
@@ -51,21 +51,21 @@ public:
                                return audio_data;\r
                        }\r
                        virtual void unmap(){}\r
-                       virtual void draw(frame_shader&){}\r
+                       virtual void draw(image_shader&){}\r
                };\r
                static safe_ptr<draw_frame> frame = make_safe<empty_frame>();\r
                return frame;\r
        }\r
 private:\r
        virtual void unmap() = 0;\r
-       virtual void draw(frame_shader& shader) = 0;\r
+       virtual void draw(image_shader& shader) = 0;\r
 };\r
 \r
 struct draw_frame_decorator\r
 {\r
 protected:\r
        static void unmap(const safe_ptr<draw_frame>& frame) {frame->unmap();}\r
-       static void draw(const safe_ptr<draw_frame>& frame, frame_shader& shader) {frame->draw(shader);}\r
+       static void draw(const safe_ptr<draw_frame>& frame, image_shader& shader) {frame->draw(shader);}\r
 };\r
 \r
 \r
index 78b108d5f36906b694bd44c8654835c7ac0c83b4..6809dcdd84a741dc9f5b994a924fa064d81e7fa7 100644 (file)
@@ -2,7 +2,7 @@
 \r
 #include "frame_processor_device.h"\r
 \r
-#include "frame_renderer.h"\r
+#include "image_processor.h"\r
 #include "write_frame.h"\r
 #include "read_frame.h"\r
 \r
@@ -30,12 +30,12 @@ struct frame_processor_device::implementation : boost::noncopyable
        {               \r
                output_.set_capacity(3);\r
                executor_.start();\r
-               executor_.invoke([=]{renderer_.reset(new frame_renderer(format_desc));});\r
+               executor_.invoke([=]{image_processor_.reset(new image_processor(format_desc));});\r
        }\r
                                \r
        void send(safe_ptr<draw_frame>&& frame)\r
        {                       \r
-               output_.push(executor_.begin_invoke([=]{return renderer_->render(safe_ptr<draw_frame>(frame));})); // Blocks\r
+               output_.push(executor_.begin_invoke([=]{return image_processor_->render(safe_ptr<draw_frame>(frame));})); // Blocks\r
        }\r
 \r
        safe_ptr<const read_frame> receive()\r
@@ -61,7 +61,7 @@ struct frame_processor_device::implementation : boost::noncopyable
                                \r
        executor executor_;     \r
 \r
-       std::unique_ptr<frame_renderer> renderer_;      \r
+       std::unique_ptr<image_processor> image_processor_;      \r
                                \r
        tbb::concurrent_bounded_queue<output_type> output_;     \r
        tbb::concurrent_unordered_map<pixel_format_desc, tbb::concurrent_bounded_queue<std::shared_ptr<write_frame>>, std::hash<pixel_format_desc>> pools_;\r
index fafc5617738bb383b243364750363095db27063d..854eaf43b67b505846e12c1b23c0bf0c3e8f63d5 100644 (file)
@@ -13,7 +13,7 @@ class draw_frame;
 class transform_frame;\r
 class composite_frame;\r
 \r
-class frame_shader;\r
-class frame_renderer;\r
+class image_shader;\r
+class image_processor;\r
 class frame_processor_device;\r
 }}
\ No newline at end of file
similarity index 75%
rename from core/processor/frame_renderer.cpp
rename to core/processor/image_processor.cpp
index d4b00eccd67b7594e6193f4bc6849e458e6d8b85..b485eba195245def999da4004d0944b7db79a511 100644 (file)
@@ -1,8 +1,8 @@
 #include "../StdAfx.h"\r
 \r
-#include "frame_renderer.h"\r
+#include "image_processor.h"\r
 \r
-#include "frame_shader.h"\r
+#include "image_shader.h"\r
 #include "write_frame.h"\r
 #include "read_frame.h"\r
 \r
@@ -30,7 +30,7 @@ struct ogl_context
        sf::Context context_;\r
 };\r
 \r
-struct frame_renderer::implementation : boost::noncopyable\r
+struct image_processor::implementation : boost::noncopyable\r
 {              \r
        implementation(const video_format_desc& format_desc) : shader_(format_desc), format_desc_(format_desc),\r
                fbo_(format_desc.width, format_desc.height), writing_(draw_frame::empty()), reading_(create_reading())\r
@@ -41,18 +41,18 @@ struct frame_renderer::implementation : boost::noncopyable
        safe_ptr<const read_frame> render(safe_ptr<draw_frame>&& frame)\r
        {                                                               \r
                frame->unmap(); // Start transfer from system memory to texture. End with draw in next tick.\r
-                                               \r
+\r
                reading_->map(); // Map texture to system memory.\r
                auto result = reading_;\r
-                                               \r
+\r
                GL(glClear(GL_COLOR_BUFFER_BIT));\r
-                                               \r
+\r
                writing_->draw(shader_); // Draw to frame buffer.\r
-               writing_ = frame;                               \r
+               writing_ = frame;\r
 \r
                reading_ = create_reading();\r
                reading_->unmap(); // Start transfer from frame buffer to texture. End with map in next tick.\r
-               reading_->audio_data(writing_->audio_data());                                           \r
+               reading_->audio_data(writing_->audio_data());\r
 \r
                return result;\r
        }\r
@@ -71,12 +71,12 @@ struct frame_renderer::implementation : boost::noncopyable
 \r
        tbb::concurrent_bounded_queue<std::shared_ptr<read_frame>> pool_;\r
        \r
-       safe_ptr<read_frame>    reading_;       \r
+       safe_ptr<read_frame>    reading_;\r
        safe_ptr<draw_frame>    writing_;\r
-       \r
-       frame_shader shader_;\r
+\r
+       image_shader shader_;\r
 };\r
        \r
-frame_renderer::frame_renderer(const video_format_desc& format_desc) : impl_(new implementation(format_desc)){}\r
-safe_ptr<const read_frame> frame_renderer::render(safe_ptr<draw_frame>&& frame){return impl_->render(std::move(frame));}\r
+image_processor::image_processor(const video_format_desc& format_desc) : impl_(new implementation(format_desc)){}\r
+safe_ptr<const read_frame> image_processor::render(safe_ptr<draw_frame>&& frame){return impl_->render(std::move(frame));}\r
 }}
\ No newline at end of file
similarity index 84%
rename from core/processor/frame_renderer.h
rename to core/processor/image_processor.h
index b579e9cee557785b7e101d65e65cebb6dbe234e3..a2af401feef3afe806a0964ef6d477cb5cef68f0 100644 (file)
 \r
 namespace caspar { namespace core {\r
 \r
-class frame_renderer : boost::noncopyable\r
+class image_processor : boost::noncopyable\r
 {\r
 public:\r
-       frame_renderer(const video_format_desc& format_desc_);\r
+       image_processor(const video_format_desc& format_desc_);\r
                \r
        safe_ptr<const read_frame> render(safe_ptr<draw_frame>&& frame);\r
 private:\r
        struct implementation;\r
        std::shared_ptr<implementation> impl_;\r
 };\r
-typedef std::shared_ptr<frame_renderer> frame_renderer_ptr;\r
+typedef std::shared_ptr<image_processor> image_processor_ptr;\r
 \r
 }}
\ No newline at end of file
similarity index 93%
rename from core/processor/frame_shader.cpp
rename to core/processor/image_shader.cpp
index 91fc406fbbd30605c34224d82d2b40e1745fa418..676fc2ff9644e504b336770f34d05c397f2dc76b 100644 (file)
@@ -1,6 +1,6 @@
 #include "../StdAfx.h"\r
 \r
-#include "frame_shader.h"\r
+#include "image_shader.h"\r
 \r
 #include "../../common/exception/exceptions.h"\r
 #include "../../common/gl/utility.h"\r
@@ -32,7 +32,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 frame_shader::implementation : boost::noncopyable\r
+struct image_shader::implementation : boost::noncopyable\r
 {\r
        implementation(const video_format_desc& format_desc) : current_(pixel_format::invalid), alpha_(1.0)\r
        {\r
@@ -181,8 +181,8 @@ struct frame_shader::implementation : boost::noncopyable
        std::unordered_map<pixel_format::type, gl::shader_program> shaders_;\r
 };\r
 \r
-frame_shader::frame_shader(const video_format_desc& format_desc) : impl_(new implementation(format_desc)){}\r
-void frame_shader::begin(const shader_transform& transform) {impl_->begin(transform);}\r
-void frame_shader::render(const pixel_format_desc& desc){impl_->render(desc);}\r
-void frame_shader::end(){impl_->end();}\r
+image_shader::image_shader(const video_format_desc& format_desc) : impl_(new implementation(format_desc)){}\r
+void image_shader::begin(const shader_transform& transform) {impl_->begin(transform);}\r
+void image_shader::render(const pixel_format_desc& desc){impl_->render(desc);}\r
+void image_shader::end(){impl_->end();}\r
 }}
\ No newline at end of file
similarity index 80%
rename from core/processor/frame_shader.h
rename to core/processor/image_shader.h
index 9b3756a40850f805a208945cea2b4e7fb5eeabe5..209093b7a225394d8337795c3f6b0c424ee06d36 100644 (file)
@@ -19,10 +19,10 @@ struct shader_transform
        video_mode::type mode; \r
 };\r
 \r
-class frame_shader\r
+class image_shader\r
 {\r
 public:\r
-       frame_shader(const video_format_desc& format_desc);\r
+       image_shader(const video_format_desc& format_desc);\r
 \r
        void begin(const shader_transform& transform);\r
        void render(const pixel_format_desc& desc);\r
@@ -31,6 +31,6 @@ private:
        struct implementation;\r
        std::shared_ptr<implementation> impl_;\r
 };\r
-typedef std::shared_ptr<frame_shader> frame_shader_ptr;\r
+typedef std::shared_ptr<image_shader> image_shader_ptr;\r
 \r
 }}
\ No newline at end of file
index 382e8ac6f9a3405d8d7e64f0a37ec227fd65591e..3fbe84465c002d3b679004347ddbb1d3b09cc739 100644 (file)
@@ -3,7 +3,7 @@
 #include "transform_frame.h"\r
 \r
 #include "draw_frame.h"\r
-#include "frame_shader.h"\r
+#include "image_shader.h"\r
 \r
 #include "../format/pixel_format.h"\r
 #include "../../common/gl/utility.h"\r
@@ -24,7 +24,7 @@ struct transform_frame::implementation : public draw_frame_decorator
        \r
        void unmap(){draw_frame_decorator::unmap(frame_);}\r
 \r
-       void draw(frame_shader& shader)\r
+       void draw(image_shader& shader)\r
        {\r
                shader.begin(transform_);\r
                draw_frame_decorator::draw(frame_, shader);\r
@@ -79,7 +79,7 @@ transform_frame& transform_frame::operator=(transform_frame&& other)
        return *this;\r
 }\r
 void transform_frame::unmap(){impl_->unmap();} \r
-void transform_frame::draw(frame_shader& shader){impl_->draw(shader);}\r
+void transform_frame::draw(image_shader& shader){impl_->draw(shader);}\r
 void transform_frame::audio_volume(unsigned char volume){impl_->audio_volume(volume);}\r
 void transform_frame::translate(double x, double y){impl_->transform_.pos = boost::make_tuple(x, y);}\r
 void transform_frame::texcoord(double left, double top, double right, double bottom){impl_->transform_.uv = boost::make_tuple(left, top, right, bottom);}\r
index 4131285fa6e4976e04b70c29e90a3327b966ca97..ae5a231d023664ac98d20b6c62ace0e3d0187651 100644 (file)
@@ -43,7 +43,7 @@ public:
 private:\r
 \r
        virtual void unmap();\r
-       virtual void draw(frame_shader& shader);\r
+       virtual void draw(image_shader& shader);\r
 \r
        struct implementation;\r
        std::shared_ptr<implementation> impl_;\r
index e920aef516859b2d8c975f5d212ffceeca14ce58..2d2ded517e76205bd8f296526bfaa8ad59184ba4 100644 (file)
@@ -3,7 +3,7 @@
 #include "write_frame.h"\r
 \r
 #include "draw_frame.h"\r
-#include "frame_shader.h"\r
+#include "image_shader.h"\r
 \r
 #include "../format/pixel_format.h"\r
 #include "../../common/gl/utility.h"\r
@@ -38,7 +38,7 @@ struct write_frame::implementation : boost::noncopyable
                boost::range::for_each(pbos_, std::mem_fn(&gl::pbo::map_write));\r
        }\r
 \r
-       void draw(frame_shader& shader)\r
+       void draw(image_shader& shader)\r
        {\r
                for(size_t n = 0; n < pbos_.size(); ++n)\r
                {\r
@@ -79,7 +79,7 @@ write_frame& write_frame::operator=(write_frame&& other)
 }\r
 void write_frame::map(){impl_->map();} \r
 void write_frame::unmap(){impl_->unmap();}     \r
-void write_frame::draw(frame_shader& shader){impl_->draw(shader);}\r
+void write_frame::draw(image_shader& shader){impl_->draw(shader);}\r
 boost::iterator_range<unsigned char*> write_frame::pixel_data(size_t index){return impl_->pixel_data(index);}\r
 const boost::iterator_range<const unsigned char*> write_frame::pixel_data(size_t index) const {return impl_->pixel_data(index);}\r
 std::vector<short>& write_frame::audio_data() { return impl_->audio_data_; }\r
index cfdbdfba63a1fe51150669a593484c0f3a9081e3..b4aa453aa613ab749f44085fa2e700098aab4832 100644 (file)
@@ -41,7 +41,7 @@ private:
                \r
        void map();\r
        void unmap();\r
-       void draw(frame_shader& shader);\r
+       void draw(image_shader& shader);\r
 \r
        struct implementation;\r
        std::shared_ptr<implementation> impl_;\r
index d6fc248ae16822243015614ddcb53a0fba3d8b62..a83ae6f7f567e4f2887c0eb6ce1d179f48a864a1 100644 (file)
@@ -42,8 +42,9 @@ struct input::implementation : boost::noncopyable
        ~implementation()\r
        {               \r
                is_running_ = false;\r
-               audio_packet_buffer_.clear();\r
-               video_packet_buffer_.clear();\r
+               std::shared_ptr<aligned_buffer> buffer;\r
+               audio_packet_buffer_.try_pop(buffer);\r
+               video_packet_buffer_.try_pop(buffer);\r
                io_thread_.join();\r
        }\r
        \r
index ca777dff21ca1ee730c12f592a71903ab672f3db..10440b0e626d713195d76dd1f24340c4c3a14350 100644 (file)
@@ -62,7 +62,7 @@ struct flash_producer::implementation
                if(!boost::filesystem::exists(filename))\r
                        BOOST_THROW_EXCEPTION(file_not_found() << boost::errinfo_file_name(narrow(filename)));\r
 \r
-               frame_buffer_.set_capacity(3);          \r
+               frame_buffer_.set_capacity(3);\r
        }\r
 \r
        ~implementation() \r
@@ -125,7 +125,8 @@ struct flash_producer::implementation
                is_empty_ = true;\r
                if(executor_.is_running())\r
                {\r
-                       frame_buffer_.clear();\r
+                       std::shared_ptr<draw_frame>  frame;\r
+                       while(frame_buffer_.try_pop(frame)){}\r
                        executor_.stop();\r
                }\r
        }\r
@@ -180,8 +181,9 @@ struct flash_producer::implementation
                        CASPAR_SCOPE_EXIT([=]\r
                        {                                               \r
                                stop();\r
-\r
-                               frame_buffer_.clear();\r
+                               \r
+                               std::shared_ptr<draw_frame>  frame;\r
+                               while(frame_buffer_.try_pop(frame)){}\r
                                frame_buffer_.try_push(draw_frame::eof()); // EOF\r
                \r
                                current_frame_ = nullptr;\r
@@ -235,7 +237,7 @@ struct flash_producer::implementation
                        is_empty_ = flashax_container_->IsEmpty();\r
                }\r
        }\r
-               \r
+\r
        safe_ptr<draw_frame> do_receive()\r
        {\r
                auto format_desc = frame_processor_->get_video_format_desc();\r
@@ -243,19 +245,19 @@ struct flash_producer::implementation
                flashax_container_->Tick();\r
                invalid_count_ = !flashax_container_->InvalidRectangle() ? std::min(2, invalid_count_+1) : 0;\r
                if(current_frame_ == nullptr || invalid_count_ < 2)\r
-               {                               \r
+               {\r
                        std::fill_n(bmp_frame_->data(), bmp_frame_->size(), 0);                 \r
                        flashax_container_->DrawControl(bmp_frame_->hdc());\r
                        current_frame_ = bmp_frame_;\r
-               }       \r
+               }\r
 \r
                auto frame = frame_processor_->create_frame(format_desc.width, format_desc.height);\r
                std::copy(current_frame_->data(), current_frame_->data() + current_frame_->size(), frame->pixel_data().begin());\r
                return frame;\r
        }\r
-               \r
+\r
        safe_ptr<draw_frame> receive()\r
-       {               \r
+       {\r
                return ((frame_buffer_.try_pop(last_frame_) || !is_empty_) && last_frame_) ? safe_ptr<draw_frame>(last_frame_) : draw_frame::empty();\r
        }\r
 \r
@@ -273,7 +275,7 @@ struct flash_producer::implementation
        }\r
        \r
        CComObject<flash::FlashAxContainer>* flashax_container_;\r
-               \r
+\r
        tbb::concurrent_bounded_queue<std::shared_ptr<draw_frame>> frame_buffer_;\r
 \r
        std::shared_ptr<draw_frame> last_frame_;\r
@@ -315,7 +317,7 @@ safe_ptr<flash_producer> create_flash_producer(const std::vector<std::wstring>&
        std::wstring filename = server::media_folder() + L"\\" + params[0];\r
        \r
        auto ext = std::find_if(extensions.begin(), extensions.end(), [&](const std::wstring& ex) -> bool\r
-               {                                       \r
+               {\r
                        return boost::filesystem::is_regular_file(boost::filesystem::wpath(filename).replace_extension(ex));\r
                });\r
 \r
index 4c2f44874c371ebc1e4eb66e01890e52a957cc7c..cd5c511b4140282a49b4e85fe12667a3c0645d19 100644 (file)
@@ -8,10 +8,10 @@
   </paths>\r
   <channels>\r
     <channel>\r
-      <videomode>1080p2500</videomode>\r
+      <videomode>720p5000</videomode>\r
       <consumers>\r
         <ogl>\r
-          <device>1</device>\r
+          <device>0</device>\r
           <stretch>uniform</stretch>\r
           <windowed>true</windowed>\r
         </ogl>\r