OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 | 67 |
68 CriticalSectionScoped cs(stats_lock_.get()); | 68 CriticalSectionScoped cs(stats_lock_.get()); |
69 stats_.rtcp = statistics; | 69 stats_.rtcp = statistics; |
70 if (statistics.jitter > stats_.max_jitter) { | 70 if (statistics.jitter > stats_.max_jitter) { |
71 stats_.max_jitter = statistics.jitter; | 71 stats_.max_jitter = statistics.jitter; |
72 } | 72 } |
73 } | 73 } |
74 | 74 |
75 void CNameChanged(const char* cname, uint32_t ssrc) override {} | 75 void CNameChanged(const char* cname, uint32_t ssrc) override {} |
76 | 76 |
77 void ResetStatistics() { | |
78 CriticalSectionScoped cs(stats_lock_.get()); | |
79 stats_ = ChannelStatistics(); | |
80 } | |
81 | |
82 ChannelStatistics GetStats() { | 77 ChannelStatistics GetStats() { |
83 CriticalSectionScoped cs(stats_lock_.get()); | 78 CriticalSectionScoped cs(stats_lock_.get()); |
84 return stats_; | 79 return stats_; |
85 } | 80 } |
86 | 81 |
87 private: | 82 private: |
88 // StatisticsUpdated calls are triggered from threads in the RTP module, | 83 // StatisticsUpdated calls are triggered from threads in the RTP module, |
89 // while GetStats calls can be triggered from the public voice engine API, | 84 // while GetStats calls can be triggered from the public voice engine API, |
90 // hence synchronization is needed. | 85 // hence synchronization is needed. |
91 rtc::scoped_ptr<CriticalSectionWrapper> stats_lock_; | 86 rtc::scoped_ptr<CriticalSectionWrapper> stats_lock_; |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 | 328 |
334 void Channel::OnIncomingCSRCChanged(int32_t id, | 329 void Channel::OnIncomingCSRCChanged(int32_t id, |
335 uint32_t CSRC, | 330 uint32_t CSRC, |
336 bool added) | 331 bool added) |
337 { | 332 { |
338 WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId,_channelId), | 333 WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId,_channelId), |
339 "Channel::OnIncomingCSRCChanged(id=%d, CSRC=%d, added=%d)", | 334 "Channel::OnIncomingCSRCChanged(id=%d, CSRC=%d, added=%d)", |
340 id, CSRC, added); | 335 id, CSRC, added); |
341 } | 336 } |
342 | 337 |
343 void Channel::ResetStatistics(uint32_t ssrc) { | |
344 StreamStatistician* statistician = | |
345 rtp_receive_statistics_->GetStatistician(ssrc); | |
346 if (statistician) { | |
347 statistician->ResetStatistics(); | |
348 } | |
349 statistics_proxy_->ResetStatistics(); | |
350 } | |
351 | |
352 int32_t | 338 int32_t |
353 Channel::OnInitializeDecoder( | 339 Channel::OnInitializeDecoder( |
354 int32_t id, | 340 int32_t id, |
355 int8_t payloadType, | 341 int8_t payloadType, |
356 const char payloadName[RTP_PAYLOAD_NAME_SIZE], | 342 const char payloadName[RTP_PAYLOAD_NAME_SIZE], |
357 int frequency, | 343 int frequency, |
358 uint8_t channels, | 344 uint8_t channels, |
359 uint32_t rate) | 345 uint32_t rate) |
360 { | 346 { |
361 WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId,_channelId), | 347 WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId,_channelId), |
(...skipping 837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1199 // Store the sequence number to be able to pick up the same sequence for | 1185 // Store the sequence number to be able to pick up the same sequence for |
1200 // the next StartSend(). This is needed for restarting device, otherwise | 1186 // the next StartSend(). This is needed for restarting device, otherwise |
1201 // it might cause libSRTP to complain about packets being replayed. | 1187 // it might cause libSRTP to complain about packets being replayed. |
1202 // TODO(xians): Remove this workaround after RtpRtcpModule's refactoring | 1188 // TODO(xians): Remove this workaround after RtpRtcpModule's refactoring |
1203 // CL is landed. See issue | 1189 // CL is landed. See issue |
1204 // https://code.google.com/p/webrtc/issues/detail?id=2111 . | 1190 // https://code.google.com/p/webrtc/issues/detail?id=2111 . |
1205 send_sequence_number_ = _rtpRtcpModule->SequenceNumber(); | 1191 send_sequence_number_ = _rtpRtcpModule->SequenceNumber(); |
1206 | 1192 |
1207 // Reset sending SSRC and sequence number and triggers direct transmission | 1193 // Reset sending SSRC and sequence number and triggers direct transmission |
1208 // of RTCP BYE | 1194 // of RTCP BYE |
1209 if (_rtpRtcpModule->SetSendingStatus(false) == -1 || | 1195 if (_rtpRtcpModule->SetSendingStatus(false) == -1) |
1210 _rtpRtcpModule->ResetSendDataCountersRTP() == -1) | |
1211 { | 1196 { |
1212 _engineStatisticsPtr->SetLastError( | 1197 _engineStatisticsPtr->SetLastError( |
1213 VE_RTP_RTCP_MODULE_ERROR, kTraceWarning, | 1198 VE_RTP_RTCP_MODULE_ERROR, kTraceWarning, |
1214 "StartSend() RTP/RTCP failed to stop sending"); | 1199 "StartSend() RTP/RTCP failed to stop sending"); |
1215 } | 1200 } |
1216 | 1201 |
1217 return 0; | 1202 return 0; |
1218 } | 1203 } |
1219 | 1204 |
1220 int32_t | 1205 int32_t |
(...skipping 2925 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4146 int64_t min_rtt = 0; | 4131 int64_t min_rtt = 0; |
4147 if (_rtpRtcpModule->RTT(remoteSSRC, &rtt, &avg_rtt, &min_rtt, &max_rtt) | 4132 if (_rtpRtcpModule->RTT(remoteSSRC, &rtt, &avg_rtt, &min_rtt, &max_rtt) |
4148 != 0) { | 4133 != 0) { |
4149 return 0; | 4134 return 0; |
4150 } | 4135 } |
4151 return rtt; | 4136 return rtt; |
4152 } | 4137 } |
4153 | 4138 |
4154 } // namespace voe | 4139 } // namespace voe |
4155 } // namespace webrtc | 4140 } // namespace webrtc |
OLD | NEW |