Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(253)

Side by Side Diff: webrtc/modules/audio_coding/neteq/decoder_database.h

Issue 2351183002: AcmReceiver: Eliminate AcmReceiver::decoders_ (Closed)
Patch Set: case-insensitive string comparison Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « webrtc/modules/audio_coding/codecs/audio_format.cc ('k') | webrtc/modules/audio_coding/neteq/include/neteq.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698