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 |
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 {
17struct StreamMetadataDefaults {
19 std::string caps_string;
21 std::string media_type;
23 std::string payload_tag;
24 bool fill_stream_id = true;
25 bool fill_input_seq = true;
26 bool fill_orig_input_seq = true;
29inline void ensure_stream_metadata(Sample& sample, const StreamMetadataDefaults& defaults,
31 if (sample.stream_id.empty() && defaults.fill_stream_id) {
32 if (!defaults.stream_id.empty()) {
35 sample.stream_id = "stream0";
39 if (defaults.fill_input_seq && sample.input_seq < 0) {
40 if (sample.orig_input_seq >= 0) {
41 sample.input_seq = sample.orig_input_seq;
43 auto& next = (*next_seq)[sample.stream_id];
44 sample.input_seq = next++;
46 sample.input_seq = 0;
50 if (defaults.fill_orig_input_seq && sample.orig_input_seq < 0) {
51 sample.orig_input_seq = sample.input_seq;
54 if (sample.caps_string.empty() && !defaults.caps_string.empty()) {
55 sample.caps_string = defaults.caps_string;
60 if (sample.media_type.empty() && !defaults.media_type.empty()) {
61 sample.media_type = defaults.media_type;
66 if (sample.payload_tag.empty() && !defaults.payload_tag.empty()) {
67 sample.payload_tag = defaults.payload_tag;
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.1.