RTCP.h

Go to the documentation of this file.
00001 /***************************************************************************
00002                        RTCP.h  -  description
00003                              -------------------
00004     (C) 2007 Ahmed Ayadi  <ahmed.ayadi@sophia.inria.fr>
00005     (C) 2001 Matthias Oppitz <Matthias.Oppitz@gmx.de>
00006  ***************************************************************************/
00007 
00008 /***************************************************************************
00009  *                                                                         *
00010  *   This program is free software; you can redistribute it and/or modify  *
00011  *   it under the terms of the GNU General Public License as published by  *
00012  *   the Free Software Foundation; either version 2 of the License, or     *
00013  *   (at your option) any later version.                                   *
00014  *                                                                         *
00015  ***************************************************************************/
00016 
00017 
00022 #ifndef __INET_RTCPENDSYSTEMMODULE_H
00023 #define __INET_RTCPENDSYSTEMMODULE_H
00024 
00025 #include "INETDefs.h"
00026 #include "IPAddress.h"
00027 #include "RTPInnerPacket.h"
00028 #include "RTPParticipantInfo.h"
00029 #include "RTPSenderInfo.h"
00030 #include "RTPReceiverInfo.h"
00031 
00037 class INET_API RTCP : public cSimpleModule
00038 {
00039     public:
00040         RTCP();
00041 
00042     protected:
00046         virtual void initialize();
00047 
00048         virtual ~RTCP();
00049 
00053         virtual void handleMessage(cMessage *msg);
00054 
00058         virtual void handleMessageFromRTP(cMessage *msg);
00059 
00063         virtual void handleMessageFromUDP(cMessage *msg);
00064 
00068         virtual void handleSelfMessage(cMessage *msg);
00069 
00073         virtual void initializeRTCP(RTPInnerPacket *rinp);
00074 
00078         virtual void senderModuleInitialized(RTPInnerPacket *rinp);
00079 
00083         virtual void dataOut(RTPInnerPacket *packet);
00084 
00088         virtual void dataIn(RTPInnerPacket *rinp);
00089 
00095         virtual void leaveSession(RTPInnerPacket *rinp);
00096 
00100         virtual void connectRet();
00101 
00106         virtual void readRet(cPacket *sifpIn);
00107 
00108     protected:
00109 
00113         int _mtu;
00114 
00118         int _bandwidth;
00119 
00123         int _rtcpPercentage;
00124 
00128         IPAddress _destinationAddress;
00129 
00133         int _port;
00134 
00138         bool _ssrcChosen;
00139 
00143         bool _leaveSession;
00144 
00148         RTPSenderInfo *_senderInfo;
00149 
00154         cArray *_participantInfos;
00155 
00159         int _socketFdIn;
00160 
00164         int _socketFdOut;
00165 
00170         int _packetsCalculated;
00171 
00175         double _averagePacketSize;
00176 
00182         cOutVector *_rtcpIntervalOutVector;
00183 
00187         virtual void createSocket();
00188 
00192         virtual void chooseSSRC();
00193 
00198         virtual void scheduleInterval();
00199 
00203         virtual void createPacket();
00204 
00208         virtual void processOutgoingRTPPacket(RTPPacket *packet);
00209 
00213         virtual void processIncomingRTPPacket(RTPPacket *packet, IPAddress address, int port);
00214 
00218         virtual void processIncomingRTCPPacket(RTCPCompoundPacket *packet, IPAddress address, int port);
00219 
00225         virtual RTPParticipantInfo* findParticipantInfo(uint32 ssrc);
00226 
00231         virtual void calculateAveragePacketSize(int size);
00232 };
00233 
00234 #endif
00235 
00236