FreeCalypso > hg > themwi-rtp-lib
comparison src/rtp_tx.c @ 33:e70e7b266f89
hook in RTCP output
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Mon, 08 Jul 2024 07:25:19 +0000 |
parents | defe58aa537c |
children |
comparison
equal
deleted
inserted
replaced
32:aa97e77e7de6 | 33:e70e7b266f89 |
---|---|
13 #include <osmocom/core/timer.h> | 13 #include <osmocom/core/timer.h> |
14 | 14 |
15 #include <themwi/rtp/endp.h> | 15 #include <themwi/rtp/endp.h> |
16 #include <themwi/rtp/rtp_basic_hdr.h> | 16 #include <themwi/rtp/rtp_basic_hdr.h> |
17 #include <themwi/rtp/twjit.h> | 17 #include <themwi/rtp/twjit.h> |
18 #include "endp_internal.h" | |
18 | 19 |
19 static uint32_t gen_timestamp(struct timespec *now, | 20 static uint32_t gen_timestamp(struct timespec *now, |
20 struct twrtp_jibuf_inst *twjit) | 21 struct twrtp_jibuf_inst *twjit) |
21 { | 22 { |
22 uint32_t ts; | 23 uint32_t ts; |
92 return rc; | 93 return rc; |
93 } | 94 } |
94 endp->stats.tx_rtp_pkt++; | 95 endp->stats.tx_rtp_pkt++; |
95 endp->stats.tx_rtp_bytes += payload_len; | 96 endp->stats.tx_rtp_bytes += payload_len; |
96 | 97 |
97 /* TODO: send RTCP if requested */ | 98 if (endp->auto_rtcp_interval) { |
99 endp->auto_rtcp_count++; | |
100 if (endp->auto_rtcp_count >= endp->auto_rtcp_interval) { | |
101 endp->auto_rtcp_count = 0; | |
102 send_rtcp = true; | |
103 } | |
104 } | |
105 if (send_rtcp) { | |
106 _twrtp_endp_send_rtcp(endp, true, &now, | |
107 endp->tx.ts - ts_quantum); | |
108 } | |
98 | 109 |
99 return 0; | 110 return 0; |
100 } | 111 } |
101 | 112 |
102 void twrtp_endp_tx_skip(struct twrtp_endp *endp) | 113 void twrtp_endp_tx_skip(struct twrtp_endp *endp) |