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

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

Issue 1423043005: Remove ACMCodecDB::Codec, and make the rest of ACMCodecDB private (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@rac3
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/rent_a_codec.h ('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) 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2015 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 11 matching lines...) Expand all
22 int channels) { 22 int channels) {
23 return CodecIdFromIndex( 23 return CodecIdFromIndex(
24 ACMCodecDB::CodecId(payload_name, sampling_freq_hz, channels)); 24 ACMCodecDB::CodecId(payload_name, sampling_freq_hz, channels));
25 } 25 }
26 26
27 rtc::Maybe<CodecInst> RentACodec::CodecInstById(CodecId codec_id) { 27 rtc::Maybe<CodecInst> RentACodec::CodecInstById(CodecId codec_id) {
28 rtc::Maybe<int> mi = CodecIndexFromId(codec_id); 28 rtc::Maybe<int> mi = CodecIndexFromId(codec_id);
29 return mi ? rtc::Maybe<CodecInst>(Database()[*mi]) : rtc::Maybe<CodecInst>(); 29 return mi ? rtc::Maybe<CodecInst>(Database()[*mi]) : rtc::Maybe<CodecInst>();
30 } 30 }
31 31
32 rtc::Maybe<RentACodec::CodecId> RentACodec::CodecIdByInst(
33 const CodecInst& codec_inst) {
34 return CodecIdFromIndex(ACMCodecDB::CodecNumber(codec_inst));
35 }
36
32 rtc::Maybe<CodecInst> RentACodec::CodecInstByParams(const char* payload_name, 37 rtc::Maybe<CodecInst> RentACodec::CodecInstByParams(const char* payload_name,
33 int sampling_freq_hz, 38 int sampling_freq_hz,
34 int channels) { 39 int channels) {
35 rtc::Maybe<CodecId> codec_id = 40 rtc::Maybe<CodecId> codec_id =
36 CodecIdByParams(payload_name, sampling_freq_hz, channels); 41 CodecIdByParams(payload_name, sampling_freq_hz, channels);
37 if (!codec_id) 42 if (!codec_id)
38 return rtc::Maybe<CodecInst>(); 43 return rtc::Maybe<CodecInst>();
39 rtc::Maybe<CodecInst> ci = CodecInstById(*codec_id); 44 rtc::Maybe<CodecInst> ci = CodecInstById(*codec_id);
40 RTC_DCHECK(ci); 45 RTC_DCHECK(ci);
41 46
(...skipping 28 matching lines...) Expand all
70 return rtc::Maybe<NetEqDecoder>(); 75 return rtc::Maybe<NetEqDecoder>();
71 const NetEqDecoder ned = ACMCodecDB::neteq_decoders_[*i]; 76 const NetEqDecoder ned = ACMCodecDB::neteq_decoders_[*i];
72 return rtc::Maybe<NetEqDecoder>( 77 return rtc::Maybe<NetEqDecoder>(
73 (ned == NetEqDecoder::kDecoderOpus && num_channels == 2) 78 (ned == NetEqDecoder::kDecoderOpus && num_channels == 2)
74 ? NetEqDecoder::kDecoderOpus_2ch 79 ? NetEqDecoder::kDecoderOpus_2ch
75 : ned); 80 : ned);
76 } 81 }
77 82
78 } // namespace acm2 83 } // namespace acm2
79 } // namespace webrtc 84 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/audio_coding/main/acm2/rent_a_codec.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698