diff options
| author | Anton <anton@picapica.im> | 2026-11-29 23:38:25 +0400 |
|---|---|---|
| committer | Anton <anton@picapica.im> | 2026-11-29 23:38:25 +0400 |
| commit | 56863d74399c8d7354a00bc8ddc87b924ef870ab (patch) | |
| tree | bd9e44c438f974f80aa6cfef59fe842d3e128ee7 /pica-client/skynet.cpp | |
| parent | d6ce3a2226bda81cce96c61f0a73fb1516adbd0b (diff) | |
| download | pica-pica-call_quality_presets.tar.gz pica-pica-call_quality_presets.zip | |
pica-client: new presets tab, call quality presetscall_quality_presets
Diffstat (limited to 'pica-client/skynet.cpp')
| -rw-r--r-- | pica-client/skynet.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/pica-client/skynet.cpp b/pica-client/skynet.cpp index 2fbe21d..c30cbf3 100644 --- a/pica-client/skynet.cpp +++ b/pica-client/skynet.cpp @@ -75,6 +75,11 @@ SkyNet::SkyNet() }; + cbs.call_reception_report_cb = call_reception_report_cb; + + // emitted from this object's thread, delivered on the GUI thread + qRegisterMetaType<CallReceptionReport>("CallReceptionReport"); + PICA_client_init(&cbs); this->active_nodelink = NULL; @@ -1483,6 +1488,11 @@ void SkyNet::emit_CallMediaTransportChanged(QByteArray peer_id, bool direct_udp, emit CallMediaTransportChanged(peer_id, direct_udp, ciphersuitename, max_payload); } +void SkyNet::emit_CallReceptionReported(QByteArray peer_id, CallReceptionReport report) +{ + emit CallReceptionReported(peer_id, report); +} + //callbacks void SkyNet::newmsg_cb(const unsigned char *peer_id, const char *msgbuf, unsigned int nb, int type) @@ -1761,3 +1771,20 @@ void SkyNet::call_media_transport_cb(const unsigned char *peer_id, int transport ciphersuitename ? QString::fromLatin1(ciphersuitename) : QString(), max_payload); } + +void SkyNet::call_reception_report_cb(const unsigned char *peer_id, const struct PICA_call_reception_report *report) +{ + CallReceptionReport r; + + r.periodMs = report->period; + r.audioReceived = report->audio_received; + r.audioLost = report->audio_lost; + r.videoReceived = report->video_received; + r.videoLost = report->video_lost; + r.audioOctets = report->audio_octets; + r.videoOctets = report->video_octets; + r.queuingDelayMs = report->queuing_delay == PICA_PROTO_CALL_RECEPTION_REPORT_DELAY_UNKNOWN + ? -1 : report->queuing_delay; + + skynet->emit_CallReceptionReported(QByteArray((const char*)peer_id, PICA_ID_SIZE), r); +} |
