Skip to content

Commit

Permalink
rtp: add RE_RTP_PCAP debug helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
sreimers committed Feb 7, 2024
1 parent 87e716e commit 189b318
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/rtp/rtp.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#include <re_atomic.h>
#include "rtcp.h"


#define DEBUG_MODULE "rtp"
#define DEBUG_LEVEL 5
#include <re_dbg.h>
Expand Down Expand Up @@ -167,6 +166,12 @@ static void rtcp_recv_handler(const struct sa *src, struct mbuf *mb, void *arg)
struct rtp_sock *rs = arg;
struct rtcp_msg *msg;

#ifdef RE_RTP_PCAP
char tid[32];
re_snprintf(tid, sizeof(tid), "RTCP ssrc=%u", rs->enc.ssrc);
re_text2pcap_trace("RTCP", true, mb);
#endif

while (0 == rtcp_decode(&msg, mb)) {

/* handle internally first */
Expand Down Expand Up @@ -202,6 +207,12 @@ static void udp_recv_handler(const struct sa *src, struct mbuf *mb, void *arg)
}
}

#ifdef RE_RTP_PCAP
char tid[32];
re_snprintf(tid, sizeof(tid), "RTP ssrc=%u", rs->enc.ssrc);
re_text2pcap_trace(tid, true, mb);
#endif

err = rtp_decode(rs, mb, &hdr);
if (err)
return;
Expand Down

0 comments on commit 189b318

Please sign in to comment.