Changeset 232
- Timestamp:
- 01/01/11 15:55:42 (17 months ago)
- Location:
- trunk/sources
- Files:
-
- 4 edited
-
common/src/utils/logging/fileloglocation.cpp (modified) (1 diff)
-
thelib/include/protocols/rtp/inboundrtpprotocol.h (modified) (1 diff)
-
thelib/src/protocols/rtp/inboundrtpprotocol.cpp (modified) (3 diffs)
-
thelib/src/protocols/rtp/streaming/innetrtpstream.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/common/src/utils/logging/fileloglocation.cpp
r148 r232 46 46 return; 47 47 } 48 string logEntry = format("%d:%s:%d:%s:%s\n", 49 level, STR(fileName), lineNumber, STR(functionName), STR(message)); 48 string logEntry = format("%d:%d:%s:%d:%s:%s\n", 49 time(NULL), level, STR(fileName), lineNumber, STR(functionName), 50 STR(message)); 50 51 _fileStream.write(STR(logEntry), logEntry.size()); 51 if ((_counter++) % 1000 == 0) { 52 _fileStream.flush(); 53 } 52 _fileStream.flush(); 54 53 } 55 54 -
trunk/sources/thelib/include/protocols/rtp/inboundrtpprotocol.h
r231 r232 38 38 uint16_t _seqRollOver; 39 39 uint64_t _lastTimestamp; 40 uint 32_t _timestampRollover;40 uint64_t _timestampRollover; 41 41 bool _isAudio; 42 42 uint32_t _packetsCount; 43 uint32_t _delta;44 43 public: 45 44 InboundRTPProtocol(); -
trunk/sources/thelib/src/protocols/rtp/inboundrtpprotocol.cpp
r231 r232 37 37 _isAudio = false; 38 38 _packetsCount = 0; 39 _delta = 0;40 39 } 41 40 … … 122 121 length -= 12 + GET_RTP_CC(_rtpHeader)*4; 123 122 124 //5. Normalize the timestamp to 0125 if (_delta == 0) {126 _delta = _rtpHeader._timestamp;127 }128 _rtpHeader._timestamp -= _delta;129 130 131 // if (GetId() == 10) {132 // _rtpHeader._timestamp = (uint32_t) _rtpHeader._timestamp + 0xffdd0000;133 // //FINEST("%d: _rtpHeader._timestamp: %08x", GetId(), _rtpHeader._timestamp);134 // }135 // if (GetId() == 12) {136 // _rtpHeader._timestamp = (uint32_t) _rtpHeader._timestamp + 0xfff00000;137 // //FINEST("%d: _rtpHeader._timestamp: %08x", GetId(), _rtpHeader._timestamp);138 // }139 140 123 //6. Detect rollover and adjust the timestamp 141 124 if (_rtpHeader._timestamp < _lastTimestamp) { 125 FINEST("Possible roll over: _rtpHeader._timestamp: %016llx; _lastTimestamp: %016llx", 126 _rtpHeader._timestamp, _lastTimestamp); 142 127 if ((((_rtpHeader._timestamp & 0x80000000) >> 31) == 0) 143 128 && (((_lastTimestamp & 0x80000000) >> 31) == 1)) { 144 129 _timestampRollover++; 145 130 _lastTimestamp = _rtpHeader._timestamp; 146 WARN("Roll over on %d ", GetId());131 WARN("Roll over on %d; _timestampRollover: %d", GetId(), _timestampRollover); 147 132 } else { 148 133 WARN("Bogus timestamp. current ts: %016llx; last ts: %016llx", … … 154 139 _lastTimestamp = _rtpHeader._timestamp; 155 140 } 156 _rtpHeader._timestamp = _timestampRollover * 0xffffffff + _rtpHeader._timestamp; 141 // string msg = ""; 142 // if ((_lastSeq % 1000) == 0) { 143 // msg = format("%d: %016llx", GetId(), _rtpHeader._timestamp); 144 // } 145 _rtpHeader._timestamp = (_timestampRollover << 32) | _rtpHeader._timestamp; 146 // if ((_lastSeq % 1000) == 0) { 147 // msg += format("(%016llx)", _rtpHeader._timestamp); 148 // FINEST(STR(msg)); 149 // } 157 150 158 151 //5. Feed the data to the stream -
trunk/sources/thelib/src/protocols/rtp/streaming/innetrtpstream.cpp
r187 r232 152 152 double &lastTs = isAudio ? _lastAudioTs : _lastVideoTs; 153 153 154 if ((uint64_t) (lastTs * 100.00) == (uint64_t) (absoluteTimestamp * 100.00)) { 154 if ((-1.0 < (lastTs * 100.00 - absoluteTimestamp * 100.00)) 155 && ((lastTs * 100.00 - absoluteTimestamp * 100.00) < 1.00)) { 155 156 absoluteTimestamp = lastTs; 156 157 } 157 158 158 if ( (uint64_t) (lastTs * 100.00) > (uint64_t) (absoluteTimestamp * 100.00)) {159 WARN("Back time on %s. ATS: %.08f LTS: %.08f; D: %.8f ",159 if (lastTs * 100.00 > absoluteTimestamp * 100.00) { 160 WARN("Back time on %s. ATS: %.08f LTS: %.08f; D: %.8f; isAudio: %d", 160 161 STR(GetName()), 161 162 absoluteTimestamp, 162 163 lastTs, 163 absoluteTimestamp - lastTs); 164 absoluteTimestamp - lastTs, 165 isAudio); 164 166 return true; 165 167 } … … 214 216 215 217 //2. get the nalu 216 double ts = (double) rtpHeader._timestamp / _capabilities.avc._rate * 1000.0;218 double ts = (double) rtpHeader._timestamp / (double) _capabilities.avc._rate * 1000.0; 217 219 uint8_t naluType = NALU_TYPE(pData[0]); 218 220 if (naluType <= 23) {
Note: See TracChangeset
for help on using the changeset viewer.
