OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 // Returns a pointer to an iSAC decoder owned by the CodecOwner. The decoder | 46 // Returns a pointer to an iSAC decoder owned by the CodecOwner. The decoder |
47 // will live as long as the CodecOwner exists. | 47 // will live as long as the CodecOwner exists. |
48 AudioDecoder* GetIsacDecoder(); | 48 AudioDecoder* GetIsacDecoder(); |
49 | 49 |
50 AudioEncoder* Encoder(); | 50 AudioEncoder* Encoder(); |
51 const AudioEncoder* Encoder() const; | 51 const AudioEncoder* Encoder() const; |
52 AudioEncoderMutable* SpeechEncoder(); | 52 AudioEncoderMutable* SpeechEncoder(); |
53 const AudioEncoderMutable* SpeechEncoder() const; | 53 const AudioEncoderMutable* SpeechEncoder() const; |
54 | 54 |
55 private: | 55 private: |
56 // There are three main cases for the state of the encoder members below: | 56 // At most one of these is non-null: |
57 // 1. An external encoder is used. |external_speech_encoder_| points to it. | |
58 // |speech_encoder_| is null, and |isac_is_encoder_| is false. | |
59 // 2. The internal iSAC codec is used as encoder. |isac_codec_| points to it | |
60 // and |isac_is_encoder_| is true. |external_speech_encoder_| and | |
61 // |speech_encoder_| are null. | |
62 // 3. Another internal encoder is used. |speech_encoder_| points to it. | |
63 // |external_speech_encoder_| is null, and |isac_is_encoder_| is false. | |
64 // In addition to case 2, |isac_codec_| is valid when GetIsacDecoder has been | |
65 // called. | |
66 rtc::scoped_ptr<AudioEncoderMutable> speech_encoder_; | 57 rtc::scoped_ptr<AudioEncoderMutable> speech_encoder_; |
67 rtc::scoped_ptr<AudioEncoderDecoderMutableIsac> isac_codec_; | |
68 bool isac_is_encoder_; | |
69 AudioEncoderMutable* external_speech_encoder_; | 58 AudioEncoderMutable* external_speech_encoder_; |
70 | 59 |
| 60 // If we've created an iSAC decoder because someone called GetIsacDecoder, |
| 61 // store it here. |
| 62 rtc::scoped_ptr<AudioDecoder> isac_decoder_; |
| 63 |
| 64 // iSAC bandwidth estimation info, for use with iSAC encoders and decoders. |
| 65 LockedIsacBandwidthInfo isac_bandwidth_info_; |
| 66 |
71 // |cng_encoder_| and |red_encoder_| are valid iff CNG or RED, respectively, | 67 // |cng_encoder_| and |red_encoder_| are valid iff CNG or RED, respectively, |
72 // are active. | 68 // are active. |
73 rtc::scoped_ptr<AudioEncoder> cng_encoder_; | 69 rtc::scoped_ptr<AudioEncoder> cng_encoder_; |
74 rtc::scoped_ptr<AudioEncoder> red_encoder_; | 70 rtc::scoped_ptr<AudioEncoder> red_encoder_; |
75 | 71 |
76 DISALLOW_COPY_AND_ASSIGN(CodecOwner); | 72 DISALLOW_COPY_AND_ASSIGN(CodecOwner); |
77 }; | 73 }; |
78 | 74 |
79 } // namespace acm2 | 75 } // namespace acm2 |
80 } // namespace webrtc | 76 } // namespace webrtc |
81 #endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_CODEC_OWNER_H_ | 77 #endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_CODEC_OWNER_H_ |
OLD | NEW |