gstreamer
Loading...
Searching...
No Matches
eventHeader.cc
Go to the documentation of this file.
1// gstreamer
4
5// Implementation summary:
6// Append the event header fields to the JSON event object currently under construction.
7
8bool GstreamerJsonFactory::publishEventHeaderImpl(const std::unique_ptr<GEventHeader>& gevent_header) {
9 if (!is_building_event) {
11 "publishEventHeaderImpl called without an active event in GstreamerJsonFactory");
12 return false;
13 }
14 if (!gevent_header) {
16 "gevent_header is null in GstreamerJsonFactory::publishEventHeaderImpl");
17 return false;
18 }
19
20 // Cache selected values because other publish steps may use them for diagnostics
21 // or schema shaping.
22 timestamp = gevent_header->getTimeStamp();
23 thread_id = gevent_header->getThreadID();
24
25 // startEventImpl() already emitted:
26 // { "event_number": ..., "header": {
27 // so this method only appends the header fields themselves.
28 current_event << "\"timestamp\": \"" << jsonEscape(timestamp) << "\""
29 << ", \"thread_id\": " << thread_id
30 << ", \"g4local_event\": " << gevent_header->getG4LocalEvn();
31 current_event << "}"; // close the "header" object opened in startEventImpl
32
33 current_event_has_header = true;
34 return true;
35}
std::shared_ptr< GLogger > log
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.