]> git.sesse.net Git - casparcg/blobdiff - core/producer/frame_producer_device.h
2.0.0.2: SET MODE: Does not clear producers.
[casparcg] / core / producer / frame_producer_device.h
index 4c06d5f9f29d40c6cc82a4b14917bd39eba0227b..75a14b88558cb5b4f4771915ada51b2a77f158cd 100644 (file)
@@ -1,33 +1,66 @@
+/*\r
+* copyright (c) 2010 Sveriges Television AB <info@casparcg.com>\r
+*\r
+*  This file is part of CasparCG.\r
+*\r
+*    CasparCG is free software: you can redistribute it and/or modify\r
+*    it under the terms of the GNU General Public License as published by\r
+*    the Free Software Foundation, either version 3 of the License, or\r
+*    (at your option) any later version.\r
+*\r
+*    CasparCG is distributed in the hope that it will be useful,\r
+*    but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+*    GNU General Public License for more details.\r
+\r
+*    You should have received a copy of the GNU General Public License\r
+*    along with CasparCG.  If not, see <http://www.gnu.org/licenses/>.\r
+*\r
+*/\r
+\r
 #pragma once\r
 \r
-#include "../processor/frame_processor_device.h"\r
-#include "../consumer/frame_consumer.h"\r
-#include "../video/video_format.h"\r
+#include "frame_producer.h"\r
 \r
-#include "layer.h"\r
+#include <common/memory/safe_ptr.h>\r
+\r
+#include <boost/noncopyable.hpp>\r
+#include <boost/thread/future.hpp>\r
 \r
 #include <functional>\r
 \r
-namespace caspar { namespace core {\r
-               \r
+namespace caspar { \r
+       \r
+class executor;\r
+\r
+namespace core {\r
+\r
+struct video_format_desc;\r
+struct channel_context;\r
+\r
 class frame_producer_device : boost::noncopyable\r
-{      \r
+{\r
 public:\r
-       frame_producer_device(const frame_processor_device_ptr& frame_processor);\r
-       \r
-       void load(int render_layer, const frame_producer_ptr& producer, load_option::type option = load_option::none);  \r
-       void pause(int render_layer);\r
-       void play(int render_layer);\r
-       void stop(int render_layer);\r
-       void clear(int render_layer);\r
-       void clear();\r
-       \r
-       frame_producer_ptr active(int render_layer) const;\r
-       frame_producer_ptr background(int render_layer) const;\r
+       typedef std::function<void(const std::map<int, safe_ptr<basic_frame>>&)> output_t;\r
+\r
+       explicit frame_producer_device(channel_context& channel, const output_t& output);\r
+\r
+       void swap(frame_producer_device& other);\r
+               \r
+       void load(int index, const safe_ptr<frame_producer>& producer, bool preview = false);\r
+       void pause(int index);\r
+       void play(int index);\r
+       void stop(int index);\r
+       void clear(int index);\r
+       void clear();   \r
+       void swap_layer(int index, size_t other_index);\r
+       void swap_layer(int index, size_t other_index, frame_producer_device& other);\r
+       boost::unique_future<safe_ptr<frame_producer>> foreground(size_t index);\r
+       boost::unique_future<safe_ptr<frame_producer>> background(size_t index);\r
+\r
 private:\r
        struct implementation;\r
-       std::shared_ptr<implementation> impl_;\r
+       safe_ptr<implementation> impl_;\r
 };\r
-typedef std::shared_ptr<frame_producer_device> frame_producer_device_ptr;\r
 \r
-}}\r
+}}
\ No newline at end of file