From 415bbf64751c887d65e3a1521b834d060b57259c Mon Sep 17 00:00:00 2001 From: Sebastian Reimers Date: Wed, 4 Sep 2024 23:46:17 +0200 Subject: [PATCH] test/rtcp: add rtcp_send_gnack test --- test/rtcp.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/rtcp.c b/test/rtcp.c index 1641866f3..011e813d9 100644 --- a/test/rtcp.c +++ b/test/rtcp.c @@ -198,6 +198,8 @@ struct agent { struct sa laddr_rtcp; unsigned rtp_count; unsigned psfb_count; + unsigned rtpfb_count; + unsigned gnack_count; }; @@ -222,6 +224,12 @@ static void rtcp_recv_handler(const struct sa *src, struct rtcp_msg *msg, switch (msg->hdr.pt) { + case RTCP_RTPFB: + if (msg->r.fb.fci.gnackv->pid == 42) + ++ag->gnack_count; + ++ag->rtpfb_count; + break; + case RTCP_PSFB: ++ag->psfb_count; re_cancel(); @@ -266,6 +274,9 @@ static int test_rtcp_loop_base(bool mux) rtcp_start(a.rtp_sock, "cname", &b.laddr_rtcp); rtcp_start(b.rtp_sock, "cname", &a.laddr_rtcp); + err = rtcp_send_gnack(a.rtp_sock, rtp_sess_ssrc(b.rtp_sock), 42, 0); + TEST_ERR(err); + err = rtcp_send_pli(a.rtp_sock, rtp_sess_ssrc(b.rtp_sock)); TEST_ERR(err); @@ -276,6 +287,8 @@ static int test_rtcp_loop_base(bool mux) ASSERT_EQ(0, a.psfb_count); ASSERT_EQ(0, b.rtp_count); ASSERT_EQ(1, b.psfb_count); + ASSERT_EQ(1, b.rtpfb_count); + ASSERT_EQ(1, b.gnack_count); out: mem_deref(b.rtp_sock);