11bool GstreamerJsonFactory::publishEventTrueInfoDataImpl(
const std::string& detectorName,
12 const std::vector<const GTrueInfoData*>& trueInfoData) {
13 if (!is_building_event) {
16 "publishEventTrueInfoDataImpl called without an active event in GstreamerJsonFactory");
21 if (!current_event_has_any_detector) {
22 current_event <<
", \"detectors\": {";
23 current_event_has_any_detector =
true;
25 current_event <<
", ";
28 current_event <<
"\"" << jsonEscape(detectorName) <<
"\": {";
31 current_event <<
"\"true_info\": [";
33 bool wrote_first_hit =
false;
34 for (
const auto* hit : trueInfoData) {
37 if (wrote_first_hit) current_event <<
", ";
38 wrote_first_hit =
true;
44 current_event <<
"\"address\": \"" << jsonEscape(addr) <<
"\"";
46 current_event <<
", \"vars\": {";
48 bool wrote_first_var =
false;
50 for (
const auto& [name, value] : hit->getDoubleVariablesMap()) {
51 if (wrote_first_var) current_event <<
", ";
52 wrote_first_var =
true;
53 current_event <<
"\"" << jsonEscape(name) <<
"\": " << value;
56 for (
const auto& [name, value] : hit->getStringVariablesMap()) {
57 if (wrote_first_var) current_event <<
", ";
58 wrote_first_var =
true;
59 current_event <<
"\"" << jsonEscape(name) <<
"\": \"" << jsonEscape(value) <<
"\"";
69 current_event <<
", \"digitized\": ";
70 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.