| Index: webrtc/logging/rtc_event_log/rtc_event_log.cc
|
| diff --git a/webrtc/logging/rtc_event_log/rtc_event_log.cc b/webrtc/logging/rtc_event_log/rtc_event_log.cc
|
| index 21ca5e127de2f8d3b135cc966cdcf9d8dd80cd6d..65ee7d8881e6c413301e85fd02667878d29defbe 100644
|
| --- a/webrtc/logging/rtc_event_log/rtc_event_log.cc
|
| +++ b/webrtc/logging/rtc_event_log/rtc_event_log.cc
|
| @@ -77,6 +77,8 @@ class RtcEventLogImpl final : public RtcEventLog {
|
| void LogBwePacketLossEvent(int32_t bitrate,
|
| uint8_t fraction_loss,
|
| int32_t total_packets) override;
|
| + void LogAudioNetworkAdaptation(
|
| + const AudioNetworkAdaptor::EncoderRuntimeConfig& config) override;
|
|
|
| private:
|
| void StoreEvent(std::unique_ptr<rtclog::Event>* event);
|
| @@ -434,6 +436,29 @@ void RtcEventLogImpl::LogBwePacketLossEvent(int32_t bitrate,
|
| StoreEvent(&event);
|
| }
|
|
|
| +void RtcEventLogImpl::LogAudioNetworkAdaptation(
|
| + const AudioNetworkAdaptor::EncoderRuntimeConfig& config) {
|
| + std::unique_ptr<rtclog::Event> event(new rtclog::Event());
|
| + event->set_timestamp_us(rtc::TimeMicros());
|
| + event->set_type(rtclog::Event::AUDIO_NETWORK_ADAPTATION_EVENT);
|
| + auto audio_network_adaptation = event->mutable_audio_network_adaptation();
|
| + if (config.bitrate_bps)
|
| + audio_network_adaptation->set_bitrate_bps(*config.bitrate_bps);
|
| + if (config.frame_length_ms)
|
| + audio_network_adaptation->set_frame_length_ms(*config.frame_length_ms);
|
| + if (config.uplink_packet_loss_fraction) {
|
| + audio_network_adaptation->set_uplink_packet_loss_fraction(
|
| + *config.uplink_packet_loss_fraction);
|
| + }
|
| + if (config.enable_fec)
|
| + audio_network_adaptation->set_enable_fec(*config.enable_fec);
|
| + if (config.enable_dtx)
|
| + audio_network_adaptation->set_enable_dtx(*config.enable_dtx);
|
| + if (config.num_channels)
|
| + audio_network_adaptation->set_num_channels(*config.num_channels);
|
| + StoreEvent(&event);
|
| +}
|
| +
|
| void RtcEventLogImpl::StoreEvent(std::unique_ptr<rtclog::Event>* event) {
|
| if (!event_queue_.Insert(event)) {
|
| LOG(LS_ERROR) << "WebRTC event log queue full. Dropping event.";
|
|
|