#ifndef _RTP_UDP_RECEIVER_H_ #define _RTP_UDP_RECEIVER_H_ #include "rtpudpv4transmitter.h" #include "rtpipv4address.h" #include "rtpsessionparams.h" #include "rtpsession.h" #include #include #include #include #include #include "RTPReceiver.h" #define OUTTIME_RTCP 30*1000 #define PAYLOAD 99 #define PAYLOAD_PS 96 #define PAYLOAD_H264 98 #define PAYLOAD_MP4 97 #define UDP_SIZE 1400 #define MIN_PORT 10000 #define MAX_PORT 60000 #define RTP_MAX_PACKET_LEN 1450 using namespace jrtplib; using namespace std; class UdpRTPSession; class RTPUdpReceiver: public RTPReceiver { public: RTPUdpReceiver(); ~RTPUdpReceiver(); virtual bool Open(uint16_t localPort); virtual bool IsOpened() ; virtual void Close() ; public: int OnRtpRecv(); private: std::thread* m_rtpThreadPtr; // RTP接收线程 UdpRTPSession* m_rtpSessionPtr; // RTP会话 std::atomic_bool m_bRtpExit; // 标识RTP收包线程闭 std::atomic_bool m_bOpened; int64_t m_idleCount; int64_t m_noDataCount;//线程计数,用于打开流成功但是实际没流过来 RTPSessionParams* m_sessparamsPtr; RTPUDPv4TransmissionParams* m_transparamsPtr; }; #endif // _RTP_UDP_RECEIVER_H_