gstreamer
Loading...
Searching...
No Matches
publishPayload.cc
Go to the documentation of this file.
1// gstreamer
4
5// Implementation summary:
6// Write only the payload word section of the current frame record.
7
8bool GstreamerJSROFactory::publishPayloadImpl([[maybe_unused]] const std::vector<GIntegralPayload*>* payload) {
9 if (ofile == nullptr) { log->error(ERR_CANTOPENOUTPUT, "Error: can't open ", ofile); }
10
11 static constexpr int header_offset = sizeof(DataFrameHeader) / 4;
12 std::vector<unsigned int> payload_data(frame_data.size() - header_offset);
13
14 // Skip the header words and write only the payload section.
15 std::copy(frame_data.cbegin() + header_offset, frame_data.cend(), payload_data.begin());
16 ofile->write(reinterpret_cast<const char*>(payload_data.data()),
17 sizeof(unsigned int) * payload_data.size());
18
19 return true;
20}
std::shared_ptr< GLogger > log
void error(int exit_code, Args &&... args) const
Shared constants and error codes for the gstreamer module.
#define ERR_CANTOPENOUTPUT
Output medium could not be opened successfully.
JLAB SRO binary frame streamer declarations.
Packed binary frame header written ahead of each JLAB SRO payload.