FreeCalypso > hg > themwi-rtp-lib
comparison src/rtp_tx.c @ 27:a0b89c028053
RTP Tx: implement skip operation
| author | Mychaela Falconia <falcon@freecalypso.org> |
|---|---|
| date | Sun, 07 Jul 2024 18:39:24 +0000 |
| parents | f71efdd08c33 |
| children | defe58aa537c |
comparison
equal
deleted
inserted
replaced
| 26:f71efdd08c33 | 27:a0b89c028053 |
|---|---|
| 41 | 41 |
| 42 if (!endp->register_done || !endp->remote_set) | 42 if (!endp->register_done || !endp->remote_set) |
| 43 return -EINVAL; | 43 return -EINVAL; |
| 44 msg = msgb_alloc_c(endp, sizeof(struct rtp_basic_hdr) + payload_len, | 44 msg = msgb_alloc_c(endp, sizeof(struct rtp_basic_hdr) + payload_len, |
| 45 "ThemWi-RTP-Tx"); | 45 "ThemWi-RTP-Tx"); |
| 46 if (!msg) | 46 if (!msg) { |
| 47 twrtp_endp_tx_skip(endp); | |
| 47 return -ENOMEM; | 48 return -ENOMEM; |
| 49 } | |
| 48 | 50 |
| 49 /* timestamp generation is where we do some trickery */ | 51 /* timestamp generation is where we do some trickery */ |
| 50 osmo_clock_gettime(CLOCK_REALTIME, &now); | 52 osmo_clock_gettime(CLOCK_REALTIME, &now); |
| 51 if (!endp->tx.started) { | 53 if (!endp->tx.started) { |
| 52 endp->tx.ts = gen_timestamp(&now, endp->twjit); | 54 endp->tx.ts = gen_timestamp(&now, endp->twjit); |
| 92 | 94 |
| 93 /* TODO: send RTCP if requested */ | 95 /* TODO: send RTCP if requested */ |
| 94 | 96 |
| 95 return 0; | 97 return 0; |
| 96 } | 98 } |
| 99 | |
| 100 void twrtp_endp_tx_skip(struct twrtp_endp *endp) | |
| 101 { | |
| 102 if (!endp->tx.started || endp->tx.restart) | |
| 103 return; | |
| 104 endp->tx.ts += endp->twjit->ts_quantum; | |
| 105 } |
