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

Unified Diff: webrtc/modules/audio_coding/audio_network_adaptor/debug_dump_writer.cc

Issue 2559953002: Log audio network adapter decisions in event log. (Closed)
Patch Set: Rebased 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
Index: webrtc/modules/audio_coding/audio_network_adaptor/debug_dump_writer.cc
diff --git a/webrtc/modules/audio_coding/audio_network_adaptor/debug_dump_writer.cc b/webrtc/modules/audio_coding/audio_network_adaptor/debug_dump_writer.cc
index 7770e65a269ec8e246d982e647f9ad3bc2d23f23..54398e05c89c4d82831ac481ffeed714f273a2a4 100644
--- a/webrtc/modules/audio_coding/audio_network_adaptor/debug_dump_writer.cc
+++ b/webrtc/modules/audio_coding/audio_network_adaptor/debug_dump_writer.cc
@@ -105,34 +105,38 @@ void DebugDumpWriterImpl::DumpEncoderRuntimeConfig(
Event event;
event.set_timestamp(timestamp);
event.set_type(Event::ENCODER_RUNTIME_CONFIG);
- auto dump_config = event.mutable_encoder_runtime_config();
+ ConvertEncoderConfigToDumpEntry(config,
+ event.mutable_encoder_runtime_config());
+ DumpEventToFile(event, dump_file_.get());
+#endif // WEBRTC_AUDIO_NETWORK_ADAPTOR_DEBUG_DUMP
+}
+
+std::unique_ptr<DebugDumpWriter> DebugDumpWriter::Create(FILE* file_handle) {
+ return std::unique_ptr<DebugDumpWriter>(new DebugDumpWriterImpl(file_handle));
+}
+void DebugDumpWriter::ConvertEncoderConfigToDumpEntry(
+ const AudioNetworkAdaptor::EncoderRuntimeConfig& config,
+ audio_network_adaptor::debug_dump::EncoderRuntimeConfig* dump_entry) {
if (config.bitrate_bps)
- dump_config->set_bitrate_bps(*config.bitrate_bps);
+ dump_entry->set_bitrate_bps(*config.bitrate_bps);
if (config.frame_length_ms)
- dump_config->set_frame_length_ms(*config.frame_length_ms);
+ dump_entry->set_frame_length_ms(*config.frame_length_ms);
if (config.uplink_packet_loss_fraction) {
- dump_config->set_uplink_packet_loss_fraction(
+ dump_entry->set_uplink_packet_loss_fraction(
*config.uplink_packet_loss_fraction);
}
if (config.enable_fec)
- dump_config->set_enable_fec(*config.enable_fec);
+ dump_entry->set_enable_fec(*config.enable_fec);
if (config.enable_dtx)
- dump_config->set_enable_dtx(*config.enable_dtx);
+ dump_entry->set_enable_dtx(*config.enable_dtx);
if (config.num_channels)
- dump_config->set_num_channels(*config.num_channels);
-
- DumpEventToFile(event, dump_file_.get());
-#endif // WEBRTC_AUDIO_NETWORK_ADAPTOR_DEBUG_DUMP
-}
-
-std::unique_ptr<DebugDumpWriter> DebugDumpWriter::Create(FILE* file_handle) {
- return std::unique_ptr<DebugDumpWriter>(new DebugDumpWriterImpl(file_handle));
+ dump_entry->set_num_channels(*config.num_channels);
}
} // namespace webrtc

Powered by Google App Engine
This is Rietveld 408576698