]> git.sesse.net Git - casparcg/commitdiff
2.0. stage: Reduced command execution latency.
authorronag <ronag@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Tue, 9 Aug 2011 09:54:19 +0000 (09:54 +0000)
committerronag <ronag@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Tue, 9 Aug 2011 09:54:19 +0000 (09:54 +0000)
git-svn-id: https://casparcg.svn.sourceforge.net/svnroot/casparcg/server/branches/2.0.0.2@1103 362d55ac-95cf-4e76-9f9a-cbaa9c17b72d

core/producer/stage.cpp

index fa16845922355fd532b6aeb79834401bee0bd4fc..432e2591269f99dd0f302631446b47d8eac246ee 100644 (file)
@@ -89,7 +89,10 @@ public:
                try\r
                {\r
                        BOOST_FOREACH(auto& layer, layers_)\r
+                       {\r
                                frames[layer.first] = layer.second.receive();\r
+                               channel_.execution().yield();\r
+                       }\r
                }\r
                catch(...)\r
                {\r
@@ -104,7 +107,7 @@ public:
                channel_.execution().invoke([&]\r
                {\r
                        layers_[index].load(make_safe<destroy_producer_proxy>(channel_.destruction(), producer), preview, auto_play_delta);\r
-               });\r
+               }, high_priority);\r
        }\r
 \r
        void pause(int index)\r
@@ -112,7 +115,7 @@ public:
                channel_.execution().invoke([&]\r
                {\r
                        layers_[index].pause();\r
-               });\r
+               }, high_priority);\r
        }\r
 \r
        void play(int index)\r
@@ -120,7 +123,7 @@ public:
                channel_.execution().invoke([&]\r
                {\r
                        layers_[index].play();\r
-               });\r
+               }, high_priority);\r
        }\r
 \r
        void stop(int index)\r
@@ -128,7 +131,7 @@ public:
                channel_.execution().invoke([&]\r
                {\r
                        layers_[index].stop();\r
-               });\r
+               }, high_priority);\r
        }\r
 \r
        void clear(int index)\r
@@ -136,7 +139,7 @@ public:
                channel_.execution().invoke([&]\r
                {\r
                        layers_.erase(index);\r
-               });\r
+               }, high_priority);\r
        }\r
                \r
        void clear()\r
@@ -144,7 +147,7 @@ public:
                channel_.execution().invoke([&]\r
                {\r
                        layers_.clear();\r
-               });\r
+               }, high_priority);\r
        }       \r
        \r
        void swap_layer(int index, size_t other_index)\r
@@ -152,7 +155,7 @@ public:
                channel_.execution().invoke([&]\r
                {\r
                        layers_[index].swap(layers_[other_index]);\r
-               });\r
+               }, high_priority);\r
        }\r
 \r
        void swap_layer(int index, size_t other_index, stage& other)\r
@@ -166,7 +169,7 @@ public:
 \r
                        auto func = [&]{layers_[index].swap(other.impl_->layers_[other_index]);};\r
                \r
-                       channel_.execution().invoke([&]{other.impl_->channel_.execution().invoke(func);});\r
+                       channel_.execution().invoke([&]{other.impl_->channel_.execution().invoke(func, high_priority);}, high_priority);\r
                }\r
        }\r
 \r
@@ -192,17 +195,17 @@ public:
                                layers_[index].swap(other.impl_->layers_[index]);\r
                };\r
                \r
-               channel_.execution().invoke([&]{other.impl_->channel_.execution().invoke(func);});\r
+               channel_.execution().invoke([&]{other.impl_->channel_.execution().invoke(func, high_priority);});\r
        }\r
        \r
        boost::unique_future<safe_ptr<frame_producer>> foreground(int index)\r
        {\r
-               return channel_.execution().begin_invoke([=]{return layers_[index].foreground();});\r
+               return channel_.execution().begin_invoke([=]{return layers_[index].foreground();}, high_priority);\r
        }\r
        \r
        boost::unique_future<safe_ptr<frame_producer>> background(int index)\r
        {\r
-               return channel_.execution().begin_invoke([=]{return layers_[index].background();});\r
+               return channel_.execution().begin_invoke([=]{return layers_[index].background();}, high_priority);\r
        }\r
 \r
        std::wstring print() const\r