Update screenshare_loopback to support test duration and test clip

Setting the test duration parameter is a bug fix.

The addition of test clip parameter is a new feature for screenshare_loopback, although this already exists for video_loopback.

Bug: None
Change-Id: I7c307b07df9896456a1372fcd22cb13a25e2ca34
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/347640
Commit-Queue: Johannes Kron <kron@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42084}
This commit is contained in:
Johannes Kron 2024-04-16 12:08:11 +02:00 committed by WebRTC LUCI CQ
parent c29ff41fe9
commit 525df59762
3 changed files with 15 additions and 1 deletions

View File

@ -257,6 +257,14 @@ ABSL_FLAG(bool, generic_descriptor, false, "Use the generic frame descriptor.");
ABSL_FLAG(bool, allow_reordering, false, "Allow packet reordering to occur");
ABSL_FLAG(std::string,
clip,
"",
"Name of the clip to show. If empty, use frame generator.");
std::string Clip() {
return absl::GetFlag(FLAGS_clip);
}
// Screenshare-specific flags.
ABSL_FLAG(int,
min_transmit_bitrate,
@ -331,11 +339,14 @@ void Loopback() {
params.video[0].num_temporal_layers = NumTemporalLayers();
params.video[0].selected_tl = SelectedTL();
params.video[0].min_transmit_bps = MinTransmitBitrateKbps() * 1000;
params.video[0].clip_path = Clip();
params.screenshare[0].enabled = true;
params.screenshare[0].generate_slides = GenerateSlides();
params.screenshare[0].slide_change_interval = SlideChangeInterval();
params.screenshare[0].scroll_duration = ScrollDuration();
params.screenshare[0].slides = Slides();
params.analyzer.test_label = "screenshare";
params.analyzer.test_durations_secs = DurationSecs();
params.config = pipe_config;
params.logging.rtc_event_log_name = RtcEventLogName();
params.logging.rtp_dump_name = RtpDumpName();

View File

@ -200,7 +200,6 @@ ABSL_FLAG(bool,
ABSL_FLAG(bool, video, true, "Add video stream");
// Video-specific flags.
ABSL_FLAG(std::string,
clip,
"",

View File

@ -1045,6 +1045,10 @@ VideoQualityTest::CreateFrameGenerator(size_t video_idx) {
kWidth, kHeight,
params_.screenshare[video_idx].slide_change_interval *
params_.video[video_idx].fps);
} else if (!params_.video[video_idx].clip_path.empty()) {
frame_generator = test::CreateFromYuvFileFrameGenerator(
{params_.video[video_idx].clip_path}, params_.video[video_idx].width,
params_.video[video_idx].height, 1);
} else {
std::vector<std::string> slides = params_.screenshare[video_idx].slides;
if (slides.empty()) {