]> git.sesse.net Git - casparcg/blobdiff - core/consumer/frame_consumer.h
* Removed use of c++14 feature only supported by Visual Studio 2015 and not by gcc...
[casparcg] / core / consumer / frame_consumer.h
index 3a0f7ec62de4fbdc21287971e16fa58939168640..e09e4edcfe263f8a36c5a22359b831fe3fab445b 100644 (file)
@@ -23,6 +23,7 @@
 
 #include "../monitor/monitor.h"
 #include "../fwd.h"
+#include "../help/help_repository.h"
 
 #include <common/memory.h>
 #include <common/future_fwd.h>
@@ -54,7 +55,7 @@ public:
        // Methods
 
        virtual std::future<bool>                               send(const_frame frame) = 0;
-       virtual void                                                    initialize(const video_format_desc& format_desc, int channel_index) = 0;
+       virtual void                                                    initialize(const video_format_desc& format_desc, const audio_channel_layout& channel_layout, int channel_index) = 0;
        
        // monitor::observable
 
@@ -68,6 +69,7 @@ public:
        virtual bool                                                    has_synchronization_clock() const {return true;}
        virtual int                                                             buffer_depth() const = 0; // -1 to not participate in frame presentation synchronization
        virtual int                                                             index() const = 0;
+       virtual int64_t                                                 presentation_frame_age_millis() const = 0;
 };
 
 typedef std::function<spl::shared_ptr<frame_consumer>(
@@ -77,16 +79,26 @@ typedef std::function<spl::shared_ptr<frame_consumer>(
                const boost::property_tree::wptree& element,
                interaction_sink* sink)> preconfigured_consumer_factory_t;
 
-void register_consumer_factory(const consumer_factory_t& factory);
-void register_preconfigured_consumer_factory(
-               const std::wstring& element_name,
-               const preconfigured_consumer_factory_t& factory);
-spl::shared_ptr<frame_consumer> create_consumer(
-               const std::vector<std::wstring>& params,
-               interaction_sink* sink);
-spl::shared_ptr<frame_consumer> create_consumer(
-               const std::wstring& element_name,
-               const boost::property_tree::wptree& element,
-               interaction_sink* sink);
+class frame_consumer_registry : boost::noncopyable
+{
+public:
+       frame_consumer_registry(spl::shared_ptr<help_repository> help_repo);
+       void register_consumer_factory(const std::wstring& name, const consumer_factory_t& factory, const help_item_describer& describer);
+       void register_preconfigured_consumer_factory(
+                       const std::wstring& element_name,
+                       const preconfigured_consumer_factory_t& factory);
+       spl::shared_ptr<frame_consumer> create_consumer(
+                       const std::vector<std::wstring>& params,
+                       interaction_sink* sink) const;
+       spl::shared_ptr<frame_consumer> create_consumer(
+                       const std::wstring& element_name,
+                       const boost::property_tree::wptree& element,
+                       interaction_sink* sink) const;
+private:
+       struct impl;
+       spl::shared_ptr<impl> impl_;
+};
+
+void destroy_consumers_synchronously();
 
 }}