| 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 3080 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3091 return audio_coding_->GetNetworkStatistics(&stats); | 3091 return audio_coding_->GetNetworkStatistics(&stats); |
| 3092 } | 3092 } |
| 3093 | 3093 |
| 3094 void Channel::GetDecodingCallStatistics(AudioDecodingCallStats* stats) const { | 3094 void Channel::GetDecodingCallStatistics(AudioDecodingCallStats* stats) const { |
| 3095 audio_coding_->GetDecodingCallStatistics(stats); | 3095 audio_coding_->GetDecodingCallStatistics(stats); |
| 3096 } | 3096 } |
| 3097 | 3097 |
| 3098 bool Channel::GetDelayEstimate(int* jitter_buffer_delay_ms, | 3098 bool Channel::GetDelayEstimate(int* jitter_buffer_delay_ms, |
| 3099 int* playout_buffer_delay_ms) const { | 3099 int* playout_buffer_delay_ms) const { |
| 3100 rtc::CritScope lock(&video_sync_lock_); | 3100 rtc::CritScope lock(&video_sync_lock_); |
| 3101 if (_average_jitter_buffer_delay_us == 0) { | 3101 *jitter_buffer_delay_ms = audio_coding_->FilteredCurrentDelayMs(); |
| 3102 return false; | |
| 3103 } | |
| 3104 *jitter_buffer_delay_ms = | |
| 3105 (_average_jitter_buffer_delay_us + 500) / 1000 + _recPacketDelayMs; | |
| 3106 *playout_buffer_delay_ms = playout_delay_ms_; | 3102 *playout_buffer_delay_ms = playout_delay_ms_; |
| 3107 return true; | 3103 return true; |
| 3108 } | 3104 } |
| 3109 | 3105 |
| 3110 uint32_t Channel::GetDelayEstimate() const { | 3106 uint32_t Channel::GetDelayEstimate() const { |
| 3111 int jitter_buffer_delay_ms = 0; | 3107 int jitter_buffer_delay_ms = 0; |
| 3112 int playout_buffer_delay_ms = 0; | 3108 int playout_buffer_delay_ms = 0; |
| 3113 GetDelayEstimate(&jitter_buffer_delay_ms, &playout_buffer_delay_ms); | 3109 GetDelayEstimate(&jitter_buffer_delay_ms, &playout_buffer_delay_ms); |
| 3114 return jitter_buffer_delay_ms + playout_buffer_delay_ms; | 3110 return jitter_buffer_delay_ms + playout_buffer_delay_ms; |
| 3115 } | 3111 } |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3308 if (rtcp) { | 3304 if (rtcp) { |
| 3309 playout_timestamp_rtcp_ = playout_timestamp; | 3305 playout_timestamp_rtcp_ = playout_timestamp; |
| 3310 } else { | 3306 } else { |
| 3311 playout_timestamp_rtp_ = playout_timestamp; | 3307 playout_timestamp_rtp_ = playout_timestamp; |
| 3312 } | 3308 } |
| 3313 playout_delay_ms_ = delay_ms; | 3309 playout_delay_ms_ = delay_ms; |
| 3314 } | 3310 } |
| 3315 } | 3311 } |
| 3316 | 3312 |
| 3317 // Called for incoming RTP packets after successful RTP header parsing. | 3313 // Called for incoming RTP packets after successful RTP header parsing. |
| 3314 // TODO(henrik.lundin): Clean out this method. With the introduction of |
| 3315 // AudioCoding::FilteredCurrentDelayMs() most (if not all) of this method can |
| 3316 // be deleted, along with a few member variables. (WebRTC issue 6237.) |
| 3318 void Channel::UpdatePacketDelay(uint32_t rtp_timestamp, | 3317 void Channel::UpdatePacketDelay(uint32_t rtp_timestamp, |
| 3319 uint16_t sequence_number) { | 3318 uint16_t sequence_number) { |
| 3320 WEBRTC_TRACE(kTraceStream, kTraceVoice, VoEId(_instanceId, _channelId), | 3319 WEBRTC_TRACE(kTraceStream, kTraceVoice, VoEId(_instanceId, _channelId), |
| 3321 "Channel::UpdatePacketDelay(timestamp=%lu, sequenceNumber=%u)", | 3320 "Channel::UpdatePacketDelay(timestamp=%lu, sequenceNumber=%u)", |
| 3322 rtp_timestamp, sequence_number); | 3321 rtp_timestamp, sequence_number); |
| 3323 | 3322 |
| 3324 // Get frequency of last received payload | 3323 // Get frequency of last received payload |
| 3325 int rtp_receive_frequency = GetPlayoutFrequency(); | 3324 int rtp_receive_frequency = GetPlayoutFrequency(); |
| 3326 | 3325 |
| 3327 // |jitter_buffer_playout_timestamp_| updated in UpdatePlayoutTimestamp for | 3326 // |jitter_buffer_playout_timestamp_| updated in UpdatePlayoutTimestamp for |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3482 int64_t min_rtt = 0; | 3481 int64_t min_rtt = 0; |
| 3483 if (_rtpRtcpModule->RTT(remoteSSRC, &rtt, &avg_rtt, &min_rtt, &max_rtt) != | 3482 if (_rtpRtcpModule->RTT(remoteSSRC, &rtt, &avg_rtt, &min_rtt, &max_rtt) != |
| 3484 0) { | 3483 0) { |
| 3485 return 0; | 3484 return 0; |
| 3486 } | 3485 } |
| 3487 return rtt; | 3486 return rtt; |
| 3488 } | 3487 } |
| 3489 | 3488 |
| 3490 } // namespace voe | 3489 } // namespace voe |
| 3491 } // namespace webrtc | 3490 } // namespace webrtc |
| OLD | NEW |