From f8518889ba48e25dfb74e04cedcfba5b4d9feb29 Mon Sep 17 00:00:00 2001 From: Sebastian Jansson Date: Thu, 31 May 2018 14:52:59 +0200 Subject: [PATCH] Adds flags for configuring log output from full stack tests. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug: webrtc:8415 Change-Id: I3031974dc3580386de677a7b4d120876d8b89e5a Reviewed-on: https://webrtc-review.googlesource.com/80240 Reviewed-by: Erik SprÃ¥ng Commit-Queue: Sebastian Jansson Cr-Commit-Position: refs/heads/master@{#23491} --- video/BUILD.gn | 1 + video/full_stack_tests.cc | 31 ++++++++++++++++++++++++++++++- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/video/BUILD.gn b/video/BUILD.gn index d18f3342e1..b00ea13425 100644 --- a/video/BUILD.gn +++ b/video/BUILD.gn @@ -188,6 +188,7 @@ if (rtc_include_tests) { deps = [ ":video_quality_test", "../modules/pacing:pacing", + "../rtc_base:rtc_base_approved", "../rtc_base/experiments:alr_experiment", "../test:field_trial", "../test:test_common", diff --git a/video/full_stack_tests.cc b/video/full_stack_tests.cc index 2317020c58..61346a9e3f 100644 --- a/video/full_stack_tests.cc +++ b/video/full_stack_tests.cc @@ -10,10 +10,37 @@ #include #include "rtc_base/experiments/alr_experiment.h" +#include "rtc_base/flags.h" #include "test/field_trial.h" #include "test/gtest.h" #include "video/video_quality_test.h" +namespace webrtc { +namespace flags { + +DEFINE_bool(logs, false, "print logs to stderr"); + +DEFINE_string(rtc_event_log_name, + "", + "Filename for rtc event log. Two files " + "with \"_send\" and \"_recv\" suffixes will be created."); +std::string RtcEventLogName() { + return static_cast(FLAG_rtc_event_log_name); +} +DEFINE_string(rtp_dump_name, "", "Filename for dumped received RTP stream."); +std::string RtpDumpName() { + return static_cast(FLAG_rtp_dump_name); +} +DEFINE_string(encoded_frame_path, + "", + "The base path for encoded frame logs. Created files will have " + "the form ..(recv|send.).ivf"); +std::string EncodedFramePath() { + return static_cast(FLAG_encoded_frame_path); +} +} // namespace flags +} // namespace webrtc + namespace webrtc { namespace { @@ -22,7 +49,9 @@ static const int kFullStackTestDurationSecs = 45; class FullStackTest : public VideoQualityTest { public: - void RunTest(const VideoQualityTest::Params ¶ms) { + void RunTest(VideoQualityTest::Params params) { + params.logging = {flags::FLAG_logs, flags::RtcEventLogName(), + flags::RtpDumpName(), flags::EncodedFramePath()}; RunWithAnalyzer(params); }