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

Method writeDataToOutputDevice

src/output/StreamThreadRtp.cpp:84–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82}
83
84bool StreamThreadRtp::writeDataToOutputDevice(mpegts::PacketBuffer &buffer, StreamClient &client) {
85 // update sequence number and timestamp
86 const long timestamp = base::TimeCounter::getTicks() * 90;
87 ++_cseq;
88 buffer.tagRTPHeaderWith(_cseq, timestamp);
89
90 static constexpr size_t dataSize = buffer.getBufferSize();
91 static constexpr size_t len = dataSize + mpegts::PacketBuffer::RTP_HEADER_LEN;
92
93 // RTP packet octet count (Bytes)
94 _stream.addRtpData(dataSize, timestamp);
95
96 // send the RTP/UDP packet
97 const unsigned char *rtpBuffer = buffer.getReadBufferPtr();
98 SocketAttr &rtp = client.getRtpSocketAttr();
99 if (!rtp.sendDataTo(rtpBuffer, len, MSG_DONTWAIT)) {
100 if (!client.isSelfDestructing()) {
101 SI_LOG_ERROR("Stream: %d, Error sending RTP/UDP data to %s:%d", _stream.getStreamID(),
102 rtp.getIPAddressOfSocket().c_str(), rtp.getSocketPort());
103 client.selfDestruct();
104 }
105 }
106 return true;
107}
108
109} // namespace output

Callers

nothing calls this directly

Calls 10

tagRTPHeaderWithMethod · 0.80
getBufferSizeMethod · 0.80
addRtpDataMethod · 0.80
getReadBufferPtrMethod · 0.80
sendDataToMethod · 0.80
isSelfDestructingMethod · 0.80
getIPAddressOfSocketMethod · 0.80
getSocketPortMethod · 0.80
selfDestructMethod · 0.80
getStreamIDMethod · 0.45

Tested by

no test coverage detected