OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 conf.fec_enabled = enable; | 145 conf.fec_enabled = enable; |
146 return RecreateEncoderInstance(conf); | 146 return RecreateEncoderInstance(conf); |
147 } | 147 } |
148 | 148 |
149 bool AudioEncoderOpus::SetDtx(bool enable) { | 149 bool AudioEncoderOpus::SetDtx(bool enable) { |
150 auto conf = config_; | 150 auto conf = config_; |
151 conf.dtx_enabled = enable; | 151 conf.dtx_enabled = enable; |
152 return RecreateEncoderInstance(conf); | 152 return RecreateEncoderInstance(conf); |
153 } | 153 } |
154 | 154 |
| 155 bool AudioEncoderOpus::GetDtx() const { |
| 156 return config_.dtx_enabled; |
| 157 } |
| 158 |
155 bool AudioEncoderOpus::SetApplication(Application application) { | 159 bool AudioEncoderOpus::SetApplication(Application application) { |
156 auto conf = config_; | 160 auto conf = config_; |
157 switch (application) { | 161 switch (application) { |
158 case Application::kSpeech: | 162 case Application::kSpeech: |
159 conf.application = AudioEncoderOpus::kVoip; | 163 conf.application = AudioEncoderOpus::kVoip; |
160 break; | 164 break; |
161 case Application::kAudio: | 165 case Application::kAudio: |
162 conf.application = AudioEncoderOpus::kAudio; | 166 conf.application = AudioEncoderOpus::kAudio; |
163 break; | 167 break; |
164 } | 168 } |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 RTC_CHECK_EQ(0, WebRtcOpus_DisableDtx(inst_)); | 279 RTC_CHECK_EQ(0, WebRtcOpus_DisableDtx(inst_)); |
276 } | 280 } |
277 RTC_CHECK_EQ(0, | 281 RTC_CHECK_EQ(0, |
278 WebRtcOpus_SetPacketLossRate( | 282 WebRtcOpus_SetPacketLossRate( |
279 inst_, static_cast<int32_t>(packet_loss_rate_ * 100 + .5))); | 283 inst_, static_cast<int32_t>(packet_loss_rate_ * 100 + .5))); |
280 config_ = config; | 284 config_ = config; |
281 return true; | 285 return true; |
282 } | 286 } |
283 | 287 |
284 } // namespace webrtc | 288 } // namespace webrtc |
OLD | NEW |