]> git.sesse.net Git - casparcg/commitdiff
2.0.0.2:
authorronag <ronag@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Fri, 21 Jan 2011 22:44:27 +0000 (22:44 +0000)
committerronag <ronag@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Fri, 21 Jan 2011 22:44:27 +0000 (22:44 +0000)
   - oal_consumer: Fixed deinitialization.
   - layer: Fixed layer swap on same producer_device.

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

core/consumer/oal/oal_consumer.cpp
core/producer/frame_producer_device.cpp
core/producer/layer.cpp
core/producer/layer.h
shell/main.cpp

index f202567b35ad93e4cad99796016b3c567a3798f8..3d47bfe86404e21e1d16088a756eec680a40e0c8 100644 (file)
@@ -46,6 +46,7 @@ public:
 \r
        ~implementation()\r
        {\r
+               Stop();\r
                is_running_ = false;\r
                input_.try_push(std::vector<short>());\r
                input_.try_push(std::vector<short>());\r
index 5536a6f6233fb1cdfc423f98fadc284232cc5525..fe802dc0181468c00ede74a42a7f210b139a2264 100644 (file)
@@ -35,9 +35,6 @@ public:
                : factory_(factory)\r
                , output_(output)\r
        {\r
-               for(size_t n = 0; n < layers_.size(); ++n)\r
-                       layers_[n] = layer(n);\r
-\r
                executor_.start();\r
                executor_.begin_invoke([=]{tick();});\r
        }\r
@@ -66,7 +63,10 @@ public:
                [&](const tbb::blocked_range<size_t>& r)\r
                {\r
                        for(size_t i = r.begin(); i != r.end(); ++i)\r
+                       {\r
                                frames[i] = layers_[i].receive();\r
+                               frames[i]->set_layer_index(i);\r
+                       }\r
                });             \r
                boost::range::remove_erase(frames, draw_frame::eof());\r
                boost::range::remove_erase(frames, draw_frame::empty());\r
index 66fda5c9e61f8970869b51a5d8139a8d732454b9..6c36614a36d1a4ebbfb0f04748b1ceef4dc1f378 100644 (file)
@@ -18,15 +18,13 @@ struct layer::implementation : boost::noncopyable
        safe_ptr<frame_producer>        foreground_;\r
        safe_ptr<frame_producer>        background_;\r
        safe_ptr<draw_frame>            last_frame_;\r
-       const int                                       index_;\r
        bool                                            is_paused_;\r
 \r
 public:\r
-       implementation(int index\r
+       implementation() \r
                : foreground_(frame_producer::empty())\r
                , background_(frame_producer::empty())\r
                , last_frame_(draw_frame::empty())\r
-               , index_(index) \r
                , is_paused_(false){}\r
        \r
        void load(const safe_ptr<frame_producer>& frame_producer, bool play_on_load)\r
@@ -93,7 +91,6 @@ public:
                try\r
                {\r
                        last_frame_ = foreground_->receive(); \r
-                       last_frame_->set_layer_index(index_);\r
                        if(last_frame_ == draw_frame::eof())\r
                        {\r
                                CASPAR_ASSERT(foreground_ != frame_producer::empty());\r
@@ -116,12 +113,12 @@ public:
                return last_frame_;\r
        }\r
 \r
-       std::wstring print() const { return L"layer[" + boost::lexical_cast<std::wstring>(index_) + L"]"; }\r
+       std::wstring print() const { return L"layer[]"; }\r
 };\r
 \r
-layer::layer(int index\r
+layer::layer() \r
 {\r
-       impl_ = new implementation(index);\r
+       impl_ = new implementation();\r
 }\r
 layer::layer(layer&& other) : impl_(std::move(other.impl_)){other.impl_ = nullptr;}\r
 layer::~layer()\r
index 2671d9049ff521753c37564db0ee4ecbc6e64b6b..41cc74f1dd90297f281e11456c84017fcb52c736 100644 (file)
@@ -14,7 +14,7 @@ class draw_frame;
 class layer : boost::noncopyable\r
 {\r
 public:\r
-       layer(int index = -1); // nothrow\r
+       layer(); // nothrow\r
        layer(layer&& other); // nothrow\r
        ~layer();\r
        layer& operator=(layer&& other); // nothrow\r
index a995fe008908dfaa0b054a00b6da20cac51587ea..9cf50e9ad171ab84a1ef24f2f442841b675eb7eb 100644 (file)
@@ -102,7 +102,18 @@ int main(int argc, wchar_t* argv[])
                        std::wstring wcmd;\r
                        std::getline(std::wcin, wcmd); // TODO: It's blocking...\r
                        is_running = wcmd != L"exit" && wcmd != L"q";\r
-                       if(wcmd.substr(0, 2) == L"10")\r
+                       if(wcmd.substr(0, 2) == L"12")\r
+                       {\r
+                               wcmd = L"LOADBG 1-1 A LOOP AUTOPLAY\r\n";\r
+                               amcp.Parse(wcmd.c_str(), wcmd.length(), dummy);\r
+                               wcmd = L"LOADBG 1-2 DV LOOP AUTOPLAY\r\n";\r
+                               amcp.Parse(wcmd.c_str(), wcmd.length(), dummy);\r
+                               wcmd = L"MIXER 1-1 VIDEO FIX_RECT 0.0 0.0 0.5 0.5\r\n";\r
+                               amcp.Parse(wcmd.c_str(), wcmd.length(), dummy);\r
+                               wcmd = L"MIXER 1-2 VIDEO FIX_RECT 0.5 0.0 0.5 0.5\r\n";\r
+                               amcp.Parse(wcmd.c_str(), wcmd.length(), dummy);\r
+                       }\r
+                       else if(wcmd.substr(0, 2) == L"10")\r
                                wcmd = L"MIXER 1-1 VIDEO CLIP_RECT 0.4 0.4 0.5 0.5";\r
                        if(wcmd.substr(0, 2) == L"11")\r
                                wcmd = L"MIXER 1-1 VIDEO FIX_RECT 0.4 0.4 0.5 0.5";\r