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

Side by Side Diff: webrtc/modules/audio_coding/acm2/audio_coding_module_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 884 matching lines...) Expand 10 before | Expand all | Expand 10 after
895 } 895 }
896 896
897 int AudioCodingModuleImpl::DisableOpusDtx() { 897 int AudioCodingModuleImpl::DisableOpusDtx() {
898 rtc::CritScope lock(&acm_crit_sect_); 898 rtc::CritScope lock(&acm_crit_sect_);
899 if (!HaveValidEncoder("DisableOpusDtx")) { 899 if (!HaveValidEncoder("DisableOpusDtx")) {
900 return -1; 900 return -1;
901 } 901 }
902 return encoder_stack_->SetDtx(false) ? 0 : -1; 902 return encoder_stack_->SetDtx(false) ? 0 : -1;
903 } 903 }
904 904
905 int AudioCodingModuleImpl::PlayoutTimestamp(uint32_t* timestamp) { 905 int32_t AudioCodingModuleImpl::PlayoutTimestamp(uint32_t* timestamp) {
906 return receiver_.GetPlayoutTimestamp(timestamp) ? 0 : -1; 906 rtc::Optional<uint32_t> ts = PlayoutTimestamp();
907 if (!ts)
908 return -1;
909 *timestamp = *ts;
910 return 0;
911 }
912
913 rtc::Optional<uint32_t> AudioCodingModuleImpl::PlayoutTimestamp() {
914 return receiver_.GetPlayoutTimestamp();
907 } 915 }
908 916
909 bool AudioCodingModuleImpl::HaveValidEncoder(const char* caller_name) const { 917 bool AudioCodingModuleImpl::HaveValidEncoder(const char* caller_name) const {
910 if (!encoder_stack_) { 918 if (!encoder_stack_) {
911 WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceAudioCoding, id_, 919 WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceAudioCoding, id_,
912 "%s failed: No send codec is registered.", caller_name); 920 "%s failed: No send codec is registered.", caller_name);
913 return false; 921 return false;
914 } 922 }
915 return true; 923 return true;
916 } 924 }
(...skipping 19 matching lines...) Expand all
936 return receiver_.LeastRequiredDelayMs(); 944 return receiver_.LeastRequiredDelayMs();
937 } 945 }
938 946
939 void AudioCodingModuleImpl::GetDecodingCallStatistics( 947 void AudioCodingModuleImpl::GetDecodingCallStatistics(
940 AudioDecodingCallStats* call_stats) const { 948 AudioDecodingCallStats* call_stats) const {
941 receiver_.GetDecodingCallStatistics(call_stats); 949 receiver_.GetDecodingCallStatistics(call_stats);
942 } 950 }
943 951
944 } // namespace acm2 952 } // namespace acm2
945 } // namespace webrtc 953 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698