#pragma once\r
\r
-#include "../processor/frame_processor_device.h"\r
-#include "../consumer/frame_consumer.h"\r
-#include "../format/video_format.h"\r
+#include "frame_producer.h"\r
\r
-#include "layer.h"\r
+#include <common/memory/safe_ptr.h>\r
+#include <common/utility/printer.h>\r
\r
-#include <boost/thread.hpp>\r
+#include <boost/noncopyable.hpp>\r
+#include <boost/thread/future.hpp>\r
\r
#include <functional>\r
\r
namespace caspar { namespace core {\r
- \r
+\r
+////////////////////////////////////////////////////////////////////////////////////////////////////\r
+/// \class frame_producer_device\r
+///\r
+/// \brief\r
+/// \r
+/// |**********| <- empty frame <- |***********| <- frame format <- |**********|\r
+/// PROTOCOL -> | PRODUCER | | MIXER | | CONSUMER | -> DISPLAY DEVICE\r
+/// |**********| -> rendered frames -> |***********| -> formatted frame -> |**********|\r
+/// \r
+////////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
class frame_producer_device : boost::noncopyable\r
-{ \r
+{\r
public:\r
+ typedef std::function<void(const std::vector<safe_ptr<draw_frame>>&)> output_func;\r
+\r
+ explicit frame_producer_device(const printer& parent_printer, const safe_ptr<frame_factory>& factory, const output_func& output);\r
frame_producer_device(frame_producer_device&& other);\r
- frame_producer_device(const safe_ptr<frame_processor_device>& frame_processor);\r
- \r
- void load (int render_layer, const safe_ptr<frame_producer>& 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
- boost::unique_future<safe_ptr<frame_producer>> foreground(int render_layer) const;\r
- boost::unique_future<safe_ptr<frame_producer>> background(int render_layer) const;\r
+ void swap(frame_producer_device& other);\r
+ \r
+ void load(int index, const safe_ptr<frame_producer>& producer, bool play_on_load = false, 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) const;\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