]> git.sesse.net Git - casparcg/blobdiff - core/producer/layer.h
2.0.0.2: Moved ATL init to shell.
[casparcg] / core / producer / layer.h
index a31aaba8bc33ae99424880eb6457e382888efc8f..41cc74f1dd90297f281e11456c84017fcb52c736 100644 (file)
@@ -4,6 +4,8 @@
 \r
 #include <boost/noncopyable.hpp>\r
 \r
+#include <tbb/atomic.h>\r
+\r
 namespace caspar { namespace core {\r
 \r
 class frame_producer;\r
@@ -12,10 +14,14 @@ 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
-       \r
+\r
+       //NOTE: swap is thread-safe on "other", NOT on "this".\r
+       void swap(layer& other); // nothrow \r
+               \r
        void load(const safe_ptr<frame_producer>& producer, bool play_on_load = false); // nothrow\r
        void preview(const safe_ptr<frame_producer>& producer); // nothrow\r
        void play(); // nothrow\r
@@ -23,15 +29,13 @@ public:
        void stop(); // nothrow\r
        void clear(); // nothrow\r
 \r
-       bool empty() const; // nothrow\r
-               \r
        safe_ptr<frame_producer> foreground() const; // nothrow\r
        safe_ptr<frame_producer> background() const; // nothrow\r
 \r
        safe_ptr<draw_frame> receive(); // nothrow\r
 private:\r
        struct implementation;\r
-       std::shared_ptr<implementation> impl_;\r
+       tbb::atomic<implementation*> impl_;\r
 };\r
 \r
 }}
\ No newline at end of file