MCPcopy Create free account
hub / github.com/Barracuda09/SATPI / writeDataToOutputDevice

Method writeDataToOutputDevice

src/output/StreamThreadTSWriter.cpp:56–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54}
55
56bool StreamThreadTSWriter::writeDataToOutputDevice(mpegts::PacketBuffer &buffer, StreamClient &UNUSED(client)) {
57 const unsigned char *tsBuffer = buffer.getTSReadBufferPtr();
58
59 static constexpr size_t dataSize = buffer.getBufferSize();
60
61 const long timestamp = base::TimeCounter::getTicks() * 90;
62
63 // RTP packet octet count (Bytes)
64 _stream.addRtpData(dataSize, timestamp);
65
66 // write TS packets to file
67 if (_file.is_open()) {
68 _file.write(reinterpret_cast<const char *>(tsBuffer), dataSize);
69 }
70 return true;
71}
72
73} // namespace output

Callers

nothing calls this directly

Calls 3

getTSReadBufferPtrMethod · 0.80
getBufferSizeMethod · 0.80
addRtpDataMethod · 0.80

Tested by

no test coverage detected