]> 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>
Mon, 8 Aug 2011 15:35:10 +0000 (15:35 +0000)
committerRonag <Ronag@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Mon, 8 Aug 2011 15:35:10 +0000 (15:35 +0000)
core/mixer/mixer.cpp
core/mixer/read_frame.cpp
core/mixer/read_frame.h

index a9ab74701be5dceb65db532cdf9038eed76bc19d..33164ec5a90846ac8fe78eed07dca5a35156d5bd 100644 (file)
@@ -118,7 +118,7 @@ public:
                                        [&]{image = mix_image(frames);}, \r
                                        [&]{audio = mix_audio(frames);});\r
                        \r
-                       return make_safe<read_frame>(channel_.ogl(), channel_.get_format_desc().size, std::move(image), std::move(audio));\r
+                       return make_safe<read_frame>(channel_.ogl(), channel_.get_format_desc().size, std::move(image.get()), std::move(audio));\r
                }\r
                catch(...)\r
                {\r
index a9844a26a955da2fbbc58b6efb37107ec4c94008..4555d67fa4dddbc03c818dcf547ea43892598c32 100644 (file)
@@ -31,18 +31,17 @@ namespace caspar { namespace core {
                                                                                                                                                                                                                                                                                                                        \r
 struct read_frame::implementation : boost::noncopyable\r
 {\r
-       ogl_device&                                                                             ogl_;\r
-       size_t                                                                                  size_;\r
-       boost::unique_future<safe_ptr<host_buffer>>             future_image_data_;\r
-       std::shared_ptr<host_buffer>                                    image_data_;\r
-       tbb::mutex                                                                              mutex_;\r
-       std::vector<int16_t>                                                    audio_data_;\r
+       ogl_device&                                     ogl_;\r
+       size_t                                          size_;\r
+       safe_ptr<host_buffer>           image_data_;\r
+       tbb::mutex                                      mutex_;\r
+       std::vector<int16_t>            audio_data_;\r
 \r
 public:\r
-       implementation(ogl_device& ogl, size_t size, boost::unique_future<safe_ptr<host_buffer>>&& image_data, std::vector<int16_t>&& audio_data) \r
+       implementation(ogl_device& ogl, size_t size, safe_ptr<host_buffer>&& image_data, std::vector<int16_t>&& audio_data) \r
                : ogl_(ogl)\r
                , size_(size)\r
-               , future_image_data_(std::move(image_data))\r
+               , image_data_(std::move(image_data))\r
                , audio_data_(std::move(audio_data)){}  \r
        \r
        const boost::iterator_range<const uint8_t*> image_data()\r
@@ -50,9 +49,8 @@ public:
                {\r
                        tbb::mutex::scoped_lock lock(mutex_);\r
 \r
-                       if(!image_data_)\r
+                       if(!image_data_->data())\r
                        {\r
-                               image_data_ = future_image_data_.get();\r
                                image_data_.get()->wait(ogl_);\r
                                ogl_.invoke([=]{image_data_.get()->map();}, high_priority);\r
                        }\r
@@ -67,7 +65,7 @@ public:
        }\r
 };\r
 \r
-read_frame::read_frame(ogl_device& ogl, size_t size, boost::unique_future<safe_ptr<host_buffer>>&& image_data, std::vector<int16_t>&& audio_data) \r
+read_frame::read_frame(ogl_device& ogl, size_t size, safe_ptr<host_buffer>&& image_data, std::vector<int16_t>&& audio_data) \r
        : impl_(new implementation(ogl, size, 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
index 9575f1fd26364120d3471af873cead8a01f95b37..133dbf609145f5a9ba924c00e9948613178496ed 100644 (file)
@@ -23,7 +23,6 @@
 \r
 #include <boost/noncopyable.hpp>\r
 #include <boost/range/iterator_range.hpp>\r
-#include <boost/thread/future.hpp>\r
 \r
 #include <cstdint>\r
 #include <memory>\r
@@ -38,7 +37,7 @@ class read_frame : boost::noncopyable
 {\r
 public:\r
        read_frame();\r
-       read_frame(ogl_device& ogl, size_t size, boost::unique_future<safe_ptr<host_buffer>>&& image_data, std::vector<int16_t>&& audio_data);\r
+       read_frame(ogl_device& ogl, size_t size, safe_ptr<host_buffer>&& image_data, std::vector<int16_t>&& audio_data);\r
 \r
        virtual const boost::iterator_range<const uint8_t*> image_data();\r
        virtual const boost::iterator_range<const int16_t*> audio_data();\r