]> git.sesse.net Git - casparcg/blob - core/consumer/port.h
Merged asynchronous invocation of consumers from 2.0
[casparcg] / core / consumer / port.h
1 #pragma once
2
3 #include "../monitor/monitor.h"
4
5 #include <common/memory.h>
6
7 #include <boost/property_tree/ptree_fwd.hpp>
8 #include <boost/thread/future.hpp>
9
10 namespace caspar { namespace core {
11
12 class port : public monitor::observable
13 {
14         port(const port&);
15         port& operator=(const port&);
16 public:
17
18         // Static Members
19
20         // Constructors
21
22         port(int index, int channel_index, spl::shared_ptr<class frame_consumer> consumer);
23         port(port&& other);
24         ~port();
25
26         // Member Functions
27
28         port& operator=(port&& other);
29
30         boost::unique_future<bool> send(class const_frame frame);       
31
32         // monitor::observable
33         
34         void subscribe(const monitor::observable::observer_ptr& o) override;
35         void unsubscribe(const monitor::observable::observer_ptr& o) override;
36
37         // Properties
38
39         void video_format_desc(const struct video_format_desc& format_desc);
40         int buffer_depth() const;
41         bool has_synchronization_clock() const;
42         boost::property_tree::wptree info() const;
43 private:
44         struct impl;
45         std::unique_ptr<impl> impl_;
46 };
47
48 }}