RTP Trace System  1.0
traceserver.h
Go to the documentation of this file.
00001 // ##########################################################################
00002 // ####                                                                  ####
00003 // ####                    Master Thesis Implementation                  ####
00004 // ####  Management of Layered Variable Bitrate Multimedia Streams over  ####
00005 // ####                  DiffServ with A Priori Knowledge                ####
00006 // ####                                                                  ####
00007 // #### ================================================================ ####
00008 // ####                                                                  ####
00009 // ####                                                                  ####
00010 // #### Trace Server                                                     ####
00011 // ####                                                                  ####
00012 // #### Version 1.00  --  February 19, 2001                              ####
00013 // ####                                                                  ####
00014 // #### Copyright (C) 2000/2001 Thomas Dreibholz                         ####
00015 // #### University of Bonn, Department of Computer Science IV            ####
00016 // #### EMail: dreibh@iem.uni-due.de                                     ####
00017 // #### WWW:   https://www.uni-due.de/~be0001/diplom/index.html          ####
00018 // ####                                                                  ####
00019 // ##########################################################################
00020 
00021 
00022 #ifndef TRACESERVER_H
00023 #define TRACESERVER_H
00024 
00025 
00026 #include "system.h"
00027 #include "tdtfmediareader.h"
00028 #include "socket.h"
00029 #include "traceencoderrepository.h"
00030 #include "rtpsender.h"
00031 #include "rtcppacket.h"
00032 #include "rtcpreceiver.h"
00033 #include "rtcpabstractserver.h"
00034 #include "traceclientapppacket.h"
00035 #include "bandwidthmanager.h"
00036 #ifdef USE_TRANSPORTINFO
00037 #include "extendedtransportinfo.h"
00038 #endif
00039 
00040 
00041 #include <multimap.h>
00042 #include <algo.h>
00043 
00044 
00045 namespace Coral {
00046 
00047 
00055 class TraceServer : public RTCPAbstractServer
00056 {
00057    // ====== Definitions ====================================================
00058    private:
00059    struct User {
00060       RTCPAbstractServer::Client* Client;
00061       RTPSender                   Sender;
00062       Socket                      SenderSocket;
00063       InternetFlow                Flow;
00064       TraceEncoderRepository      Repository;
00065       TDTFMediaReader             Reader;
00066       String                      MediaName;
00067       integer                     StreamIdentifier;
00068       card16                      LastSequenceNumber;
00069       card16                      PosChgSeqNumber;
00070       bool                        ClientPause;
00071    };
00072 
00073 
00074    // ====== Constructor/Destructor =========================================
00075    public:
00082    TraceServer(BandwidthManager* bwManager,
00083                const cardinal    maxPacketSize = 1500);
00084 
00088    ~TraceServer();
00089 
00090 
00091    // ====== Status functions ===============================================
00097    card32 getOurSSRC() const;
00098 
00104    inline bool getLossScalability() const;
00105 
00111    inline void setLossScalability(const bool on);
00112 
00113 
00114    // ====== Packet size ====================================================
00120    inline cardinal getMaxPacketSize() const;
00121 
00128    inline cardinal setMaxPacketSize(const cardinal size);
00129 
00130 
00131    // ====== RTCPAbstractServer implementation ==============================
00135    void outOfMemoryWarning();
00136 
00142    void* newClient(Client* client, const char* cname);
00143 
00149    void deleteClient(Client* client, const DeleteReason reason);
00150 
00156    bool checkClient(const Client* client);
00157 
00163    void appMessage(const Client*  client,
00164                    const char*    name,
00165                    const void*    data,
00166                    const cardinal dataLength);
00167 
00173    void sdesMessage(const Client*  client,
00174                     const card8    type,
00175                     const char*    data,
00176                     const cardinal length);
00177 
00183    void receiverReport(const Client*                   client,
00184                        const RTCPReceptionReportBlock* report,
00185                        const cardinal                  layer);
00186 
00187 
00188    // ====== Execute user command ===========================================
00196    void userCommand(const Client*               client,
00197                     User*                       user,
00198                     const TraceClientAppPacket* app);
00199 
00206    void managementUpdate(const Client* client, User* user);
00207 
00208 
00209    // ====== Private data ===================================================
00210    private:
00211    BandwidthManager*              BandwidthMgr;
00212    multimap<const cardinal,User*> UserSet;
00213    Synchronizable                 UserSetSync;
00214    cardinal                       MaxPacketSize;
00215    card32                         OurSSRC;
00216    bool                           LossScalability;
00217 };
00218 
00219 
00220 }
00221 
00222 
00223 #include "traceserver.icc"
00224 
00225 
00226 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines