Skip to main content

OptiViewOutputGroup.h File

Runtime helpers for OptiView UDP video + JSON fan-out. More...

Included Headers

#include "nodes/io/OptiViewJsonOutput.h" #include "pipeline/SessionOptions.h" #include "pipeline/Run.h" #include <cstddef> #include <cstdint> #include <memory> #include <string> #include <vector>

Namespaces Index

namespacesimaai
namespaceneat
namespacenodes
namespacegroups

Classes Index

structUdpOutputNodeGroupOptions
classUdpOutputNodeGroup
structOptiViewOutputNodeGroupOptions
structOptiViewJsonInput
structOptiViewJsonResult
classOptiViewOutputNodeGroup

Description

Runtime helpers for OptiView UDP video + JSON fan-out.

File Listing

The file content with the documentation metadata removed is:

1
6#pragma once
7
10#include "pipeline/Run.h"
11
12#include <cstddef>
13#include <cstdint>
14#include <memory>
15#include <string>
16#include <vector>
17
19
21 std::string h264_caps;
22 int payload_type = 96;
24 bool enable_timings = false;
25 std::string host = "127.0.0.1";
26 int video_port_base = 9000;
27 bool udp_sync = false;
28 bool udp_async = false;
29};
30
32public:
33 bool init(const UdpOutputNodeGroupOptions& opt, size_t streams, std::string* err = nullptr);
34
35 bool push_video(size_t idx, const simaai::neat::Sample& sample) const;
36 bool try_push_video(size_t idx, const simaai::neat::Sample& sample) const;
37
38 void stop();
39 size_t size() const {
40 return runs_.size();
41 }
42
43 const std::vector<std::shared_ptr<simaai::neat::Run>>& runs() const {
44 return runs_;
45 }
46
47private:
49 std::vector<std::shared_ptr<simaai::neat::Run>> runs_;
50};
51
54 bool send_json = true;
55 int json_port_base = 9100;
56 int frame_w = 0;
57 int frame_h = 0;
58 int topk = 100;
59 bool parse_debug = false;
60 int json_delay_ms = 0;
62 std::vector<std::string> labels;
63};
64
66 size_t stream_idx = 0;
67 std::string stream_id;
68 int64_t frame_id = -1;
69 int64_t capture_ms = -1;
70 int64_t yolo_ms = -1;
74};
75
77 bool ok = false;
78 bool nonempty = false;
79 int boxes = 0;
80 std::string error;
81};
82
84public:
90 OptiViewOutputNodeGroup& operator=(OptiViewOutputNodeGroup&&) noexcept = default;
91
92 bool init(const OptiViewOutputNodeGroupOptions& opt, size_t streams, std::string* err = nullptr);
93
94 bool push_video(size_t idx, const simaai::neat::Sample& sample) const;
95 bool try_push_video(size_t idx, const simaai::neat::Sample& sample) const;
96 bool emit_json(const OptiViewJsonInput& in, OptiViewJsonResult* out = nullptr) const;
97
98 void stop();
99
100 const std::vector<std::shared_ptr<simaai::neat::Run>>& video_runs() const {
101 return udp_.runs();
102 }
103
104private:
105 int64_t pick_timestamp_ms_(const OptiViewJsonInput& in) const;
106
108 UdpOutputNodeGroup udp_;
109 std::vector<std::unique_ptr<simaai::neat::OptiViewJsonOutput>> senders_;
110};
111
112} // namespace simaai::neat::nodes::groups

Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.1.