| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 const AudioDecoder* decoder = GetDecoder(); | 62 const AudioDecoder* decoder = GetDecoder(); |
| 63 RTC_DCHECK_EQ(1, !!decoder + !!cng_decoder_); | 63 RTC_DCHECK_EQ(1, !!decoder + !!cng_decoder_); |
| 64 return decoder ? decoder->SampleRateHz() : cng_decoder_->sample_rate_hz; | 64 return decoder ? decoder->SampleRateHz() : cng_decoder_->sample_rate_hz; |
| 65 } | 65 } |
| 66 | 66 |
| 67 const SdpAudioFormat& GetFormat() const { | 67 const SdpAudioFormat* GetFormat() const { |
| 68 RTC_DCHECK(audio_format_); | 68 return audio_format_ ? &*audio_format_ : nullptr; |
| 69 return *audio_format_; | |
| 70 } | 69 } |
| 71 | 70 |
| 72 // Returns true if |codec_type| is comfort noise. | 71 // Returns true if |codec_type| is comfort noise. |
| 73 bool IsComfortNoise() const; | 72 bool IsComfortNoise() const; |
| 74 | 73 |
| 75 // Returns true if |codec_type| is DTMF. | 74 // Returns true if |codec_type| is DTMF. |
| 76 bool IsDtmf() const; | 75 bool IsDtmf() const; |
| 77 | 76 |
| 78 // Returns true if |codec_type| is RED. | 77 // Returns true if |codec_type| is RED. |
| 79 bool IsRed() const; | 78 bool IsRed() const; |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 int active_decoder_type_; | 197 int active_decoder_type_; |
| 199 int active_cng_decoder_type_; | 198 int active_cng_decoder_type_; |
| 200 mutable std::unique_ptr<ComfortNoiseDecoder> active_cng_decoder_; | 199 mutable std::unique_ptr<ComfortNoiseDecoder> active_cng_decoder_; |
| 201 rtc::scoped_refptr<AudioDecoderFactory> decoder_factory_; | 200 rtc::scoped_refptr<AudioDecoderFactory> decoder_factory_; |
| 202 | 201 |
| 203 RTC_DISALLOW_COPY_AND_ASSIGN(DecoderDatabase); | 202 RTC_DISALLOW_COPY_AND_ASSIGN(DecoderDatabase); |
| 204 }; | 203 }; |
| 205 | 204 |
| 206 } // namespace webrtc | 205 } // namespace webrtc |
| 207 #endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ_DECODER_DATABASE_H_ | 206 #endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ_DECODER_DATABASE_H_ |
| OLD | NEW |