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

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

Issue 2559953002: Log audio network adapter decisions in event log. (Closed)
Patch Set: Response to comments Created 4 years 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
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 976ff2321c08106dcea319a19c63f50619ebb0af..96d6e56d653fcd6633f5c10ff9d7391d291cc336 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 LogEncoderRuntimeConfig(
+ const AudioNetworkAdaptor::EncoderRuntimeConfig& config) override;
private:
void StoreEvent(std::unique_ptr<rtclog::Event>* event);
@@ -437,6 +439,28 @@ void RtcEventLogImpl::LogBwePacketLossEvent(int32_t bitrate,
StoreEvent(&event);
}
+void RtcEventLogImpl::LogEncoderRuntimeConfig(
+ const AudioNetworkAdaptor::EncoderRuntimeConfig& config) {
+ std::unique_ptr<rtclog::Event> event(new rtclog::Event());
+ event->set_timestamp_us(clock_->TimeInMicroseconds());
+ event->set_type(rtclog::Event::AUDIO_NETWORK_ADAPTOR_EVENT);
minyue-webrtc 2016/12/20 10:39:29 Slightly confusing is that the function is LogEnco
michaelt 2016/12/20 13:41:41 Done.
minyue-webrtc 2016/12/20 14:11:05 Almost, but we cannot drop "Audio" in the function
michaelt 2016/12/20 14:34:03 Right :) Done
+ auto ana_event = event->mutable_encoder_runtime_config();
+ if (config.bitrate_bps)
minyue-webrtc 2016/12/20 10:39:29 how about making 448 ~ 460 a utility function, whi
michaelt 2016/12/20 13:41:40 Done.
+ ana_event->set_bitrate_bps(*config.bitrate_bps);
+ if (config.frame_length_ms)
+ ana_event->set_frame_length_ms(*config.frame_length_ms);
+ if (config.uplink_packet_loss_fraction)
+ ana_event->set_uplink_packet_loss_fraction(
+ *config.uplink_packet_loss_fraction);
+ if (config.enable_fec)
+ ana_event->set_enable_fec(*config.enable_fec);
+ if (config.enable_dtx)
+ ana_event->set_enable_dtx(*config.enable_dtx);
+ if (config.num_channels)
+ ana_event->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.";

Powered by Google App Engine
This is Rietveld 408576698