GraphMetadata.h File
Stream metadata helpers for graph samples. More...
Included Headers
#include "graph/Graph.h"
#include "pipeline/SessionOptions.h"
#include <cstdint>
#include <string>
#include <unordered_map>
Namespaces Index
| namespace | simaai |
| namespace | neat |
| namespace | graph |
Classes Index
| struct | StreamMetadataDefaults |
|
Defaults applied to a Sample by the StreamMetadata stage. More... | |
Description
Stream metadata helpers for graph samples.
File Listing
The file content with the documentation metadata removed is:
8#include "graph/Graph.h"
9#include "pipeline/SessionOptions.h"
15namespace simaai::neat::graph {
28struct StreamMetadataDefaults {
30 std::string caps_string;
31 std::string stream_label;
33 std::string media_type;
35 std::string payload_tag;
36 bool fill_stream_id = true;
37 bool fill_input_seq = true;
38 bool fill_orig_input_seq = true;
53inline void ensure_stream_metadata(Sample& sample, const StreamMetadataDefaults& defaults,
55 if (sample.stream_id.empty() && defaults.fill_stream_id) {
56 if (!defaults.stream_id.empty()) {
59 sample.stream_id = "stream0";
63 if (defaults.fill_input_seq && sample.input_seq < 0) {
64 if (sample.orig_input_seq >= 0) {
65 sample.input_seq = sample.orig_input_seq;
67 auto& next = (*next_seq)[sample.stream_id];
68 sample.input_seq = next++;
70 sample.input_seq = 0;
74 if (defaults.fill_orig_input_seq && sample.orig_input_seq < 0) {
75 sample.orig_input_seq = sample.input_seq;
78 if (sample.caps_string.empty() && !defaults.caps_string.empty()) {
79 sample.caps_string = defaults.caps_string;
81 if (sample.stream_label.empty()) {
82 if (!defaults.stream_label.empty()) {
83 sample.stream_label = defaults.stream_label;
84 } else if (!defaults.port_name.empty()) {
85 sample.stream_label = defaults.port_name;
91 if (sample.media_type.empty() && !defaults.media_type.empty()) {
92 sample.media_type = defaults.media_type;
97 if (sample.payload_tag.empty() && !defaults.payload_tag.empty()) {
98 sample.payload_tag = defaults.payload_tag;
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.