gstreamer
Loading...
Searching...
No Matches
gstreamerJLABSROConnection.cc
Go to the documentation of this file.
1// gstreamer
4
5// Implementation summary:
6// Manage the lifetime of the binary output stream for the JLAB SRO backend.
7
8bool GstreamerJSROFactory::openConnection() {
9 ofile = new std::ofstream(filename());
10 if (!ofile->is_open()) {
11 log->error(ERR_CANTOPENOUTPUT, "GstreamerJSROFactory: could not open file " + filename());
12 }
13
14 log->info(0, "GstreamerJSROFactory: opened file " + filename());
15 return true;
16}
17
18bool GstreamerJSROFactory::closeConnectionImpl() {
19 if (ofile->is_open()) { ofile->close(); }
20
21 if (ofile->is_open()) {
22 log->error(ERR_CANTOPENOUTPUT, "GstreamerJSROFactory: could not close file " + filename());
23 }
24
25 delete ofile;
26 ofile = nullptr;
27 return true;
28}
std::shared_ptr< GLogger > log
void info(int level, Args &&... args) const
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.