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 30 matching lines...) Expand all Loading... |
41 // packet_sizes_samples - list of the allowed packet sizes. | 41 // packet_sizes_samples - list of the allowed packet sizes. |
42 // basic_block_samples - assigned a value different from 0 if the codec | 42 // basic_block_samples - assigned a value different from 0 if the codec |
43 // requires to be fed with a specific number of samples | 43 // requires to be fed with a specific number of samples |
44 // that can be different from packet size. | 44 // that can be different from packet size. |
45 // channel_support - number of channels supported to encode; | 45 // channel_support - number of channels supported to encode; |
46 // 1 = mono, 2 = stereo, etc. | 46 // 1 = mono, 2 = stereo, etc. |
47 struct CodecSettings { | 47 struct CodecSettings { |
48 int num_packet_sizes; | 48 int num_packet_sizes; |
49 int packet_sizes_samples[kMaxNumPacketSize]; | 49 int packet_sizes_samples[kMaxNumPacketSize]; |
50 int basic_block_samples; | 50 int basic_block_samples; |
51 int channel_support; | 51 size_t channel_support; |
52 }; | 52 }; |
53 | 53 |
54 // Returns codec id from database, given the information received in the input | 54 // Returns codec id from database, given the information received in the input |
55 // [codec_inst]. | 55 // [codec_inst]. |
56 // Input: | 56 // Input: |
57 // [codec_inst] - Information about the codec for which we require the | 57 // [codec_inst] - Information about the codec for which we require the |
58 // database id. | 58 // database id. |
59 // Return: | 59 // Return: |
60 // codec id if successful, otherwise < 0. | 60 // codec id if successful, otherwise < 0. |
61 static int CodecNumber(const CodecInst& codec_inst); | 61 static int CodecNumber(const CodecInst& codec_inst); |
62 static int CodecId(const CodecInst& codec_inst); | 62 static int CodecId(const CodecInst& codec_inst); |
63 static int CodecId(const char* payload_name, int frequency, int channels); | 63 static int CodecId(const char* payload_name, int frequency, size_t channels); |
64 static int ReceiverCodecNumber(const CodecInst& codec_inst); | 64 static int ReceiverCodecNumber(const CodecInst& codec_inst); |
65 | 65 |
66 // Databases with information about the supported codecs | 66 // Databases with information about the supported codecs |
67 // database_ - stored information about all codecs: payload type, name, | 67 // database_ - stored information about all codecs: payload type, name, |
68 // sampling frequency, packet size in samples, default channel | 68 // sampling frequency, packet size in samples, default channel |
69 // support, and default rate. | 69 // support, and default rate. |
70 // codec_settings_ - stored codec settings: number of allowed packet sizes, | 70 // codec_settings_ - stored codec settings: number of allowed packet sizes, |
71 // a vector with the allowed packet sizes, basic block | 71 // a vector with the allowed packet sizes, basic block |
72 // samples, and max number of channels that are supported. | 72 // samples, and max number of channels that are supported. |
73 // neteq_decoders_ - list of supported decoders in NetEQ. | 73 // neteq_decoders_ - list of supported decoders in NetEQ. |
74 static const CodecInst database_[kMaxNumCodecs]; | 74 static const CodecInst database_[kMaxNumCodecs]; |
75 static const CodecSettings codec_settings_[kMaxNumCodecs]; | 75 static const CodecSettings codec_settings_[kMaxNumCodecs]; |
76 static const NetEqDecoder neteq_decoders_[kMaxNumCodecs]; | 76 static const NetEqDecoder neteq_decoders_[kMaxNumCodecs]; |
77 }; | 77 }; |
78 | 78 |
79 } // namespace acm2 | 79 } // namespace acm2 |
80 | 80 |
81 } // namespace webrtc | 81 } // namespace webrtc |
82 | 82 |
83 #endif // WEBRTC_MODULES_AUDIO_CODING_ACM2_ACM_CODEC_DATABASE_H_ | 83 #endif // WEBRTC_MODULES_AUDIO_CODING_ACM2_ACM_CODEC_DATABASE_H_ |
OLD | NEW |