Skip to main content

JoinEncodedWithMeta.h File

Stage executor to join encoded payload with metadata into a Bundle. More...

Included Headers

#include "graph/StageExecutor.h" #include "graph/nodes/StageNode.h" #include <cstddef> #include <cstdint> #include <deque> #include <memory> #include <string> #include <unordered_map> #include <utility> #include <vector>

Namespaces Index

namespacesimaai
namespaceneat
namespacegraph
namespacenodes

Classes Index

structJoinEncodedWithMetaOptions

Configuration for a JoinEncodedWithMeta stage executor. More...

classJoinEncodedWithMeta

Stage executor that bundles an encoded payload (e.g., H.264) with associated metadata. More...

Description

Stage executor to join encoded payload with metadata into a Bundle.

File Listing

The file content with the documentation metadata removed is:

1
6#pragma once
7
10
11#include <cstddef>
12#include <cstdint>
13#include <deque>
14#include <memory>
15#include <string>
16#include <unordered_map>
17#include <utility>
18#include <vector>
19
21
32 PortId encoded_port = kInvalidPort;
34 std::unordered_map<PortId, std::string> port_names;
36 std::string encoded_name = "encoded";
38 std::size_t max_pending = 1024;
40 bool emit_partial = true;
41};
42
55public:
58
60 void set_ports(const StagePorts& ports) override;
62 void on_input(StageMsg&& msg, std::vector<StageOutMsg>& out) override;
64 void on_tick(std::int64_t now_ns, std::vector<StageOutMsg>& out) override;
65
66private:
67 std::string make_key_(const Sample& sample) const;
68 bool is_encoded_(PortId port, const Sample& sample) const;
69 std::string field_name_(PortId port, const Sample& sample, bool encoded) const;
70 void evict_if_needed_();
71
73 std::unordered_map<std::string, std::unordered_map<PortId, Sample>> pending_;
74 std::deque<std::string> order_;
75 PortId out_port_ = kInvalidPort;
76};
77
86std::shared_ptr<simaai::neat::graph::Node> JoinEncodedWithMetaNode(std::vector<std::string> inputs,
87 std::string label = {},
88 std::string output = "bundle");
89
90} // namespace simaai::neat::graph::nodes

Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.