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 |
11 /* | 11 /* |
12 * This file generates databases with information about all supported audio | 12 * This file generates databases with information about all supported audio |
13 * codecs. | 13 * codecs. |
14 */ | 14 */ |
15 | 15 |
16 #ifndef WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_ACM_CODEC_DATABASE_H_ | 16 #ifndef WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_ACM_CODEC_DATABASE_H_ |
17 #define WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_ACM_CODEC_DATABASE_H_ | 17 #define WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_ACM_CODEC_DATABASE_H_ |
18 | 18 |
19 #include "webrtc/common_types.h" | 19 #include "webrtc/common_types.h" |
20 #include "webrtc/engine_configurations.h" | 20 #include "webrtc/engine_configurations.h" |
| 21 #include "webrtc/modules/audio_coding/main/acm2/rent_a_codec.h" |
21 #include "webrtc/modules/audio_coding/neteq/interface/neteq.h" | 22 #include "webrtc/modules/audio_coding/neteq/interface/neteq.h" |
22 | 23 |
23 namespace webrtc { | 24 namespace webrtc { |
24 | 25 |
25 namespace acm2 { | 26 namespace acm2 { |
26 | 27 |
27 // TODO(tlegrand): replace class ACMCodecDB with a namespace. | 28 // TODO(tlegrand): replace class ACMCodecDB with a namespace. |
28 class ACMCodecDB { | 29 class ACMCodecDB { |
29 public: | 30 public: |
30 // Enum with array indexes for the supported codecs. NOTE! The order MUST | |
31 // be the same as when creating the database in acm_codec_database.cc. | |
32 enum { | |
33 kNone = -1 | |
34 #if (defined(WEBRTC_CODEC_ISAC) || defined(WEBRTC_CODEC_ISACFX)) | |
35 , kISAC | |
36 # if (defined(WEBRTC_CODEC_ISAC)) | |
37 , kISACSWB | |
38 # endif | |
39 #endif | |
40 // Mono | |
41 , kPCM16B | |
42 , kPCM16Bwb | |
43 , kPCM16Bswb32kHz | |
44 // Stereo | |
45 , kPCM16B_2ch | |
46 , kPCM16Bwb_2ch | |
47 , kPCM16Bswb32kHz_2ch | |
48 // Mono | |
49 , kPCMU | |
50 , kPCMA | |
51 // Stereo | |
52 , kPCMU_2ch | |
53 , kPCMA_2ch | |
54 #ifdef WEBRTC_CODEC_ILBC | |
55 , kILBC | |
56 #endif | |
57 #ifdef WEBRTC_CODEC_G722 | |
58 // Mono | |
59 , kG722 | |
60 // Stereo | |
61 , kG722_2ch | |
62 #endif | |
63 #ifdef WEBRTC_CODEC_OPUS | |
64 // Mono and stereo | |
65 , kOpus | |
66 #endif | |
67 , kCNNB | |
68 , kCNWB | |
69 , kCNSWB | |
70 #ifdef ENABLE_48000_HZ | |
71 , kCNFB | |
72 #endif | |
73 , kAVT | |
74 #ifdef WEBRTC_CODEC_RED | |
75 , kRED | |
76 #endif | |
77 , kNumCodecs | |
78 }; | |
79 | |
80 // Set unsupported codecs to -1 | |
81 #ifndef WEBRTC_CODEC_ISAC | |
82 enum {kISACSWB = -1}; | |
83 # ifndef WEBRTC_CODEC_ISACFX | |
84 enum {kISAC = -1}; | |
85 # endif | |
86 #endif | |
87 // 48 kHz not supported, always set to -1. | |
88 enum {kPCM16Bswb48kHz = -1}; | |
89 #ifndef WEBRTC_CODEC_ILBC | |
90 enum {kILBC = -1}; | |
91 #endif | |
92 #ifndef WEBRTC_CODEC_G722 | |
93 // Mono | |
94 enum {kG722 = -1}; | |
95 // Stereo | |
96 enum {kG722_2ch = -1}; | |
97 #endif | |
98 #ifndef WEBRTC_CODEC_OPUS | |
99 // Mono and stereo | |
100 enum {kOpus = -1}; | |
101 #endif | |
102 #ifndef WEBRTC_CODEC_RED | |
103 enum {kRED = -1}; | |
104 #endif | |
105 #ifndef ENABLE_48000_HZ | |
106 enum { kCNFB = -1 }; | |
107 #endif | |
108 | |
109 // kMaxNumCodecs - Maximum number of codecs that can be activated in one | 31 // kMaxNumCodecs - Maximum number of codecs that can be activated in one |
110 // build. | 32 // build. |
111 // kMaxNumPacketSize - Maximum number of allowed packet sizes for one codec. | 33 // kMaxNumPacketSize - Maximum number of allowed packet sizes for one codec. |
112 // These might need to be increased if adding a new codec to the database | 34 // These might need to be increased if adding a new codec to the database |
113 static const int kMaxNumCodecs = 50; | 35 static const int kMaxNumCodecs = 50; |
114 static const int kMaxNumPacketSize = 6; | 36 static const int kMaxNumPacketSize = 6; |
115 | 37 |
116 // Codec specific settings | 38 // Codec specific settings |
117 // | 39 // |
118 // num_packet_sizes - number of allowed packet sizes. | 40 // num_packet_sizes - number of allowed packet sizes. |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 static const CodecInst database_[kMaxNumCodecs]; | 102 static const CodecInst database_[kMaxNumCodecs]; |
181 static const CodecSettings codec_settings_[kMaxNumCodecs]; | 103 static const CodecSettings codec_settings_[kMaxNumCodecs]; |
182 static const NetEqDecoder neteq_decoders_[kMaxNumCodecs]; | 104 static const NetEqDecoder neteq_decoders_[kMaxNumCodecs]; |
183 }; | 105 }; |
184 | 106 |
185 } // namespace acm2 | 107 } // namespace acm2 |
186 | 108 |
187 } // namespace webrtc | 109 } // namespace webrtc |
188 | 110 |
189 #endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_ACM_CODEC_DATABASE_H_ | 111 #endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_ACM_CODEC_DATABASE_H_ |
OLD | NEW |