*/\r
#pragma once\r
\r
-#include "frame/frame_factory.h"\r
-\r
#include <common/memory/safe_ptr.h>\r
\r
#include <boost/noncopyable.hpp>\r
#include <functional>\r
#include <string>\r
#include <vector>\r
+#include <stdint.h>\r
+#include <numeric>\r
\r
-namespace caspar { namespace core {\r
+namespace caspar { \r
+ \r
+class executor;\r
+ \r
+namespace core {\r
\r
class basic_frame;\r
+struct frame_factory;\r
\r
-class frame_producer : boost::noncopyable\r
+struct frame_producer : boost::noncopyable\r
{\r
public:\r
- frame_producer();\r
+ enum hints\r
+ {\r
+ NO_HINT = 0,\r
+ ALPHA_HINT = 1\r
+ };\r
+\r
virtual ~frame_producer(){} \r
\r
virtual std::wstring print() const = 0; // nothrow\r
virtual safe_ptr<frame_producer> get_following_producer() const {return frame_producer::empty();} // nothrow\r
virtual void set_leading_producer(const safe_ptr<frame_producer>&) {} // nothrow\r
\r
- static const safe_ptr<frame_producer>& empty(); // nothrow\r
-\r
- safe_ptr<core::basic_frame> last_frame() const {return last_frame_;}\r
+ virtual int64_t nb_frames() const {return std::numeric_limits<int>::max();}\r
\r
-private:\r
- friend safe_ptr<basic_frame> receive(const safe_ptr<frame_producer>& producer);\r
-\r
- virtual safe_ptr<basic_frame> receive() = 0;\r
+ virtual safe_ptr<basic_frame> receive(int hints) = 0;\r
+ virtual safe_ptr<core::basic_frame> last_frame() const = 0;\r
\r
- safe_ptr<basic_frame> receive_save_last();\r
-\r
- safe_ptr<core::basic_frame> last_frame_;\r
+ static const safe_ptr<frame_producer>& empty(); // nothrow\r
};\r
\r
-safe_ptr<basic_frame> receive(const safe_ptr<frame_producer>& producer);\r
-safe_ptr<basic_frame> receive_and_follow(safe_ptr<frame_producer>& producer);\r
-safe_ptr<basic_frame> receive_and_follow_w_last(safe_ptr<frame_producer>& producer);\r
+safe_ptr<basic_frame> receive_and_follow(safe_ptr<frame_producer>& producer, int hints);\r
\r
typedef std::function<safe_ptr<core::frame_producer>(const safe_ptr<frame_factory>&, const std::vector<std::wstring>&)> producer_factory_t;\r
void register_producer_factory(const producer_factory_t& factory); // Not thread-safe.\r
safe_ptr<core::frame_producer> create_producer(const safe_ptr<frame_factory>&, const std::vector<std::wstring>& params);\r
\r
+safe_ptr<core::frame_producer> create_destroy_producer_proxy(executor& destroy_context, const safe_ptr<frame_producer>& producer);\r
\r
}}\r