OLD | NEW |
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 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 | 333 |
334 // We didn't find a matching codec. | 334 // We didn't find a matching codec. |
335 return -1; | 335 return -1; |
336 } | 336 } |
337 // Gets codec id number from database for the receiver. | 337 // Gets codec id number from database for the receiver. |
338 int ACMCodecDB::ReceiverCodecNumber(const CodecInst& codec_inst) { | 338 int ACMCodecDB::ReceiverCodecNumber(const CodecInst& codec_inst) { |
339 // Look for a matching codec in the database. | 339 // Look for a matching codec in the database. |
340 return CodecId(codec_inst); | 340 return CodecId(codec_inst); |
341 } | 341 } |
342 | 342 |
343 // Returns the codec sampling frequency for codec with id = "codec_id" in | |
344 // database. | |
345 int ACMCodecDB::CodecFreq(int codec_id) { | |
346 const size_t i = static_cast<size_t>(codec_id); | |
347 const auto db = RentACodec::Database(); | |
348 return i < db.size() ? db[i].plfreq : -1; | |
349 } | |
350 | |
351 } // namespace acm2 | 343 } // namespace acm2 |
352 | 344 |
353 } // namespace webrtc | 345 } // namespace webrtc |
OLD | NEW |