From 525891a7788ab898f0cb1c920596b790721dda28 Mon Sep 17 00:00:00 2001 From: philipel Date: Mon, 3 Oct 2022 14:54:09 +0200 Subject: [PATCH] Add --force_fieldtrials flag to video_replay. Bug: webrtc:14508 Change-Id: I006d87f6200b965583d6d05c0bd88aab2a99e6ed Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/277761 Commit-Queue: Philip Eliasson Reviewed-by: Mirko Bonadei Cr-Commit-Position: refs/heads/main@{#38279} --- rtc_tools/BUILD.gn | 1 + rtc_tools/video_replay.cc | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/rtc_tools/BUILD.gn b/rtc_tools/BUILD.gn index 9e6dd0f91e..6b03c1335d 100644 --- a/rtc_tools/BUILD.gn +++ b/rtc_tools/BUILD.gn @@ -247,6 +247,7 @@ if (!is_component_build) { testonly = true sources = [ "video_replay.cc" ] deps = [ + "../api:field_trials", "../api/rtc_event_log", "../api/task_queue:default_task_queue_factory", "../api/test/video:function_video_factory", diff --git a/rtc_tools/video_replay.cc b/rtc_tools/video_replay.cc index 956f6d9400..ff90a151a3 100644 --- a/rtc_tools/video_replay.cc +++ b/rtc_tools/video_replay.cc @@ -16,6 +16,7 @@ #include "absl/flags/flag.h" #include "absl/flags/parse.h" +#include "api/field_trials.h" #include "api/rtc_event_log/rtc_event_log.h" #include "api/task_queue/default_task_queue_factory.h" #include "api/test/video/function_video_decoder_factory.h" @@ -142,6 +143,15 @@ ABSL_FLAG(uint32_t, ABSL_FLAG(uint32_t, render_width, 640, "Width of render window"); ABSL_FLAG(uint32_t, render_height, 480, "Height of render window"); +ABSL_FLAG( + std::string, + force_fieldtrials, + "", + "Field trials control experimental feature code which can be forced. " + "E.g. running with --force_fieldtrials=WebRTC-FooFeature/Enabled/" + " will assign the group Enable to field trial WebRTC-FooFeature. Multiple " + "trials are separated by \"/\""); + namespace { bool ValidatePayloadType(int32_t payload_type) { return payload_type > 0 && payload_type <= 127; @@ -579,9 +589,9 @@ class RtpReplayer final { }; void RtpReplay() { - RtpReplayer replayer(absl::GetFlag(FLAGS_config_file), - absl::GetFlag(FLAGS_input_file), - std::make_unique()); + RtpReplayer replayer( + absl::GetFlag(FLAGS_config_file), absl::GetFlag(FLAGS_input_file), + std::make_unique(absl::GetFlag(FLAGS_force_fieldtrials))); replayer.Run(); }