diff mtctest/rtp_sink.c @ 6:33d8b3177540

mtctest compiles in the new environment
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 09 Jun 2024 01:55:28 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mtctest/rtp_sink.c	Sun Jun 09 01:55:28 2024 +0000
@@ -0,0 +1,45 @@
+/*
+ * In this module we implement our RTP handling: obtaining a GSM-side
+ * RTP endpoint from themwi-rtp-mgr, then handling read select on RTP
+ * and RTCP UDP sockets.
+ */
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <stdio.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <string.h>
+#include <strings.h>
+
+#include <themwi/rtp/rtp_alloc_if.h>
+#include <themwi/rtp/rtp_alloc_simple.h>
+
+struct rtp_alloc_simple rtp_info;
+
+void
+obtain_rtp_endp()
+{
+	int rc;
+
+	rc = rtp_alloc_simple(RTP_ALLOC_TYPE_GSM, &rtp_info);
+	if (rc < 0)
+		exit(1);	/* error msg already printed */
+}
+
+void
+rtp_rx_select()
+{
+	u_char buf[512];
+
+	recv(rtp_info.gsm_rtp_fd, buf, sizeof buf, 0);
+}
+
+void
+rtcp_rx_select()
+{
+	u_char buf[512];
+
+	recv(rtp_info.gsm_rtcp_fd, buf, sizeof buf, 0);
+}