mf
Media Framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
exporter.h
Go to the documentation of this file.
1 #ifndef MF_EXPORTER_FILTER_H_
2 #define MF_EXPORTER_FILTER_H_
3 
4 #include <utility>
5 #include "filter.h"
6 #include "../io/frame_exporter.h"
7 
8 namespace mf { namespace flow {
9 
11 template<typename Exporter>
12 class exporter_filter : public sink_filter {
13 private:
14  Exporter exporter_;
15 
16 public:
18 
19  template<typename... Args>
20  explicit exporter_filter(filter_node& nd, Args&&... args) :
21  sink_filter(nd),
22  exporter_(std::forward<Args>(args)...),
23  input(*this) { }
24 
25  void setup() override {
26  //
27  }
28 
29  void process(node_job& job) override {
30  auto in = job.in(input);
31  exporter_.write_frame(in);
32  }
33 };
34 
35 }}
36 
37 #endif
input_port< Dim, Elem > input_type
Definition: filter.h:24
Node which delegates concrete frame processing to associated filter object.
Definition: filter_node.h:15
void process(node_job &job) override
Process a frame.
Definition: exporter.h:29
void setup() override
Set up the filter, called prior to any frame being processed.
Definition: exporter.h:25
Work unit of flow graph node.
Definition: node_job.h:13
Exporter sink filter, writes frames to associated frame_exporter.
Definition: exporter.h:12
exporter_filter(filter_node &nd, Args &&...args)
Definition: exporter.h:20
decltype(auto) in(Input &)
Sink filter.
Definition: filter.h:64
input_type< Exporter::dimension, typename Exporter::elem_type > input
Definition: exporter.h:17