00001 /*************************************************************************** 00002 reports.cc - description 00003 ------------------- 00004 begin : Mon Nov 26 2001 00005 copyright : (C) 2001 by Matthias Oppitz 00006 email : Matthias.Oppitz@gmx.de 00007 ***************************************************************************/ 00008 00009 /*************************************************************************** 00010 * * 00011 * This program is free software; you can redistribute it and/or modify * 00012 * it under the terms of the GNU General Public License as published by * 00013 * the Free Software Foundation; either version 2 of the License, or * 00014 * (at your option) any later version. * 00015 * * 00016 ***************************************************************************/ 00017 00023 #include "reports.h" 00024 00025 00026 // 00027 // SenderReport 00028 // 00029 00030 Register_Class(SenderReport); 00031 00032 00033 SenderReport::SenderReport() : cObject() 00034 { 00035 _ntpTimeStamp = 0; 00036 _rtpTimeStamp = 0; 00037 _packetCount = 0; 00038 _byteCount = 0; 00039 } 00040 00041 00042 SenderReport::SenderReport(const SenderReport& senderReport) : cObject() 00043 { 00044 operator=(senderReport); 00045 } 00046 00047 00048 SenderReport::~SenderReport() 00049 { 00050 } 00051 00052 00053 SenderReport& SenderReport::operator=(const SenderReport& senderReport) 00054 { 00055 cObject::operator=(senderReport); 00056 _ntpTimeStamp = senderReport._ntpTimeStamp; 00057 _rtpTimeStamp = senderReport._rtpTimeStamp; 00058 _packetCount = senderReport._packetCount; 00059 _byteCount = senderReport._byteCount; 00060 return *this; 00061 } 00062 00063 00064 SenderReport *SenderReport::dup() const 00065 { 00066 return new SenderReport(*this); 00067 } 00068 00069 00070 std::string SenderReport::info() 00071 { 00072 std::stringstream out; 00073 out << "SenderReport.timeStamp=" << _rtpTimeStamp; 00074 return out.str(); 00075 } 00076 00077 00078 void SenderReport::dump(std::ostream& os) const 00079 { 00080 os << "SenderReport:" << endl; 00081 os << " ntpTimeStamp = " << _ntpTimeStamp << endl; 00082 os << " rtpTimeStamp = " << _rtpTimeStamp << endl; 00083 os << " packetCount = " << _packetCount << endl; 00084 os << " byteCount = " << _byteCount << endl; 00085 } 00086 00087 00088 uint64 SenderReport::getNTPTimeStamp() 00089 { 00090 return _ntpTimeStamp; 00091 } 00092 00093 00094 void SenderReport::setNTPTimeStamp(uint64 ntpTimeStamp) 00095 { 00096 _ntpTimeStamp = ntpTimeStamp; 00097 } 00098 00099 00100 uint32 SenderReport::getRTPTimeStamp() 00101 { 00102 return _rtpTimeStamp; 00103 } 00104 00105 00106 void SenderReport::setRTPTimeStamp(uint32 rtpTimeStamp) 00107 { 00108 _rtpTimeStamp = rtpTimeStamp; 00109 } 00110 00111 00112 uint32 SenderReport::getPacketCount() 00113 { 00114 return _packetCount; 00115 } 00116 00117 00118 void SenderReport::setPacketCount(uint32 packetCount) 00119 { 00120 _packetCount = packetCount; 00121 } 00122 00123 00124 uint32 SenderReport::getByteCount() 00125 { 00126 return _byteCount; 00127 } 00128 00129 00130 void SenderReport::setByteCount(uint32 byteCount) 00131 { 00132 _byteCount = byteCount; 00133 } 00134 00135 // 00136 // ReceptionReport 00137 // 00138 00139 Register_Class(ReceptionReport); 00140 00141 00142 ReceptionReport::ReceptionReport() : cObject() 00143 { 00144 _ssrc = 0; 00145 _fractionLost = 0; 00146 _packetsLostCumulative = 0; 00147 _extendedHighestSequenceNumber = 0; 00148 _jitter = 0; 00149 _lastSR = 0; 00150 _delaySinceLastSR = 0; 00151 } 00152 00153 00154 ReceptionReport::ReceptionReport(const ReceptionReport& receptionReport) : cObject() 00155 { 00156 operator=(receptionReport); 00157 } 00158 00159 00160 ReceptionReport::~ReceptionReport() 00161 { 00162 } 00163 00164 00165 ReceptionReport& ReceptionReport::operator=(const ReceptionReport& receptionReport) 00166 { 00167 cObject::operator=(receptionReport); 00168 _ssrc = receptionReport._ssrc; 00169 _fractionLost = receptionReport._fractionLost; 00170 _packetsLostCumulative = receptionReport._packetsLostCumulative; 00171 _extendedHighestSequenceNumber = receptionReport._extendedHighestSequenceNumber; 00172 _jitter = receptionReport._jitter; 00173 _lastSR = receptionReport._lastSR; 00174 _delaySinceLastSR = receptionReport._delaySinceLastSR; 00175 return *this; 00176 } 00177 00178 00179 ReceptionReport *ReceptionReport::dup() const 00180 { 00181 return new ReceptionReport(*this); 00182 } 00183 00184 00185 std::string ReceptionReport::info() 00186 { 00187 std::stringstream out; 00188 out << "ReceptionReport.ssrc=" << _ssrc; 00189 return out.str(); 00190 } 00191 00192 00193 void ReceptionReport::dump(std::ostream& os) const 00194 { 00195 os << "ReceptionReport:" << endl; 00196 os << " ssrc = " << _ssrc << endl; 00197 os << " fractionLost = " << (int)_fractionLost << endl; 00198 os << " packetsLostCumulative = " << _packetsLostCumulative << endl; 00199 os << " extendedHighestSequenceNumber = " << _extendedHighestSequenceNumber << endl; 00200 os << " jitter = " << _jitter << endl; 00201 os << " lastSR = " << _lastSR << endl; 00202 os << " delaySinceLastSR = " << _delaySinceLastSR << endl; 00203 } 00204 00205 00206 uint32 ReceptionReport::getSSRC() 00207 { 00208 return _ssrc; 00209 } 00210 00211 00212 void ReceptionReport::setSSRC(uint32 ssrc) 00213 { 00214 _ssrc = ssrc; 00215 } 00216 00217 00218 uint8 ReceptionReport::getFractionLost() 00219 { 00220 return _fractionLost; 00221 } 00222 00223 00224 void ReceptionReport::setFractionLost(uint8 fractionLost) 00225 { 00226 _fractionLost = fractionLost; 00227 } 00228 00229 00230 int ReceptionReport::getPacketsLostCumulative() 00231 { 00232 return _packetsLostCumulative; 00233 } 00234 00235 00236 void ReceptionReport::setPacketsLostCumulative(int packetsLostCumulative) 00237 { 00238 _packetsLostCumulative = packetsLostCumulative; 00239 } 00240 00241 00242 uint32 ReceptionReport::getSequenceNumber() 00243 { 00244 return _extendedHighestSequenceNumber; 00245 } 00246 00247 00248 void ReceptionReport::setSequenceNumber(uint32 sequenceNumber) 00249 { 00250 _extendedHighestSequenceNumber = sequenceNumber; 00251 } 00252 00253 00254 int ReceptionReport::getJitter() 00255 { 00256 return _jitter; 00257 } 00258 00259 00260 void ReceptionReport::setJitter(int jitter) 00261 { 00262 _jitter = jitter; 00263 } 00264 00265 00266 int ReceptionReport::getLastSR() 00267 { 00268 return _lastSR; 00269 } 00270 00271 00272 void ReceptionReport::setLastSR(int lastSR) 00273 { 00274 _lastSR = lastSR; 00275 } 00276 00277 00278 int ReceptionReport::getDelaySinceLastSR() 00279 { 00280 return _delaySinceLastSR; 00281 } 00282 00283 00284 void ReceptionReport::setDelaySinceLastSR(int delaySinceLastSR) 00285 { 00286 _delaySinceLastSR = delaySinceLastSR; 00287 }