| 89 | } |
| 90 | |
| 91 | bool StreamThreadRtcpBase::threadExecuteFunction() { |
| 92 | // check do we need to update Device monitor signals |
| 93 | if (_mon_update == 0) { |
| 94 | _stream.getInputDevice()->monitorSignal(false); |
| 95 | |
| 96 | _mon_update = _stream.getRtcpSignalUpdateFrequency(); |
| 97 | } else { |
| 98 | --_mon_update; |
| 99 | } |
| 100 | |
| 101 | // RTCP compound packets must start with a SR, SDES then APP |
| 102 | std::size_t srlen = 0; |
| 103 | std::size_t sdeslen = 0; |
| 104 | std::size_t applen = 0; |
| 105 | uint8_t *sr = get_sr_packet(&srlen); |
| 106 | uint8_t *sdes = get_sdes_packet(&sdeslen); |
| 107 | uint8_t *app = get_app_packet(&applen); |
| 108 | |
| 109 | if (sr != nullptr && sdes != nullptr && app != nullptr) { |
| 110 | doSendDataToClient(_clientID, sr, srlen, sdes, sdeslen, app, applen); |
| 111 | } |
| 112 | DELETE_ARRAY(sr); |
| 113 | DELETE_ARRAY(sdes); |
| 114 | DELETE_ARRAY(app); |
| 115 | std::this_thread::sleep_for(std::chrono::milliseconds(200)); |
| 116 | |
| 117 | return true; |
| 118 | } |
| 119 | |
| 120 | uint8_t *StreamThreadRtcpBase::get_app_packet(std::size_t *len) { |
| 121 | uint8_t app[1024 * 2]; |
nothing calls this directly
no test coverage detected