diff --git a/src/decoder/gb28181/rtp/RTPReceiver.cpp b/src/decoder/gb28181/rtp/RTPReceiver.cpp index e48801b..77ddf9a 100644 --- a/src/decoder/gb28181/rtp/RTPReceiver.cpp +++ b/src/decoder/gb28181/rtp/RTPReceiver.cpp @@ -3,6 +3,7 @@ #include #include "../common_header.h" +#include "../sip/SipServer.h" #ifdef __linux__ #include "arpa/inet.h" @@ -12,9 +13,6 @@ const int kVideoFrameSize = BUFFERSIZE_1024*BUFFERSIZE_1024*5*2; -const int MIN_RTP_PORT = 10000 ; -const int MAX_RTP_PORT = 60000; - // PS解包器回调 static int ReceivePESFunction(unsigned char streamid, void * data, int size, uint64_t pts, uint64_t localPts, bool key, void* param) { @@ -312,6 +310,10 @@ int RTPReceiver::ParsePacket(RTPPacket* packet){ int RTPReceiver::allocRtpPort() { + SipServer* pServer = SipServer::getInstance(); + int MIN_RTP_PORT = pServer->GetMinRtpPort() ; + int MAX_RTP_PORT = pServer->GetMaxRtpPort(); + int s_rtpPort = MIN_RTP_PORT; srand((unsigned int)time(NULL));