changeset 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
files include/endp.h src/rtp_tx.c
diffstat 2 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/include/endp.h	Sun Jul 07 18:30:44 2024 +0000
+++ b/include/endp.h	Sun Jul 07 18:39:24 2024 +0000
@@ -68,3 +68,4 @@
 int twrtp_endp_tx_quantum(struct twrtp_endp *endp, const uint8_t *payload,
 			  unsigned payload_len, uint8_t payload_type,
 			  bool marker, bool auto_marker, bool send_rtcp);
+void twrtp_endp_tx_skip(struct twrtp_endp *endp);
--- a/src/rtp_tx.c	Sun Jul 07 18:30:44 2024 +0000
+++ b/src/rtp_tx.c	Sun Jul 07 18:39:24 2024 +0000
@@ -43,8 +43,10 @@
 		return -EINVAL;
 	msg = msgb_alloc_c(endp, sizeof(struct rtp_basic_hdr) + payload_len,
 			   "ThemWi-RTP-Tx");
-	if (!msg)
+	if (!msg) {
+		twrtp_endp_tx_skip(endp);
 		return -ENOMEM;
+	}
 
 	/* timestamp generation is where we do some trickery */
 	osmo_clock_gettime(CLOCK_REALTIME, &now);
@@ -94,3 +96,10 @@
 
 	return 0;
 }
+
+void twrtp_endp_tx_skip(struct twrtp_endp *endp)
+{
+	if (!endp->tx.started || endp->tx.restart)
+		return;
+	endp->tx.ts += endp->twjit->ts_quantum;
+}