Skip to main content

Input.h File

Input Node — push-mode source. More...

Included Headers

#include "builder/Node.h" #include "builder/OutputSpec.h" #include "pipeline/FormatSpec.h" #include <memory> #include <cstdint> #include <optional> #include <string> #include <vector>

Namespaces Index

namespacesimaai
namespaceneat
namespacenodes

Classes Index

structPreprocessMetaTemplate

Preprocess metadata template attached to ingress buffers. More...

structInputOptions

Caps, buffering, and pool options for the Input Node. More...

classInput

Push-mode source Node. More...

Description

Input Node — push-mode source.

Lets the application feed samples via Run::push().

Wraps an appsrc-style element. Use this when the application owns frame production (e.g. capturing from a custom source, replaying a buffer, or feeding test data) and needs to deliver samples to the pipeline by hand. A Session that begins with an Input Node is built with Session::build() and driven by Run::push() rather than Run::run().

File Listing

The file content with the documentation metadata removed is:

1
12#pragma once
13
14#include "builder/Node.h"
15#include "builder/OutputSpec.h"
17
18#include <memory>
19#include <cstdint>
20#include <optional>
21#include <string>
22#include <vector>
23
24namespace simaai::neat {
25
36 bool enabled = false;
37 int target_width = 0;
38 int target_height = 0;
39 int scaled_width = 0;
40 int scaled_height = 0;
41 std::string resize_mode = "none";
42 int pad_value = 0;
43
44 std::string color_in;
45 std::string color_out;
47 std::vector<int> axis_perm;
48
49 bool normalize = false;
50 bool quantize = false;
51 bool tessellate = false;
52};
53
62enum class InputMemoryPolicy {
63 Auto = 0,
64 Ev74,
65 Dms0,
67};
68
75 std::string media_type =
76 "video/x-raw";
78 int width = -1;
79 int height = -1;
80 int depth = -1;
83 int max_width = -1;
84 int max_height = -1;
85 int max_depth = -1;
87 int fps_n = 0;
88 int fps_d = 1;
90 std::string caps_override;
91
92 bool is_live = true;
93 bool do_timestamp = true;
94 bool block = true;
95 int stream_type = 0;
96 std::uint64_t max_bytes = 0;
97
98 bool use_simaai_pool = true;
104
106 std::string buffer_name;
107
110 std::optional<PreprocessMetaTemplate> preprocess_meta;
111};
112
122class Input final : public Node, public OutputSpecProvider {
123public:
125 explicit Input(InputOptions opt);
126
128 std::string kind() const override {
129 return "Input";
130 }
132 std::string user_label() const override {
133 return "mysrc";
134 }
136 InputRole input_role() const override {
137 return InputRole::Push;
138 }
140 NodeCapsBehavior caps_behavior() const override {
141 return NodeCapsBehavior::Static;
142 }
144 std::string buffer_name_hint(int node_index) const override;
145
147 std::string backend_fragment(int node_index) const override;
149 std::vector<std::string> element_names(int node_index) const override;
151 OutputSpec output_spec(const OutputSpec& input) const override;
152
154 const InputOptions& options() const {
155 return opt_;
156 }
158 std::string caps_string() const;
159
160private:
161 InputOptions opt_;
162};
163
164} // namespace simaai::neat
165
166namespace simaai::neat::nodes {
168std::shared_ptr<simaai::neat::Node> Input(InputOptions opt = {});
169} // namespace simaai::neat::nodes

Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.