rtp.h
资源名称:h323.zip [点击查看]
上传用户:hnnddl
上传日期:2007-01-06
资源大小:3580k
文件大小:4k
源码类别:
IP电话/视频会议
开发平台:
WINDOWS
- /*
- * $Revision: 1.3 $
- * $Date: 1998/04/03 15:21:43 $
- */
- ////////////////////////////////////////////////////////////////
- // Copyright (c) 1996,97 Lucent Technologies //
- // All Rights Reserved //
- // //
- // THIS IS UNPUBLISHED //
- // PROPRIETARY SOURCE //
- // CODE OF Lucent Technologies //
- // AND elemedia //
- // //
- // The copyright notice above does not evidence any //
- // actual or intended publication of such source code//
- ////////////////////////////////////////////////////////////////
- //
- /////////////////////////////////////////////////////////////////
- // File : rtp.h //
- // //
- // This file declares RTP related classes. //
- // //
- // //
- // History: //
- // 15_Jan_1997 Created //
- // 30_Jun_1997 GetLocal method removed from RTPSession class. //
- // //
- /////////////////////////////////////////////////////////////////
- #if !defined(__RTP_H__)
- #define __RTP_H__
- #include "util/listifc.h"
- #include "rtp/endpoint.h"
- #include "rtp/packet.h"
- #include "rtp/ntptime.h"
- #include "rtp/reports.h"
- #include "rtp/rtperr.h"
- class ListManager;
- class CBuffer;
- class Logger;
- //
- // The RTP session class.
- //
- // A RTP session is a association among a set of
- // participants communicating using RTP. A session is
- // defined/identified by a set of two transport addresses
- // (eg ip-addr/port), one for RTP and the other for RTCP.
- //
- class DLLEXPORT RTPSession
- {
- public:
- // These classes need access to certain protected
- // methods of this class.
- friend class RTCPPacket;
- friend class RTPPacket;
- // cname: Canonical name for this endpoint
- // payload_type: Type of payload carried in the rtp packets
- // sampling_rate: Sampling rate for computing the MediaTime
- // (see GetMediaTime method)
- RTPSession(char *cname, int payload_type, int sampling_rate);
- ~RTPSession();
- // SDES methods
- void SetRealName(char *name, int length);
- void SetEMail(char *email, int length);
- void SetPhone(char *phone_number, int length);
- void SetLoc(char *loc, int length);
- void SetTool(char *tool, int length);
- void SetNote(char *note, int length);
- void SetPriv(char *priv, int length);
- // Lookup a participant based on ssrc.
- RTPEndpointInfo *GetParticipant(unsigned int ssrc);
- // Returns current number of participants in the
- // session.
- int GetNumParticipants();
- // table: Pointer to array of RTPEndpointInfo pointers.
- // length: Length of the table.
- int GetParticipants(RTPEndpointInfo **table, int length);
- // Returns pointer to local RTPEndpointInfo
- RTPEndpointInfo* GetLocalEndpointInfo();
- // Returns the RTP version
- int GetVersion();
- // Returns the current payload type.
- int GetPayloadType();
- void SetPayloadType(int pt);
- // Returns the mediatime corresponding to the current
- // wall clock time.
- unsigned int GetMediaTime();
- protected:
- // Generates next seq no
- unsigned short GetNextSequenceNo();
- // Returns pointer to ListManager class
- // containing the list of current participants
- // in the session.
- ListManager* GetParticipants();
- // Method to generate an unique SSRC
- unsigned int GenerateSSRC();
- unsigned short sequence_no;
- int payload_type;
- int rtp_version;
- // Our Endpoint info
- RTPEndpointInfo *local;
- // The endpoints list contains information regarding all remote
- // endpoints that participate with this local endpoint for this
- // session. This information has statistics needed for sending
- // reception reports.
- ListManager *endpoint_list;
- int sampling_rate;
- private:
- Logger *_logger;
- };
- #endif // __RTP_H__