OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 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 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 scoring_point->set_uplink_bandwidth_bps(kChracteristicBandwithBps[1]); | 263 scoring_point->set_uplink_bandwidth_bps(kChracteristicBandwithBps[1]); |
264 scoring_point->set_uplink_packet_loss_fraction( | 264 scoring_point->set_uplink_packet_loss_fraction( |
265 kChracteristicPacketLossFraction[1]); | 265 kChracteristicPacketLossFraction[1]); |
266 } | 266 } |
267 | 267 |
268 constexpr int kInitialBitrateBps = 24000; | 268 constexpr int kInitialBitrateBps = 24000; |
269 constexpr size_t kIntialChannelsToEncode = 1; | 269 constexpr size_t kIntialChannelsToEncode = 1; |
270 constexpr bool kInitialDtxEnabled = true; | 270 constexpr bool kInitialDtxEnabled = true; |
271 constexpr bool kInitialFecEnabled = true; | 271 constexpr bool kInitialFecEnabled = true; |
272 constexpr int kInitialFrameLengthMs = 60; | 272 constexpr int kInitialFrameLengthMs = 60; |
| 273 constexpr int kMinBitrateBps = 6000; |
273 | 274 |
274 ControllerManagerStates CreateControllerManager( | 275 ControllerManagerStates CreateControllerManager( |
275 const std::string& config_string) { | 276 const std::string& config_string) { |
276 ControllerManagerStates states; | 277 ControllerManagerStates states; |
277 states.simulated_clock.reset(new SimulatedClock(kClockInitialTime)); | 278 states.simulated_clock.reset(new SimulatedClock(kClockInitialTime)); |
278 constexpr size_t kNumEncoderChannels = 2; | 279 constexpr size_t kNumEncoderChannels = 2; |
279 const std::vector<int> encoder_frame_lengths_ms = {20, 60}; | 280 const std::vector<int> encoder_frame_lengths_ms = {20, 60}; |
280 states.controller_manager = ControllerManagerImpl::Create( | 281 states.controller_manager = ControllerManagerImpl::Create( |
281 config_string, kNumEncoderChannels, encoder_frame_lengths_ms, | 282 config_string, kNumEncoderChannels, encoder_frame_lengths_ms, |
282 kIntialChannelsToEncode, kInitialFrameLengthMs, kInitialBitrateBps, | 283 kMinBitrateBps, kIntialChannelsToEncode, kInitialFrameLengthMs, |
283 kInitialFecEnabled, kInitialDtxEnabled, states.simulated_clock.get()); | 284 kInitialBitrateBps, kInitialFecEnabled, kInitialDtxEnabled, |
| 285 states.simulated_clock.get()); |
284 return states; | 286 return states; |
285 } | 287 } |
286 | 288 |
287 enum class ControllerType : int8_t { | 289 enum class ControllerType : int8_t { |
288 FEC, | 290 FEC, |
289 CHANNEL, | 291 CHANNEL, |
290 DTX, | 292 DTX, |
291 FRAME_LENGTH, | 293 FRAME_LENGTH, |
292 BIT_RATE | 294 BIT_RATE |
293 }; | 295 }; |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 // Reorder now. | 412 // Reorder now. |
411 CheckControllersOrder(controllers, | 413 CheckControllersOrder(controllers, |
412 std::vector<ControllerType>{ | 414 std::vector<ControllerType>{ |
413 ControllerType::FRAME_LENGTH, ControllerType::FEC, | 415 ControllerType::FRAME_LENGTH, ControllerType::FEC, |
414 ControllerType::CHANNEL, ControllerType::DTX, | 416 ControllerType::CHANNEL, ControllerType::DTX, |
415 ControllerType::BIT_RATE}); | 417 ControllerType::BIT_RATE}); |
416 } | 418 } |
417 #endif // WEBRTC_AUDIO_NETWORK_ADAPTOR_DEBUG_DUMP | 419 #endif // WEBRTC_AUDIO_NETWORK_ADAPTOR_DEBUG_DUMP |
418 | 420 |
419 } // namespace webrtc | 421 } // namespace webrtc |
OLD | NEW |