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 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
384 ? std::move(audio_network_adaptor_creator) | 384 ? std::move(audio_network_adaptor_creator) |
385 : [this](const ProtoString& config_string, | 385 : [this](const ProtoString& config_string, |
386 RtcEventLog* event_log) { | 386 RtcEventLog* event_log) { |
387 return DefaultAudioNetworkAdaptorCreator(config_string, | 387 return DefaultAudioNetworkAdaptorCreator(config_string, |
388 event_log); | 388 event_log); |
389 }), | 389 }), |
390 bitrate_smoother_(bitrate_smoother | 390 bitrate_smoother_(bitrate_smoother |
391 ? std::move(bitrate_smoother) : std::unique_ptr<SmoothingFilter>( | 391 ? std::move(bitrate_smoother) : std::unique_ptr<SmoothingFilter>( |
392 // We choose 5sec as initial time constant due to empirical data. | 392 // We choose 5sec as initial time constant due to empirical data. |
393 new SmoothingFilterImpl(5000))) { | 393 new SmoothingFilterImpl(5000))) { |
394 RTC_DCHECK(0 <= payload_type && payload_type <= 127); | 394 RTC_DCHECK_GE(payload_type, 0); |
| 395 RTC_DCHECK_LE(payload_type, 127); |
395 | 396 |
396 // Sanity check of the redundant payload type field that we want to get rid | 397 // Sanity check of the redundant payload type field that we want to get rid |
397 // of. See https://bugs.chromium.org/p/webrtc/issues/detail?id=7847 | 398 // of. See https://bugs.chromium.org/p/webrtc/issues/detail?id=7847 |
398 RTC_CHECK(config.payload_type == -1 || config.payload_type == payload_type); | 399 RTC_CHECK(config.payload_type == -1 || config.payload_type == payload_type); |
399 | 400 |
400 RTC_CHECK(RecreateEncoderInstance(config)); | 401 RTC_CHECK(RecreateEncoderInstance(config)); |
401 } | 402 } |
402 | 403 |
403 AudioEncoderOpus::AudioEncoderOpus(const CodecInst& codec_inst) | 404 AudioEncoderOpus::AudioEncoderOpus(const CodecInst& codec_inst) |
404 : AudioEncoderOpus(CreateConfig(codec_inst), codec_inst.pltype) {} | 405 : AudioEncoderOpus(CreateConfig(codec_inst), codec_inst.pltype) {} |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
766 config_.uplink_bandwidth_update_interval_ms) { | 767 config_.uplink_bandwidth_update_interval_ms) { |
767 rtc::Optional<float> smoothed_bitrate = bitrate_smoother_->GetAverage(); | 768 rtc::Optional<float> smoothed_bitrate = bitrate_smoother_->GetAverage(); |
768 if (smoothed_bitrate) | 769 if (smoothed_bitrate) |
769 audio_network_adaptor_->SetUplinkBandwidth(*smoothed_bitrate); | 770 audio_network_adaptor_->SetUplinkBandwidth(*smoothed_bitrate); |
770 bitrate_smoother_last_update_time_ = rtc::Optional<int64_t>(now_ms); | 771 bitrate_smoother_last_update_time_ = rtc::Optional<int64_t>(now_ms); |
771 } | 772 } |
772 } | 773 } |
773 } | 774 } |
774 | 775 |
775 } // namespace webrtc | 776 } // namespace webrtc |
OLD | NEW |