| 68 | } |
| 69 | |
| 70 | bool StreamThreadHttp::writeDataToOutputDevice(mpegts::PacketBuffer &buffer, StreamClient &client) { |
| 71 | static constexpr unsigned int dataSize = buffer.getBufferSize(); |
| 72 | const long timestamp = base::TimeCounter::getTicks() * 90; |
| 73 | |
| 74 | // RTP packet octet count (Bytes) |
| 75 | _stream.addRtpData(dataSize, timestamp); |
| 76 | |
| 77 | iovec iov[1]; |
| 78 | iov[0].iov_base = buffer.getTSReadBufferPtr(); |
| 79 | iov[0].iov_len = dataSize; |
| 80 | |
| 81 | // send the HTTP packet |
| 82 | if (!client.writeHttpData(iov, 1)) { |
| 83 | if (!client.isSelfDestructing()) { |
| 84 | SI_LOG_ERROR("Stream: %d, Error sending HTTP Stream Data to %s", _stream.getStreamID(), |
| 85 | client.getIPAddressOfStream().c_str()); |
| 86 | client.selfDestruct(); |
| 87 | } |
| 88 | } |
| 89 | return true; |
| 90 | } |
| 91 | |
| 92 | } // namespace output |
nothing calls this directly
no test coverage detected