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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 ~DecoderInfo(); | 52 ~DecoderInfo(); |
53 | 53 |
54 // Get the AudioDecoder object, creating it first if necessary. | 54 // Get the AudioDecoder object, creating it first if necessary. |
55 AudioDecoder* GetDecoder() const; | 55 AudioDecoder* GetDecoder() const; |
56 | 56 |
57 // Delete the AudioDecoder object, unless it's external. (This means we can | 57 // Delete the AudioDecoder object, unless it's external. (This means we can |
58 // always recreate it later if we need it.) | 58 // always recreate it later if we need it.) |
59 void DropDecoder() const { decoder_.reset(); } | 59 void DropDecoder() const { decoder_.reset(); } |
60 | 60 |
61 int SampleRateHz() const { | 61 int SampleRateHz() const { |
62 RTC_DCHECK_EQ(1, !!decoder_ + !!external_decoder_ + !!cng_decoder_); | 62 const AudioDecoder* decoder = GetDecoder(); |
63 return decoder_ ? decoder_->SampleRateHz() | 63 RTC_DCHECK_EQ(1, !!decoder + !!cng_decoder_); |
64 : external_decoder_ ? external_decoder_->SampleRateHz() | 64 return decoder ? decoder->SampleRateHz() : cng_decoder_->sample_rate_hz; |
65 : cng_decoder_->sample_rate_hz; | 65 } |
| 66 |
| 67 const SdpAudioFormat& GetFormat() const { |
| 68 RTC_DCHECK(audio_format_); |
| 69 return *audio_format_; |
66 } | 70 } |
67 | 71 |
68 // Returns true if |codec_type| is comfort noise. | 72 // Returns true if |codec_type| is comfort noise. |
69 bool IsComfortNoise() const; | 73 bool IsComfortNoise() const; |
70 | 74 |
71 // Returns true if |codec_type| is DTMF. | 75 // Returns true if |codec_type| is DTMF. |
72 bool IsDtmf() const; | 76 bool IsDtmf() const; |
73 | 77 |
74 // Returns true if |codec_type| is RED. | 78 // Returns true if |codec_type| is RED. |
75 bool IsRed() const; | 79 bool IsRed() const; |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 int active_decoder_type_; | 195 int active_decoder_type_; |
192 int active_cng_decoder_type_; | 196 int active_cng_decoder_type_; |
193 mutable std::unique_ptr<ComfortNoiseDecoder> active_cng_decoder_; | 197 mutable std::unique_ptr<ComfortNoiseDecoder> active_cng_decoder_; |
194 rtc::scoped_refptr<AudioDecoderFactory> decoder_factory_; | 198 rtc::scoped_refptr<AudioDecoderFactory> decoder_factory_; |
195 | 199 |
196 RTC_DISALLOW_COPY_AND_ASSIGN(DecoderDatabase); | 200 RTC_DISALLOW_COPY_AND_ASSIGN(DecoderDatabase); |
197 }; | 201 }; |
198 | 202 |
199 } // namespace webrtc | 203 } // namespace webrtc |
200 #endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ_DECODER_DATABASE_H_ | 204 #endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ_DECODER_DATABASE_H_ |
OLD | NEW |