RTP Trace System  1.0
traceclient.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 Client                                                     ####
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 TRACECLIENT_H
00023 #define TRACECLIENT_H
00024 
00025 
00026 #include "tracedecoderinterface.h"
00027 #include "tracedecoderrepository.h"
00028 #include "mediainfo.h"
00029 #include "rtcpsender.h"
00030 #include "rtpreceiver.h"
00031 #include "internetaddress.h"
00032 #include "socket.h"
00033 #include "strings.h"
00034 
00035 
00036 #include "traceclientapppacket.h"
00037 
00038 
00039 #include <multimap.h>
00040 #include <algo.h>
00041 
00042 
00043 namespace Coral {
00044 
00045 
00053 class TraceClient
00054 {
00055    // ====== Constructor/Destructor =========================================
00056    public:
00062    TraceClient(const char* receiverName);
00063 
00067    ~TraceClient();
00068 
00069 
00070    // ====== Player functions ===============================================
00071    public:
00080    bool play(const char*  server,
00081              const char*  mediaName,
00082              const card32 sessionDescriptor = 0);
00083 
00091    void change(const char* mediaName);
00092 
00096    void stop();
00097 
00098 
00099    // ====== Settings =======================================================
00107    card64 getPosition();
00108 
00114    inline card64 getMaxPosition() const;
00115 
00121    MediaInfo getMediaInfo() const;
00122 
00123 
00129    inline card8 getErrorCode() const;
00130 
00136    inline const char* getEncoding() const;
00137 
00143    inline card64 getMinWantedBandwidth() const;
00144 
00150    inline card64 getMaxWantedBandwidth() const;
00151 
00157    inline double getMaxTransferDelay() const;
00158 
00164    inline double getWantedUtilization() const;
00165 
00171    inline int8 getStreamPriority() const;
00172 
00178    inline int8 getSessionPriority() const;
00179 
00180 
00181    // ====== Transmission information =======================================
00187    inline Range<card64> getBandwidth() const;
00188 
00194    inline double getFrameRate() const;
00195 
00201    inline double getUtilization() const;
00202 
00208    inline card32 getFlags() const;
00209 
00213    inline cardinal getLayers() const;
00214 
00220    card8 getIPVersion() const;
00221 
00227    inline bool playing() const;
00228 
00237    String getServerAddressString(InternetAddress::PrintFormat format = InternetAddress::PF_Address) const;
00238 
00247    String getOurAddressString(InternetAddress::PrintFormat format = InternetAddress::PF_Address) const;
00248 
00255    inline card64 getBytesReceived(const cardinal layer = 0) const;
00256 
00265    inline card64 getPacketsReceived(const cardinal layer = 0) const;
00266 
00275    inline InternetFlow getInternetFlow(const cardinal layer = 0) const;
00276 
00285    inline card32 getFlowLabel(const cardinal layer = 0) const;
00286 
00295    inline card8 getTrafficClass(const cardinal layer = 0) const;
00296 
00305    card32 getServerSSRC(const cardinal layer = 0) const;
00306 
00312    inline card32 getOurSSRC() const;
00313 
00322    card64 getPacketsLost(const cardinal layer = 0) const;
00323 
00332    double getFractionLost(const cardinal layer = 0) const;
00333 
00342    double getJitter(const cardinal layer = 0) const;
00343 
00344 
00351    const char* getEncodingName(const cardinal index);
00352 
00353 
00359    inline void setPosition(const card64 position);
00360 
00366    void setPause(const bool on);
00367 
00373    inline void setWantedUtilization(const double utilization);
00374 
00380    inline void setFlags(const card32 priority);
00381 
00387    inline void setMinWantedBandwidth(const card64 bandwidth);
00388 
00394    inline void setMaxWantedBandwidth(const card64 bandwidth);
00395 
00401    inline void setMaxTransferDelay(const double delay);
00402 
00408    inline void setStreamPriority(const int8 priority);
00409 
00415    inline void setSessionPriority(const int8 priority);
00416 
00422    void setEncoding(const cardinal index);
00423 
00424 
00425    // ====== Private data ===================================================
00426    private:
00427    void sendCommand(const bool updateRestartPosition = true);
00428 
00429 
00430    // Update of RestartPosition has to be delayed after change() call to
00431    // ensure that there are no more packets of the old file on the network
00432    // which change the restart position back to the old value.
00433    static const card64 RestartPositionUpdateDelay = 5000000;
00434 
00435 
00436    RTPReceiver*                                    Receiver;
00437    RTCPSender*                                     Sender;
00438    Socket                                          SenderSocket;
00439    Socket                                          ReceiverSocket;
00440    InternetFlow                                    Flow;
00441    InternetAddress                                 ServerAddress;
00442    InternetAddress                                 OurAddress;
00443    card32                                          OurSSRC;
00444    InternetAddress                                 ReceiverAddress;
00445 
00446    multimap<const cardinal,TraceDecoderInterface*> DecoderSet;
00447    TraceDecoderRepository                          Decoders;
00448 
00449    TraceClientAppPacket                            Status;
00450    card64                                          OldPosition;
00451    card64                                          ChangeTimeStamp;
00452    bool                                            IsPlaying;
00453 };
00454 
00455 
00456 }
00457 
00458 
00459 #include "traceclient.icc"
00460 
00461 
00462 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines