X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=core%2Fconsumer%2Fframe_consumer.h;h=bbea02a3f52cd58a06f06509bbc76f6b0a407bf0;hb=6158d8cd73c7c53c9b5d933d7527381cceaf493c;hp=0f7444d1e427149cf6c7c2fb2a4d03f540d8a7ef;hpb=ac5866d7339f93efc6ff0ffc981e61b997e49b1d;p=casparcg diff --git a/core/consumer/frame_consumer.h b/core/consumer/frame_consumer.h index 0f7444d1e..bbea02a3f 100644 --- a/core/consumer/frame_consumer.h +++ b/core/consumer/frame_consumer.h @@ -19,34 +19,53 @@ */ #pragma once +#include "../video_format.h" + #include #include +#include +#include +#include + namespace caspar { namespace core { class read_frame; struct video_format_desc; +size_t consumer_buffer_depth(); + struct frame_consumer : boost::noncopyable { virtual ~frame_consumer() {} - virtual void send(const safe_ptr& frame) = 0; - virtual size_t buffer_depth() const = 0; + virtual bool send(const safe_ptr& frame) = 0; + virtual bool key_only() const{ return false;} virtual void initialize(const video_format_desc& format_desc) = 0; + virtual std::wstring print() const = 0; + virtual bool has_synchronization_clock() const {return true;} + virtual const core::video_format_desc& get_video_format_desc() const = 0; // nothrow static const safe_ptr& empty() { struct empty_frame_consumer : public frame_consumer { - virtual void send(const safe_ptr&){} - virtual size_t buffer_depth() const{return 0;} - void initialize(const video_format_desc&){} + core::video_format_desc format_desc; + virtual bool send(const safe_ptr&){return false;} + virtual void initialize(const video_format_desc&){} + virtual std::wstring print() const {return L"empty";} + virtual bool has_synchronization_clock() const {return false;} + virtual const core::video_format_desc& get_video_format_desc() const{return format_desc;}; // nothrow }; static safe_ptr consumer = make_safe(); return consumer; } }; +typedef std::function(const std::vector&)> consumer_factory_t; + +void register_consumer_factory(const consumer_factory_t& factory); +safe_ptr create_consumer(const std::vector& params); + }} \ No newline at end of file