Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(99)

Side by Side Diff: webrtc/modules/audio_coding/neteq/neteq_impl.cc

Issue 1861303002: NetEq::GetPlayoutTimestamp returns empty during CNG (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@neteq-set-audio-frame-ts
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 } 396 }
397 397
398 void NetEqImpl::DisableVad() { 398 void NetEqImpl::DisableVad() {
399 rtc::CritScope lock(&crit_sect_); 399 rtc::CritScope lock(&crit_sect_);
400 assert(vad_.get()); 400 assert(vad_.get());
401 vad_->Disable(); 401 vad_->Disable();
402 } 402 }
403 403
404 rtc::Optional<uint32_t> NetEqImpl::GetPlayoutTimestamp() const { 404 rtc::Optional<uint32_t> NetEqImpl::GetPlayoutTimestamp() const {
405 rtc::CritScope lock(&crit_sect_); 405 rtc::CritScope lock(&crit_sect_);
406 if (first_packet_) { 406 if (first_packet_ || last_mode_ == kModeRfc3389Cng ||
407 last_mode_ == kModeCodecInternalCng) {
407 // We don't have a valid RTP timestamp until we have decoded our first 408 // We don't have a valid RTP timestamp until we have decoded our first
408 // RTP packet. 409 // RTP packet. Also, the RTP timestamp is not accurate while playing CNG,
410 // which is indicated by returning an empty value.
409 return rtc::Optional<uint32_t>(); 411 return rtc::Optional<uint32_t>();
410 } 412 }
411 return rtc::Optional<uint32_t>( 413 return rtc::Optional<uint32_t>(
412 timestamp_scaler_->ToExternal(playout_timestamp_)); 414 timestamp_scaler_->ToExternal(playout_timestamp_));
413 } 415 }
414 416
415 int NetEqImpl::last_output_sample_rate_hz() const { 417 int NetEqImpl::last_output_sample_rate_hz() const {
416 rtc::CritScope lock(&crit_sect_); 418 rtc::CritScope lock(&crit_sect_);
417 return last_output_sample_rate_hz_; 419 return last_output_sample_rate_hz_;
418 } 420 }
(...skipping 1674 matching lines...) Expand 10 before | Expand all | Expand 10 after
2093 2095
2094 void NetEqImpl::CreateDecisionLogic() { 2096 void NetEqImpl::CreateDecisionLogic() {
2095 decision_logic_.reset(DecisionLogic::Create(fs_hz_, output_size_samples_, 2097 decision_logic_.reset(DecisionLogic::Create(fs_hz_, output_size_samples_,
2096 playout_mode_, 2098 playout_mode_,
2097 decoder_database_.get(), 2099 decoder_database_.get(),
2098 *packet_buffer_.get(), 2100 *packet_buffer_.get(),
2099 delay_manager_.get(), 2101 delay_manager_.get(),
2100 buffer_level_filter_.get())); 2102 buffer_level_filter_.get()));
2101 } 2103 }
2102 } // namespace webrtc 2104 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698