| 140 | FileTarget(const string& path): ofile(path, ios::out | ios::trunc | ios::binary) {} |
| 141 | |
| 142 | void Write(const MediaPacket& data) override |
| 143 | { |
| 144 | ofile.write(data.payload.data(), data.payload.size()); |
| 145 | #ifdef PLEASE_LOG |
| 146 | applog.Debug() << "FileTarget::Write: " << data.payload.size() << " written to a file"; |
| 147 | #endif |
| 148 | } |
| 149 | |
| 150 | bool IsOpen() override { return !!ofile; } |
| 151 | bool Broken() override { return !ofile.good(); } |