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 12 matching lines...) Expand all Loading... |
23 : event_log_(event_log), | 23 : event_log_(event_log), |
24 min_bitrate_change_bps_(min_bitrate_change_bps), | 24 min_bitrate_change_bps_(min_bitrate_change_bps), |
25 min_bitrate_change_fraction_(min_bitrate_change_fraction), | 25 min_bitrate_change_fraction_(min_bitrate_change_fraction), |
26 min_packet_loss_change_fraction_(min_packet_loss_change_fraction) { | 26 min_packet_loss_change_fraction_(min_packet_loss_change_fraction) { |
27 RTC_DCHECK(event_log_); | 27 RTC_DCHECK(event_log_); |
28 } | 28 } |
29 | 29 |
30 EventLogWriter::~EventLogWriter() = default; | 30 EventLogWriter::~EventLogWriter() = default; |
31 | 31 |
32 void EventLogWriter::MaybeLogEncoderConfig( | 32 void EventLogWriter::MaybeLogEncoderConfig( |
33 const AudioNetworkAdaptor::EncoderRuntimeConfig& config) { | 33 const AudioEncoderRuntimeConfig& config) { |
34 if (last_logged_config_.num_channels != config.num_channels) | 34 if (last_logged_config_.num_channels != config.num_channels) |
35 return LogEncoderConfig(config); | 35 return LogEncoderConfig(config); |
36 if (last_logged_config_.enable_dtx != config.enable_dtx) | 36 if (last_logged_config_.enable_dtx != config.enable_dtx) |
37 return LogEncoderConfig(config); | 37 return LogEncoderConfig(config); |
38 if (last_logged_config_.enable_fec != config.enable_fec) | 38 if (last_logged_config_.enable_fec != config.enable_fec) |
39 return LogEncoderConfig(config); | 39 return LogEncoderConfig(config); |
40 if (last_logged_config_.frame_length_ms != config.frame_length_ms) | 40 if (last_logged_config_.frame_length_ms != config.frame_length_ms) |
41 return LogEncoderConfig(config); | 41 return LogEncoderConfig(config); |
42 if ((!last_logged_config_.bitrate_bps && config.bitrate_bps) || | 42 if ((!last_logged_config_.bitrate_bps && config.bitrate_bps) || |
43 (last_logged_config_.bitrate_bps && config.bitrate_bps && | 43 (last_logged_config_.bitrate_bps && config.bitrate_bps && |
44 std::abs(*last_logged_config_.bitrate_bps - *config.bitrate_bps) >= | 44 std::abs(*last_logged_config_.bitrate_bps - *config.bitrate_bps) >= |
45 std::min(static_cast<int>(*last_logged_config_.bitrate_bps * | 45 std::min(static_cast<int>(*last_logged_config_.bitrate_bps * |
46 min_bitrate_change_fraction_), | 46 min_bitrate_change_fraction_), |
47 min_bitrate_change_bps_))) { | 47 min_bitrate_change_bps_))) { |
48 return LogEncoderConfig(config); | 48 return LogEncoderConfig(config); |
49 } | 49 } |
50 if ((!last_logged_config_.uplink_packet_loss_fraction && | 50 if ((!last_logged_config_.uplink_packet_loss_fraction && |
51 config.uplink_packet_loss_fraction) || | 51 config.uplink_packet_loss_fraction) || |
52 (last_logged_config_.uplink_packet_loss_fraction && | 52 (last_logged_config_.uplink_packet_loss_fraction && |
53 config.uplink_packet_loss_fraction && | 53 config.uplink_packet_loss_fraction && |
54 fabs(*last_logged_config_.uplink_packet_loss_fraction - | 54 fabs(*last_logged_config_.uplink_packet_loss_fraction - |
55 *config.uplink_packet_loss_fraction) >= | 55 *config.uplink_packet_loss_fraction) >= |
56 min_packet_loss_change_fraction_ * | 56 min_packet_loss_change_fraction_ * |
57 *last_logged_config_.uplink_packet_loss_fraction)) { | 57 *last_logged_config_.uplink_packet_loss_fraction)) { |
58 return LogEncoderConfig(config); | 58 return LogEncoderConfig(config); |
59 } | 59 } |
60 } | 60 } |
61 | 61 |
62 void EventLogWriter::LogEncoderConfig( | 62 void EventLogWriter::LogEncoderConfig(const AudioEncoderRuntimeConfig& config) { |
63 const AudioNetworkAdaptor::EncoderRuntimeConfig& config) { | |
64 event_log_->LogAudioNetworkAdaptation(config); | 63 event_log_->LogAudioNetworkAdaptation(config); |
65 last_logged_config_ = config; | 64 last_logged_config_ = config; |
66 } | 65 } |
67 | 66 |
68 } // namespace webrtc | 67 } // namespace webrtc |
OLD | NEW |