11bool GstreamerJsonFactory::publishEventTrueInfoDataImpl(
const std::string& detectorName,
12 const std::vector<const GTrueInfoData*>& trueInfoData) {
13 if (!is_building_event) {
15 "publishEventTrueInfoDataImpl called without an active event in GstreamerJsonFactory");
20 if (!current_event_has_any_detector) {
21 current_event <<
", \"detectors\": {";
22 current_event_has_any_detector =
true;
24 current_event <<
", ";
27 current_event <<
"\"" << jsonEscape(detectorName) <<
"\": {";
30 current_event <<
"\"true_info\": [";
32 bool wrote_first_hit =
false;
33 for (
const auto* hit : trueInfoData) {
36 if (wrote_first_hit) current_event <<
", ";
37 wrote_first_hit =
true;
43 current_event <<
"\"address\": \"" << jsonEscape(addr) <<
"\"";
45 current_event <<
", \"vars\": {";
47 bool wrote_first_var =
false;
49 for (
const auto& [name, value] : hit->getDoubleVariablesMap()) {
50 if (wrote_first_var) current_event <<
", ";
51 wrote_first_var =
true;
52 current_event <<
"\"" << jsonEscape(name) <<
"\": " << value;
55 for (
const auto& [name, value] : hit->getStringVariablesMap()) {
56 if (wrote_first_var) current_event <<
", ";
57 wrote_first_var =
true;
58 current_event <<
"\"" << jsonEscape(name) <<
"\": \"" << jsonEscape(value) <<
"\"";
68 current_event <<
", \"digitized\": ";
69 current_event <<
"[]";
std::shared_ptr< GLogger > log
std::string getIdentityString(std::vector< GIdentifier > gidentity)
Shared constants and error codes for the gstreamer module.
JSON streamer plugin declarations.
constexpr int ERR_PUBLISH_ERROR
Publish sequence encountered invalid state or invalid input data.