gstreamer
Loading...
Searching...
No Matches
event.cc
Go to the documentation of this file.
1// gstreamer
4
5// Implementation summary:
6// Write the opening and closing delimiters for one event block.
7// Use '\n' instead of std::endl so each line does not force a flush.
8
9bool GstreamerTextFactory::startEventImpl([[maybe_unused]] const std::shared_ptr<GEventDataCollection>& event_data) {
10 if (!ofile.is_open()) {
11 log->error(gstreamer::ERR_CANTOPENOUTPUT, SFUNCTION_NAME, "Error: can't access ", filename());
12 }
13
14 auto eventNumber = event_data->getHeader()->getG4LocalEvn();
15 ofile << "Event n. " << eventNumber << " {\n";
16
17 return true;
18}
19
20
21bool GstreamerTextFactory::endEventImpl([[maybe_unused]] const std::shared_ptr<GEventDataCollection>& event_data) {
22 if (!ofile.is_open()) {
23 log->error(gstreamer::ERR_CANTOPENOUTPUT, SFUNCTION_NAME, "Error: can't access ", filename());
24 }
25
26 int eventNumber = event_data->getHeader()->getG4LocalEvn();
27
28 ofile << "} end of event " << eventNumber << "\n";
29
30 return true;
31}
std::shared_ptr< GLogger > log
ASCII streamer plugin declarations.
Shared constants and error codes for the gstreamer module.
constexpr int ERR_CANTOPENOUTPUT
Output medium could not be opened successfully.