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 3155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3166 return audio_coding_->GetNetworkStatistics(&stats); | 3166 return audio_coding_->GetNetworkStatistics(&stats); |
3167 } | 3167 } |
3168 | 3168 |
3169 void Channel::GetDecodingCallStatistics(AudioDecodingCallStats* stats) const { | 3169 void Channel::GetDecodingCallStatistics(AudioDecodingCallStats* stats) const { |
3170 audio_coding_->GetDecodingCallStatistics(stats); | 3170 audio_coding_->GetDecodingCallStatistics(stats); |
3171 } | 3171 } |
3172 | 3172 |
3173 bool Channel::GetDelayEstimate(int* jitter_buffer_delay_ms, | 3173 bool Channel::GetDelayEstimate(int* jitter_buffer_delay_ms, |
3174 int* playout_buffer_delay_ms) const { | 3174 int* playout_buffer_delay_ms) const { |
3175 rtc::CritScope lock(&video_sync_lock_); | 3175 rtc::CritScope lock(&video_sync_lock_); |
3176 if (_average_jitter_buffer_delay_us == 0) { | 3176 *jitter_buffer_delay_ms = audio_coding_->FilteredCurrentDelayMs(); |
3177 return false; | |
3178 } | |
3179 *jitter_buffer_delay_ms = | |
3180 (_average_jitter_buffer_delay_us + 500) / 1000 + _recPacketDelayMs; | |
3181 *playout_buffer_delay_ms = playout_delay_ms_; | 3177 *playout_buffer_delay_ms = playout_delay_ms_; |
3182 return true; | 3178 return true; |
3183 } | 3179 } |
3184 | 3180 |
3185 uint32_t Channel::GetDelayEstimate() const { | 3181 uint32_t Channel::GetDelayEstimate() const { |
3186 int jitter_buffer_delay_ms = 0; | 3182 int jitter_buffer_delay_ms = 0; |
3187 int playout_buffer_delay_ms = 0; | 3183 int playout_buffer_delay_ms = 0; |
3188 GetDelayEstimate(&jitter_buffer_delay_ms, &playout_buffer_delay_ms); | 3184 GetDelayEstimate(&jitter_buffer_delay_ms, &playout_buffer_delay_ms); |
3189 return jitter_buffer_delay_ms + playout_buffer_delay_ms; | 3185 return jitter_buffer_delay_ms + playout_buffer_delay_ms; |
3190 } | 3186 } |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3383 if (rtcp) { | 3379 if (rtcp) { |
3384 playout_timestamp_rtcp_ = playout_timestamp; | 3380 playout_timestamp_rtcp_ = playout_timestamp; |
3385 } else { | 3381 } else { |
3386 playout_timestamp_rtp_ = playout_timestamp; | 3382 playout_timestamp_rtp_ = playout_timestamp; |
3387 } | 3383 } |
3388 playout_delay_ms_ = delay_ms; | 3384 playout_delay_ms_ = delay_ms; |
3389 } | 3385 } |
3390 } | 3386 } |
3391 | 3387 |
3392 // Called for incoming RTP packets after successful RTP header parsing. | 3388 // Called for incoming RTP packets after successful RTP header parsing. |
3389 // TODO(henrik.lundin): Clean out this method. With the introduction of | |
3390 // AudioCoding::FilteredCurrentDelayMs() most (if not all) of this method can | |
3391 // be deleted, along with a few member variables. (WebRTC issue 6237.) | |
the sun
2016/08/23 06:45:07
Oh, that would be so nice!
| |
3393 void Channel::UpdatePacketDelay(uint32_t rtp_timestamp, | 3392 void Channel::UpdatePacketDelay(uint32_t rtp_timestamp, |
3394 uint16_t sequence_number) { | 3393 uint16_t sequence_number) { |
3395 WEBRTC_TRACE(kTraceStream, kTraceVoice, VoEId(_instanceId, _channelId), | 3394 WEBRTC_TRACE(kTraceStream, kTraceVoice, VoEId(_instanceId, _channelId), |
3396 "Channel::UpdatePacketDelay(timestamp=%lu, sequenceNumber=%u)", | 3395 "Channel::UpdatePacketDelay(timestamp=%lu, sequenceNumber=%u)", |
3397 rtp_timestamp, sequence_number); | 3396 rtp_timestamp, sequence_number); |
3398 | 3397 |
3399 // Get frequency of last received payload | 3398 // Get frequency of last received payload |
3400 int rtp_receive_frequency = GetPlayoutFrequency(); | 3399 int rtp_receive_frequency = GetPlayoutFrequency(); |
3401 | 3400 |
3402 // |jitter_buffer_playout_timestamp_| updated in UpdatePlayoutTimestamp for | 3401 // |jitter_buffer_playout_timestamp_| updated in UpdatePlayoutTimestamp for |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3557 int64_t min_rtt = 0; | 3556 int64_t min_rtt = 0; |
3558 if (_rtpRtcpModule->RTT(remoteSSRC, &rtt, &avg_rtt, &min_rtt, &max_rtt) != | 3557 if (_rtpRtcpModule->RTT(remoteSSRC, &rtt, &avg_rtt, &min_rtt, &max_rtt) != |
3559 0) { | 3558 0) { |
3560 return 0; | 3559 return 0; |
3561 } | 3560 } |
3562 return rtt; | 3561 return rtt; |
3563 } | 3562 } |
3564 | 3563 |
3565 } // namespace voe | 3564 } // namespace voe |
3566 } // namespace webrtc | 3565 } // namespace webrtc |
OLD | NEW |