rtp包最大大小可配置

This commit is contained in:
monktan
2021-08-11 15:48:15 +08:00
parent 9e5d325e43
commit 7ed7e5386c
6 changed files with 13 additions and 6 deletions

View File

@@ -11,8 +11,6 @@
#include "Common/config.h"
#include "RtpReceiver.h"
#define RTP_MAX_SIZE (10 * 1024)
namespace mediakit {
RtpTrack::RtpTrack() {
@@ -36,8 +34,9 @@ RtpPacket::Ptr RtpTrack::inputRtp(TrackType type, int sample_rate, uint8_t *ptr,
WarnL << "rtp包太小:" << len;
return nullptr;
}
if (len > RTP_MAX_SIZE) {
WarnL << "超大的rtp包:" << len << " > " << RTP_MAX_SIZE;
GET_CONFIG(uint32_t, rtpMaxSize, Rtp::kRtpMaxSize);
if (len > 1024 * rtpMaxSize) {
WarnL << "超大的rtp包:" << len << " > " << 1024 * rtpMaxSize;
return nullptr;
}
if (!sample_rate) {