diff --git a/janus/src/plugin.c b/janus/src/plugin.c index 46c95b3..8cd7e4b 100644 --- a/janus/src/plugin.c +++ b/janus/src/plugin.c @@ -279,7 +279,7 @@ static void *_acap_thread(void *arg) { if (_get_acap_hz(&hz) < 0 || acap->pcm_hz != hz) { goto close_acap; } - uz size = US_RTP_DATAGRAM_SIZE - US_RTP_HEADER_SIZE; + uz size = US_RTP_TOTAL_SIZE - US_RTP_HEADER_SIZE; u8 data[size]; u64 pts; const int result = us_acap_get_encoded(acap, data, &size, &pts); diff --git a/janus/src/rtp.h b/janus/src/rtp.h index 8f79c8e..8af07d7 100644 --- a/janus/src/rtp.h +++ b/janus/src/rtp.h @@ -26,9 +26,9 @@ // https://stackoverflow.com/questions/47635545/why-webrtc-chose-rtp-max-packet-size-to-1200-bytes -#define US_RTP_DATAGRAM_SIZE 1200 +#define US_RTP_TOTAL_SIZE 1200 #define US_RTP_HEADER_SIZE 12 -#define US_RTP_PAYLOAD_SIZE (US_RTP_DATAGRAM_SIZE - US_RTP_HEADER_SIZE) +#define US_RTP_PAYLOAD_SIZE (US_RTP_TOTAL_SIZE - US_RTP_HEADER_SIZE) #define US_RTP_H264_PAYLOAD 96 #define US_RTP_OPUS_PAYLOAD 111 @@ -43,7 +43,7 @@ typedef struct { u32 ssrc; u16 seq; - u8 datagram[US_RTP_DATAGRAM_SIZE]; + u8 datagram[US_RTP_TOTAL_SIZE]; uz used; bool first_of_frame; diff --git a/janus/src/rtpa.c b/janus/src/rtpa.c index 54eac7c..0583573 100644 --- a/janus/src/rtpa.c +++ b/janus/src/rtpa.c @@ -45,7 +45,7 @@ void us_rtpa_destroy(us_rtpa_s *rtpa) { } void us_rtpa_wrap(us_rtpa_s *rtpa, const u8 *data, uz size, u32 pts) { - if (size + US_RTP_HEADER_SIZE <= US_RTP_DATAGRAM_SIZE) { + if (size + US_RTP_HEADER_SIZE <= US_RTP_TOTAL_SIZE) { us_rtp_write_header(rtpa->rtp, pts, false); memcpy(rtpa->rtp->datagram + US_RTP_HEADER_SIZE, data, size); rtpa->rtp->used = size + US_RTP_HEADER_SIZE; diff --git a/janus/src/rtpv.c b/janus/src/rtpv.c index c47f61d..10344f1 100644 --- a/janus/src/rtpv.c +++ b/janus/src/rtpv.c @@ -116,7 +116,7 @@ void _rtpv_process_nalu(us_rtpv_s *rtpv, const u8 *data, uz size, u32 pts, bool rtpv->rtp->last_of_frame = m_lof; \ } - if (size + US_RTP_HEADER_SIZE <= US_RTP_DATAGRAM_SIZE) { + if (size + US_RTP_HEADER_SIZE <= US_RTP_TOTAL_SIZE) { us_rtp_write_header(rtpv->rtp, pts, marked); memcpy(dg + US_RTP_HEADER_SIZE, data, size); rtpv->rtp->used = size + US_RTP_HEADER_SIZE; @@ -137,7 +137,7 @@ void _rtpv_process_nalu(us_rtpv_s *rtpv, const u8 *data, uz size, u32 pts, bool bool first = true; while (remaining > 0) { - sz frag_size = US_RTP_DATAGRAM_SIZE - fu_overhead; + sz frag_size = US_RTP_TOTAL_SIZE - fu_overhead; const bool last = (remaining <= frag_size); if (last) { frag_size = remaining;