Skip to content

Commit

Permalink
test: add RTCP_APP to RTCP test
Browse files Browse the repository at this point in the history
  • Loading branch information
alfredh authored and sreimers committed Jan 16, 2025
1 parent 9bcecda commit f4da98e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/rtcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ struct agent {
unsigned psfb_count;
unsigned rtpfb_count;
unsigned gnack_count;
unsigned app_count;
};


Expand All @@ -224,6 +225,10 @@ static void rtcp_recv_handler(const struct sa *src, struct rtcp_msg *msg,

switch (msg->hdr.pt) {

case RTCP_APP:
++ag->app_count;
break;

case RTCP_RTPFB:
if (msg->r.fb.fci.gnackv->pid == 42)
++ag->gnack_count;
Expand Down Expand Up @@ -274,6 +279,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_app(a.rtp_sock, "PING", (void *)"PONG", 4);
TEST_ERR(err);

err = rtcp_send_gnack(a.rtp_sock, rtp_sess_ssrc(b.rtp_sock), 42, 0);
TEST_ERR(err);

Expand All @@ -285,10 +293,13 @@ static int test_rtcp_loop_base(bool mux)

ASSERT_EQ(0, a.rtp_count);
ASSERT_EQ(0, a.psfb_count);
ASSERT_EQ(0, a.app_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);
ASSERT_EQ(1, b.app_count);

out:
mem_deref(b.rtp_sock);
Expand Down

0 comments on commit f4da98e

Please sign in to comment.