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

Side by Side Diff: webrtc/modules/audio_coding/main/acm2/audio_coding_module_impl.cc

Issue 1425233003: Hide ACMCodecDB::database_ behind accessors (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@rac-static
Patch Set: rebase Created 5 years, 1 month 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
« no previous file with comments | « webrtc/modules/audio_coding/main/acm2/acm_receiver.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 510 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 return 0; 521 return 0;
522 } 522 }
523 523
524 // Get current receive frequency. 524 // Get current receive frequency.
525 int AudioCodingModuleImpl::ReceiveFrequency() const { 525 int AudioCodingModuleImpl::ReceiveFrequency() const {
526 WEBRTC_TRACE(webrtc::kTraceStream, webrtc::kTraceAudioCoding, id_, 526 WEBRTC_TRACE(webrtc::kTraceStream, webrtc::kTraceAudioCoding, id_,
527 "ReceiveFrequency()"); 527 "ReceiveFrequency()");
528 528
529 CriticalSectionScoped lock(acm_crit_sect_.get()); 529 CriticalSectionScoped lock(acm_crit_sect_.get());
530 530
531 int codec_id = receiver_.last_audio_codec_id(); 531 auto codec_id = RentACodec::CodecIdFromIndex(receiver_.last_audio_codec_id());
532 532 return codec_id ? RentACodec::CodecInstById(*codec_id)->plfreq
533 return codec_id < 0 ? receiver_.current_sample_rate_hz() : 533 : receiver_.current_sample_rate_hz();
534 ACMCodecDB::database_[codec_id].plfreq;
535 } 534 }
536 535
537 // Get current playout frequency. 536 // Get current playout frequency.
538 int AudioCodingModuleImpl::PlayoutFrequency() const { 537 int AudioCodingModuleImpl::PlayoutFrequency() const {
539 WEBRTC_TRACE(webrtc::kTraceStream, webrtc::kTraceAudioCoding, id_, 538 WEBRTC_TRACE(webrtc::kTraceStream, webrtc::kTraceAudioCoding, id_,
540 "PlayoutFrequency()"); 539 "PlayoutFrequency()");
541 540
542 CriticalSectionScoped lock(acm_crit_sect_.get()); 541 CriticalSectionScoped lock(acm_crit_sect_.get());
543 542
544 return receiver_.current_sample_rate_hz(); 543 return receiver_.current_sample_rate_hz();
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
782 return receiver_.LeastRequiredDelayMs(); 781 return receiver_.LeastRequiredDelayMs();
783 } 782 }
784 783
785 void AudioCodingModuleImpl::GetDecodingCallStatistics( 784 void AudioCodingModuleImpl::GetDecodingCallStatistics(
786 AudioDecodingCallStats* call_stats) const { 785 AudioDecodingCallStats* call_stats) const {
787 receiver_.GetDecodingCallStatistics(call_stats); 786 receiver_.GetDecodingCallStatistics(call_stats);
788 } 787 }
789 788
790 } // namespace acm2 789 } // namespace acm2
791 } // namespace webrtc 790 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/audio_coding/main/acm2/acm_receiver.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698