/****************************************************************************** * FILE: RtpApp2.h * Description: * Audio rtp session interface class. * * Modified Code History * Mark Date By Modification Reason ******************************************************************************* * 01 2010-10-3 songxw Initial creation. ******************************************************************************/ #if !defined(__RTP_APP2_H__) #define __RTP_APP2_H__ using namespace std; #include "TypeDef.h" #include "rtpsession.h" #include "rtpudpv4transmitter.h" #include "rtpsessionparams.h" #include "rtpipv4address.h" #include "str.h" using namespace jrtplib; /* Interface class of jrtplib module */ class CRtpApp2 : public RTPSession { public: CRtpApp2(); ~CRtpApp2(); int CreateSession(UINT16 ListenPort, UINT32 nSsrc = 0, bool usethread = true); //RTP´´½¨ void RtpDestroy(); //RTPÏú»Ù void SetTsunit(double ts) {tsunit = ts;} double GetTsunit(void) {return tsunit;}; //Set and send out nat mapping packet int NatMappingControl(char IpStr[], UINT16 port, int SSId); RTPUDPv4TransmissionParams TransParams; RTPSessionParams SessParams; bool bSendTo; protected: void OnPollThreadStep(); //Send a packet to traverse NAT void SendNatMappingPacket(void); //NAT packet time interval time_t SendTimeForNAT; private: virtual void CBRtpRecv2(); //RTP½ÓÊÕ±¨ÎÄ double tsunit; //ʱ¼ä´Á //Running time struct timeval RunTime; //Sequence number for a packet of traversing NAT UINT16 SeqNum; //Session ID for a call int SessionID; }; #endif //#if !defined(__RTP_APP2_H__)