1 #ifndef MF_IMPORTER_FILTER_H_
2 #define MF_IMPORTER_FILTER_H_
6 #include "../io/frame_importer.h"
7 #include "../io/seekable_frame_importer.h"
9 namespace mf {
namespace flow {
12 template<
typename Importer,
typename =
void>
14 static_assert(! Importer::is_seekable,
"Importer must not be seekable");
22 template<
typename... Args>
25 importer_(std::forward<Args>(args)...),
29 output.define_frame_shape(importer_.frame_shape());
34 return importer_.read_frame(out);
35 if(importer_.reached_end()) job.
mark_end();
41 template<
typename Importer>
43 static_assert(Importer::is_seekable,
"Importer must be seekable");
51 template<
typename... Args>
54 importer_(std::forward<Args>(args)...),
66 output.define_frame_shape(importer_.frame_shape());
71 if(importer_.current_time() != t) importer_.seek(t);
77 return importer_.read_frame(out);
importer_filter(filter_node &nd, Args &&...args)
Definition: importer.h:23
void pre_process(node_job &job) override
Prepare for processing a frame.
Definition: importer.h:69
std::ptrdiff_t time_unit
Discrete time unit type.
Definition: common.h:52
decltype(auto) out(Output &)
filter_node & this_node() noexcept
Definition: filter.h:33
void setup() override
Set up the filter, called prior to any frame being processed.
Definition: importer.h:28
Node which delegates concrete frame processing to associated filter object.
Definition: filter_node.h:15
Source filter.
Definition: filter.h:53
output_type< Importer::dimension, typename Importer::elem_type > output
Definition: importer.h:20
importer_filter(filter_node &nd, Args &&...args)
Definition: importer.h:52
void setup() override
Set up the filter, called prior to any frame being processed.
Definition: importer.h:65
time_unit time() const noexcept
Definition: node_job.h:42
void define_source_stream_properties(bool seekable, time_unit stream_duration=-1)
Definition: node.cc:70
Work unit of flow graph node.
Definition: node_job.h:13
Importer source filter, reads frames from associated frame_importer.
Definition: importer.h:13
void mark_end()
Definition: node_job.h:43
void set_seekable(bool seekable)
Definition: importer.h:60
output_type< Importer::dimension, typename Importer::elem_type > output
Definition: importer.h:49
output_port< Dim, Elem > output_type
Definition: filter.h:25
#define MF_ASSERT(condition)
Definition: common.h:24
void process(node_job &job) override
Process a frame.
Definition: importer.h:32
void process(node_job &job) override
Process a frame.
Definition: importer.h:74