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 | 46 |
47 int SetCodecFEC(bool enable_codec_fec); | 47 int SetCodecFEC(bool enable_codec_fec); |
48 | 48 |
49 // Returns a pointer to AudioDecoder of the given codec. For iSAC, encoding | 49 // Returns a pointer to AudioDecoder of the given codec. For iSAC, encoding |
50 // and decoding have to be performed on a shared codec instance. By calling | 50 // and decoding have to be performed on a shared codec instance. By calling |
51 // this method, we get the codec instance that ACM owns. | 51 // this method, we get the codec instance that ACM owns. |
52 // If |codec| does not share an instance between encoder and decoder, returns | 52 // If |codec| does not share an instance between encoder and decoder, returns |
53 // null. | 53 // null. |
54 AudioDecoder* GetAudioDecoder(const CodecInst& codec); | 54 AudioDecoder* GetAudioDecoder(const CodecInst& codec); |
55 | 55 |
56 bool stereo_send() const { return stereo_send_; } | |
57 | |
58 bool red_enabled() const { return red_enabled_; } | 56 bool red_enabled() const { return red_enabled_; } |
59 | 57 |
60 bool codec_fec_enabled() const { return codec_fec_enabled_; } | 58 bool codec_fec_enabled() const { return codec_fec_enabled_; } |
61 | 59 |
62 AudioEncoder* CurrentEncoder() { return codec_owner_.Encoder(); } | 60 AudioEncoder* CurrentEncoder() { return codec_owner_.Encoder(); } |
63 const AudioEncoder* CurrentEncoder() const { return codec_owner_.Encoder(); } | 61 const AudioEncoder* CurrentEncoder() const { return codec_owner_.Encoder(); } |
64 | 62 |
65 bool CurrentEncoderIsOpus() const { return encoder_is_opus_; } | 63 bool CurrentEncoderIsOpus() const { return encoder_is_opus_; } |
66 | 64 |
67 private: | 65 private: |
68 int CngPayloadType(int sample_rate_hz) const; | 66 int CngPayloadType(int sample_rate_hz) const; |
69 | 67 |
70 int RedPayloadType(int sample_rate_hz) const; | 68 int RedPayloadType(int sample_rate_hz) const; |
71 | 69 |
72 rtc::ThreadChecker thread_checker_; | 70 rtc::ThreadChecker thread_checker_; |
73 uint8_t cng_nb_pltype_; | 71 uint8_t cng_nb_pltype_; |
74 uint8_t cng_wb_pltype_; | 72 uint8_t cng_wb_pltype_; |
75 uint8_t cng_swb_pltype_; | 73 uint8_t cng_swb_pltype_; |
76 uint8_t cng_fb_pltype_; | 74 uint8_t cng_fb_pltype_; |
77 uint8_t red_nb_pltype_; | 75 uint8_t red_nb_pltype_; |
78 bool stereo_send_; | |
79 bool dtx_enabled_; | 76 bool dtx_enabled_; |
80 ACMVADMode vad_mode_; | 77 ACMVADMode vad_mode_; |
81 CodecInst send_codec_inst_; | 78 CodecInst send_codec_inst_; |
82 bool red_enabled_; | 79 bool red_enabled_; |
83 bool codec_fec_enabled_; | 80 bool codec_fec_enabled_; |
84 CodecOwner codec_owner_; | 81 CodecOwner codec_owner_; |
85 RentACodec rent_a_codec_; | 82 RentACodec rent_a_codec_; |
86 bool encoder_is_opus_; | 83 bool encoder_is_opus_; |
87 | 84 |
88 RTC_DISALLOW_COPY_AND_ASSIGN(CodecManager); | 85 RTC_DISALLOW_COPY_AND_ASSIGN(CodecManager); |
89 }; | 86 }; |
90 | 87 |
91 } // namespace acm2 | 88 } // namespace acm2 |
92 } // namespace webrtc | 89 } // namespace webrtc |
93 #endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_CODEC_MANAGER_H_ | 90 #endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_CODEC_MANAGER_H_ |
OLD | NEW |