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 #ifndef WEBRTC_MODULES_AUDIO_CODING_NETEQ_DECODER_DATABASE_H_ | 11 #ifndef WEBRTC_MODULES_AUDIO_CODING_NETEQ_DECODER_DATABASE_H_ |
12 #define WEBRTC_MODULES_AUDIO_CODING_NETEQ_DECODER_DATABASE_H_ | 12 #define WEBRTC_MODULES_AUDIO_CODING_NETEQ_DECODER_DATABASE_H_ |
13 | 13 |
14 #include <map> | 14 #include <map> |
15 #include <string> | 15 #include <string> |
16 | 16 |
17 #include "webrtc/base/constructormagic.h" | 17 #include "webrtc/base/constructormagic.h" |
18 #include "webrtc/common_types.h" // NULL | 18 #include "webrtc/common_types.h" // NULL |
| 19 #include "webrtc/modules/audio_coding/codecs/cng/webrtc_cng.h" |
19 #include "webrtc/modules/audio_coding/neteq/audio_decoder_impl.h" | 20 #include "webrtc/modules/audio_coding/neteq/audio_decoder_impl.h" |
20 #include "webrtc/modules/audio_coding/neteq/packet.h" | 21 #include "webrtc/modules/audio_coding/neteq/packet.h" |
21 #include "webrtc/typedefs.h" | 22 #include "webrtc/typedefs.h" |
22 | 23 |
23 namespace webrtc { | 24 namespace webrtc { |
24 | 25 |
25 class DecoderDatabase { | 26 class DecoderDatabase { |
26 public: | 27 public: |
27 enum DatabaseReturnCodes { | 28 enum DatabaseReturnCodes { |
28 kOK = 0, | 29 kOK = 0, |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 // Returns the current active decoder, or NULL if no active decoder exists. | 136 // Returns the current active decoder, or NULL if no active decoder exists. |
136 virtual AudioDecoder* GetActiveDecoder(); | 137 virtual AudioDecoder* GetActiveDecoder(); |
137 | 138 |
138 // Sets the active comfort noise decoder to be |rtp_payload_type|. If this | 139 // Sets the active comfort noise decoder to be |rtp_payload_type|. If this |
139 // call results in a change of active comfort noise decoder, the previous | 140 // call results in a change of active comfort noise decoder, the previous |
140 // active decoder's AudioDecoder object is deleted. | 141 // active decoder's AudioDecoder object is deleted. |
141 virtual int SetActiveCngDecoder(uint8_t rtp_payload_type); | 142 virtual int SetActiveCngDecoder(uint8_t rtp_payload_type); |
142 | 143 |
143 // Returns the current active comfort noise decoder, or NULL if no active | 144 // Returns the current active comfort noise decoder, or NULL if no active |
144 // comfort noise decoder exists. | 145 // comfort noise decoder exists. |
145 virtual AudioDecoder* GetActiveCngDecoder(); | 146 virtual ComfortNoiseDecoder* GetActiveCngDecoder(); |
146 | 147 |
147 // Returns kOK if all packets in |packet_list| carry payload types that are | 148 // Returns kOK if all packets in |packet_list| carry payload types that are |
148 // registered in the database. Otherwise, returns kDecoderNotFound. | 149 // registered in the database. Otherwise, returns kDecoderNotFound. |
149 virtual int CheckPayloadTypes(const PacketList& packet_list) const; | 150 virtual int CheckPayloadTypes(const PacketList& packet_list) const; |
150 | 151 |
151 private: | 152 private: |
152 typedef std::map<uint8_t, DecoderInfo> DecoderMap; | 153 typedef std::map<uint8_t, DecoderInfo> DecoderMap; |
153 | 154 |
154 DecoderMap decoders_; | 155 DecoderMap decoders_; |
155 int active_decoder_; | 156 int active_decoder_type_; |
156 int active_cng_decoder_; | 157 int active_cng_decoder_type_; |
| 158 std::unique_ptr<ComfortNoiseDecoder> active_cng_decoder_; |
157 | 159 |
158 RTC_DISALLOW_COPY_AND_ASSIGN(DecoderDatabase); | 160 RTC_DISALLOW_COPY_AND_ASSIGN(DecoderDatabase); |
159 }; | 161 }; |
160 | 162 |
161 } // namespace webrtc | 163 } // namespace webrtc |
162 #endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ_DECODER_DATABASE_H_ | 164 #endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ_DECODER_DATABASE_H_ |
OLD | NEW |