Returns the program name (i.e. filename of the binary)
| 16 | |
| 17 | // Returns the program name (i.e. filename of the binary) |
| 18 | static std::string GetProgramName() { |
| 19 | std::vector<char> temp(10000); |
| 20 | ssize_t size = readlink("/proc/self/exe", temp.data(), temp.size()); |
| 21 | if(size < 0) |
| 22 | return std::string(); |
| 23 | std::string path(temp.data(), size); |
| 24 | size_t p = path.find_last_of('/'); |
| 25 | if(p == std::string::npos) |
| 26 | return path; |
| 27 | return path.substr(p + 1); |
| 28 | } |
| 29 | |
| 30 | SSRVideoStreamWriter::SSRVideoStreamWriter(const std::string& channel, const std::string& source) { |
| 31 |
no test coverage detected