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 <philipel@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38279}
This commit is contained in:
philipel 2022-10-03 14:54:09 +02:00 committed by WebRTC LUCI CQ
parent 22d32f1a6c
commit 525891a778
2 changed files with 14 additions and 3 deletions

View File

@ -247,6 +247,7 @@ if (!is_component_build) {
testonly = true testonly = true
sources = [ "video_replay.cc" ] sources = [ "video_replay.cc" ]
deps = [ deps = [
"../api:field_trials",
"../api/rtc_event_log", "../api/rtc_event_log",
"../api/task_queue:default_task_queue_factory", "../api/task_queue:default_task_queue_factory",
"../api/test/video:function_video_factory", "../api/test/video:function_video_factory",

View File

@ -16,6 +16,7 @@
#include "absl/flags/flag.h" #include "absl/flags/flag.h"
#include "absl/flags/parse.h" #include "absl/flags/parse.h"
#include "api/field_trials.h"
#include "api/rtc_event_log/rtc_event_log.h" #include "api/rtc_event_log/rtc_event_log.h"
#include "api/task_queue/default_task_queue_factory.h" #include "api/task_queue/default_task_queue_factory.h"
#include "api/test/video/function_video_decoder_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_width, 640, "Width of render window");
ABSL_FLAG(uint32_t, render_height, 480, "Height 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 { namespace {
bool ValidatePayloadType(int32_t payload_type) { bool ValidatePayloadType(int32_t payload_type) {
return payload_type > 0 && payload_type <= 127; return payload_type > 0 && payload_type <= 127;
@ -579,9 +589,9 @@ class RtpReplayer final {
}; };
void RtpReplay() { void RtpReplay() {
RtpReplayer replayer(absl::GetFlag(FLAGS_config_file), RtpReplayer replayer(
absl::GetFlag(FLAGS_input_file), absl::GetFlag(FLAGS_config_file), absl::GetFlag(FLAGS_input_file),
std::make_unique<FieldTrialBasedConfig>()); std::make_unique<FieldTrials>(absl::GetFlag(FLAGS_force_fieldtrials)));
replayer.Run(); replayer.Run();
} }