X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=core%2Fproducer%2Fframe_producer.h;h=d2b1becdf9f83ba04bb4d35aa1941feabe03a203;hb=dfd686be35cff4aaddf442582f883d86dcc199cb;hp=c32c1838ce3da83cea5da399f6618ff834c22aed;hpb=c5bf7659f087e5c0fa7fcc6e46cf182a822faa21;p=casparcg diff --git a/core/producer/frame_producer.h b/core/producer/frame_producer.h index c32c1838c..d2b1becdf 100644 --- a/core/producer/frame_producer.h +++ b/core/producer/frame_producer.h @@ -21,43 +21,46 @@ #include -#include "../producer/frame/basic_frame.h" -#include "../producer/frame/frame_factory.h" - #include #include #include +#include +#include +#include namespace caspar { namespace core { -class frame_producer : boost::noncopyable +class basic_frame; +struct frame_factory; + +struct frame_producer : boost::noncopyable { public: + enum hints + { + NO_HINT = 0, + ALPHA_HINT = 1 + }; + virtual ~frame_producer(){} - virtual safe_ptr receive() = 0; virtual std::wstring print() const = 0; // nothrow virtual void param(const std::wstring&){} virtual safe_ptr get_following_producer() const {return frame_producer::empty();} // nothrow - virtual void set_leading_producer(const safe_ptr& /*producer*/) {} // nothrow + virtual void set_leading_producer(const safe_ptr&) {} // nothrow - static const safe_ptr& empty() // nothrow - { - struct empty_frame_producer : public frame_producer - { - virtual safe_ptr receive(){return basic_frame::empty();} - virtual void set_frame_factory(const safe_ptr&){} - virtual std::wstring print() const { return L"empty";} - }; - static safe_ptr producer = make_safe(); - return producer; - } + virtual int64_t nb_frames() const {return std::numeric_limits::max();} + + virtual safe_ptr receive(int hints) = 0; + virtual safe_ptr last_frame() const = 0; + + static const safe_ptr& empty(); // nothrow }; -safe_ptr receive_and_follow(safe_ptr& producer); +safe_ptr receive_and_follow(safe_ptr& producer, int hints); typedef std::function(const safe_ptr&, const std::vector&)> producer_factory_t; void register_producer_factory(const producer_factory_t& factory); // Not thread-safe.