changeset 26:f71efdd08c33

RTP Tx: add auto_marker mode of operation
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 07 Jul 2024 18:30:44 +0000
parents e67b3bb87d1b
children a0b89c028053
files include/endp.h src/rtp_tx.c
diffstat 2 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/include/endp.h	Sun Jul 07 17:41:19 2024 +0000
+++ b/include/endp.h	Sun Jul 07 18:30:44 2024 +0000
@@ -67,4 +67,4 @@
 
 int twrtp_endp_tx_quantum(struct twrtp_endp *endp, const uint8_t *payload,
 			  unsigned payload_len, uint8_t payload_type,
-			  bool marker, bool send_rtcp);
+			  bool marker, bool auto_marker, bool send_rtcp);
--- a/src/rtp_tx.c	Sun Jul 07 17:41:19 2024 +0000
+++ b/src/rtp_tx.c	Sun Jul 07 18:30:44 2024 +0000
@@ -28,7 +28,7 @@
 
 int twrtp_endp_tx_quantum(struct twrtp_endp *endp, const uint8_t *payload,
 			  unsigned payload_len, uint8_t payload_type,
-			  bool marker, bool send_rtcp)
+			  bool marker, bool auto_marker, bool send_rtcp)
 {
 	uint32_t ts_quantum = endp->twjit->ts_quantum;
 	struct msgb *msg;
@@ -52,6 +52,8 @@
 		endp->tx.ts = gen_timestamp(&now, endp->twjit);
 		endp->tx.started = true;
 		endp->tx.restart = false;
+		if (auto_marker)
+			marker = true;
 	} else if (endp->tx.restart) {
 		restart_ts = gen_timestamp(&now, endp->twjit);
 		ts_delta = (int32_t)(restart_ts - endp->tx.ts);
@@ -64,6 +66,8 @@
 			endp->tx.ts = restart_ts;
 		}
 		endp->tx.restart = false;
+		if (auto_marker)
+			marker = true;
 	}
 
 	rtph = (struct rtp_basic_hdr *)