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

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

Issue 1853183002: Change NetEq::GetPlayoutTimestamp to return an rtc::Optional<uint32_t> (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Adding back the old PlayoutTimestamp method, now DEPRECATED 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 383 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 assert(vad_.get()); 394 assert(vad_.get());
395 vad_->Enable(); 395 vad_->Enable();
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 bool NetEqImpl::GetPlayoutTimestamp(uint32_t* timestamp) { 404 rtc::Optional<uint32_t> NetEqImpl::GetPlayoutTimestamp() {
405 rtc::CritScope lock(&crit_sect_); 405 rtc::CritScope lock(&crit_sect_);
406 if (first_packet_) { 406 if (first_packet_) {
407 // We don't have a valid RTP timestamp until we have decoded our first 407 // We don't have a valid RTP timestamp until we have decoded our first
408 // RTP packet. 408 // RTP packet.
409 return false; 409 return rtc::Optional<uint32_t>();
410 } 410 }
411 *timestamp = timestamp_scaler_->ToExternal(playout_timestamp_); 411 return rtc::Optional<uint32_t>(
412 return true; 412 timestamp_scaler_->ToExternal(playout_timestamp_));
413 } 413 }
414 414
415 int NetEqImpl::last_output_sample_rate_hz() const { 415 int NetEqImpl::last_output_sample_rate_hz() const {
416 rtc::CritScope lock(&crit_sect_); 416 rtc::CritScope lock(&crit_sect_);
417 return last_output_sample_rate_hz_; 417 return last_output_sample_rate_hz_;
418 } 418 }
419 419
420 int NetEqImpl::SetTargetNumberOfChannels() { 420 int NetEqImpl::SetTargetNumberOfChannels() {
421 return kNotImplemented; 421 return kNotImplemented;
422 } 422 }
(...skipping 1661 matching lines...) Expand 10 before | Expand all | Expand 10 after
2084 2084
2085 void NetEqImpl::CreateDecisionLogic() { 2085 void NetEqImpl::CreateDecisionLogic() {
2086 decision_logic_.reset(DecisionLogic::Create(fs_hz_, output_size_samples_, 2086 decision_logic_.reset(DecisionLogic::Create(fs_hz_, output_size_samples_,
2087 playout_mode_, 2087 playout_mode_,
2088 decoder_database_.get(), 2088 decoder_database_.get(),
2089 *packet_buffer_.get(), 2089 *packet_buffer_.get(),
2090 delay_manager_.get(), 2090 delay_manager_.get(),
2091 buffer_level_filter_.get())); 2091 buffer_level_filter_.get()));
2092 } 2092 }
2093 } // namespace webrtc 2093 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698