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

Method threadExecuteFunction

src/output/StreamThreadRtcpBase.cpp:91–118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89}
90
91bool 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
120uint8_t *StreamThreadRtcpBase::get_app_packet(std::size_t *len) {
121 uint8_t app[1024 * 2];

Callers

nothing calls this directly

Calls 3

getInputDeviceMethod · 0.80
monitorSignalMethod · 0.45

Tested by

no test coverage detected