Skip to main content

StillImageInput.h File

StillImageInput node for RTSP server mode. More...

Included Headers

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

Namespaces Index

namespacesimaai
namespaceneat
namespacenodes

Classes Index

classStillImageInput
structContentWidth
structContentHeight
structEncodeWidth
structEncodeHeight
structFramesPerSecond

Description

StillImageInput node for RTSP server mode.

File Listing

The file content with the documentation metadata removed is:

1
6#pragma once
7
8#include "builder/Node.h"
9#include "builder/OutputSpec.h"
10
11#include <cstdint>
12#include <memory>
13#include <string>
14#include <vector>
15
16namespace simaai::neat {
17
18class StillImageInput final : public Node, public OutputSpecProvider {
19public:
20 struct ContentWidth {
21 int value = 0;
22 constexpr ContentWidth() = default;
23 constexpr ContentWidth(int v) : value(v) {}
24 };
25
26 struct ContentHeight {
27 int value = 0;
28 constexpr ContentHeight() = default;
29 constexpr ContentHeight(int v) : value(v) {}
30 };
31
32 struct EncodeWidth {
33 int value = 0;
34 constexpr EncodeWidth() = default;
35 constexpr EncodeWidth(int v) : value(v) {}
36 };
37
38 struct EncodeHeight {
39 int value = 0;
40 constexpr EncodeHeight() = default;
41 constexpr EncodeHeight(int v) : value(v) {}
42 };
43
45 int value = 30;
46 constexpr FramesPerSecond() = default;
47 constexpr FramesPerSecond(int v) : value(v) {}
48 };
49
52
53 std::string kind() const override {
54 return "StillImageInput";
55 }
56 std::string user_label() const override {
57 return image_path_;
58 }
59 InputRole input_role() const override {
60 return InputRole::Source;
61 }
62 NodeCapsBehavior caps_behavior() const override {
63 return NodeCapsBehavior::Static;
64 }
65
66 std::string backend_fragment(int node_index) const override;
67 std::vector<std::string> element_names(int node_index) const override;
68 OutputSpec output_spec(const OutputSpec& input) const override;
69
70 const std::string& image_path() const {
71 return image_path_;
72 }
73 int content_w() const {
74 return content_w_;
75 }
76 int content_h() const {
77 return content_h_;
78 }
79 int enc_w() const {
80 return enc_w_;
81 }
82 int enc_h() const {
83 return enc_h_;
84 }
85 int fps() const {
86 return fps_;
87 }
88 const std::shared_ptr<std::vector<uint8_t>>& nv12_enc() const {
89 return nv12_enc_;
90 }
91
92private:
93 std::string image_path_;
94 int content_w_ = 0;
95 int content_h_ = 0;
96 int enc_w_ = 0;
97 int enc_h_ = 0;
98 int fps_ = 30;
99
100 std::shared_ptr<std::vector<uint8_t>> nv12_enc_;
101};
102
103} // namespace simaai::neat
104
105namespace simaai::neat::nodes {
106std::shared_ptr<simaai::neat::Node>
112} // namespace simaai::neat::nodes

Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.1.