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 16 matching lines...) Expand all Loading... |
27 class CodecOwner { | 27 class CodecOwner { |
28 public: | 28 public: |
29 CodecOwner(); | 29 CodecOwner(); |
30 ~CodecOwner(); | 30 ~CodecOwner(); |
31 | 31 |
32 void SetEncoders(const CodecInst& speech_inst, | 32 void SetEncoders(const CodecInst& speech_inst, |
33 int cng_payload_type, | 33 int cng_payload_type, |
34 ACMVADMode vad_mode, | 34 ACMVADMode vad_mode, |
35 int red_payload_type); | 35 int red_payload_type); |
36 | 36 |
37 void SetEncoders(AudioEncoderMutable* external_speech_encoder, | 37 void SetEncoders(AudioEncoder* external_speech_encoder, |
38 int cng_payload_type, | 38 int cng_payload_type, |
39 ACMVADMode vad_mode, | 39 ACMVADMode vad_mode, |
40 int red_payload_type); | 40 int red_payload_type); |
41 | 41 |
42 void ChangeCngAndRed(int cng_payload_type, | 42 void ChangeCngAndRed(int cng_payload_type, |
43 ACMVADMode vad_mode, | 43 ACMVADMode vad_mode, |
44 int red_payload_type); | 44 int red_payload_type); |
45 | 45 |
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(); | |
53 const AudioEncoderMutable* SpeechEncoder() const; | |
54 | 52 |
55 private: | 53 private: |
| 54 AudioEncoder* SpeechEncoder(); |
| 55 const AudioEncoder* SpeechEncoder() const; |
| 56 |
56 // At most one of these is non-null: | 57 // At most one of these is non-null: |
57 rtc::scoped_ptr<AudioEncoderMutable> speech_encoder_; | 58 rtc::scoped_ptr<AudioEncoder> speech_encoder_; |
58 AudioEncoderMutable* external_speech_encoder_; | 59 AudioEncoder* external_speech_encoder_; |
59 | 60 |
60 // If we've created an iSAC decoder because someone called GetIsacDecoder, | 61 // If we've created an iSAC decoder because someone called GetIsacDecoder, |
61 // store it here. | 62 // store it here. |
62 rtc::scoped_ptr<AudioDecoder> isac_decoder_; | 63 rtc::scoped_ptr<AudioDecoder> isac_decoder_; |
63 | 64 |
64 // iSAC bandwidth estimation info, for use with iSAC encoders and decoders. | 65 // iSAC bandwidth estimation info, for use with iSAC encoders and decoders. |
65 LockedIsacBandwidthInfo isac_bandwidth_info_; | 66 LockedIsacBandwidthInfo isac_bandwidth_info_; |
66 | 67 |
67 // |cng_encoder_| and |red_encoder_| are valid iff CNG or RED, respectively, | 68 // |cng_encoder_| and |red_encoder_| are valid iff CNG or RED, respectively, |
68 // are active. | 69 // are active. |
69 rtc::scoped_ptr<AudioEncoder> cng_encoder_; | 70 rtc::scoped_ptr<AudioEncoder> cng_encoder_; |
70 rtc::scoped_ptr<AudioEncoder> red_encoder_; | 71 rtc::scoped_ptr<AudioEncoder> red_encoder_; |
71 | 72 |
72 DISALLOW_COPY_AND_ASSIGN(CodecOwner); | 73 DISALLOW_COPY_AND_ASSIGN(CodecOwner); |
73 }; | 74 }; |
74 | 75 |
75 } // namespace acm2 | 76 } // namespace acm2 |
76 } // namespace webrtc | 77 } // namespace webrtc |
77 #endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_CODEC_OWNER_H_ | 78 #endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_CODEC_OWNER_H_ |
OLD | NEW |