Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(96)

Unified Diff: webrtc/logging/rtc_event_log/rtc_event_log.cc

Issue 2644863002: Reland of "Log audio network adapter decisions in event log." (Closed)
Patch Set: rebase Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/logging/rtc_event_log/rtc_event_log.h ('k') | webrtc/logging/rtc_event_log/rtc_event_log.proto » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.";
« no previous file with comments | « webrtc/logging/rtc_event_log/rtc_event_log.h ('k') | webrtc/logging/rtc_event_log/rtc_event_log.proto » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698