]> git.sesse.net Git - casparcg/blobdiff - modules/oal/consumer/oal_consumer.cpp
Merged asynchronous invocation of consumers from 2.0
[casparcg] / modules / oal / consumer / oal_consumer.cpp
index e65ef37ca4fa526128380f41a98f0099e1e01b32..e0084ee3e384a8f4b68c340b713a5cf25efeced1 100644 (file)
@@ -27,6 +27,7 @@
 #include <common/log.h>
 #include <common/utf.h>
 #include <common/env.h>
+#include <common/future.h>
 
 #include <core/consumer/frame_consumer.h>
 #include <core/frame/frame.h>
@@ -174,8 +175,10 @@ public:
                });
        }
        
-       bool send(core::const_frame frame) override
-       {                       
+       boost::unique_future<bool> send(core::const_frame frame) override
+       {
+               // Will only block if the default executor queue capacity of 512 is
+               // exhausted, which should not happen
                executor_.begin_invoke([=]
                {
                        ALenum state; 
@@ -213,7 +216,7 @@ public:
                        perf_timer_.restart();
                });
 
-               return true;
+               return wrap_as_future(true);
        }
        
        std::wstring print() const override