From 11093b2ca373b9a3d9845a0bc9098d79ae27f7b3 Mon Sep 17 00:00:00 2001 From: Byoungchan Lee Date: Tue, 30 Aug 2022 11:58:49 +0900 Subject: [PATCH] [PCLF] Add ability to specifiy DegradationPreference Bug: None Change-Id: I5fca1ae70b75b53b54c99a10cdada504146785b6 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/273120 Commit-Queue: Daniel.L (Byoungchan) Lee Reviewed-by: Artem Titov Cr-Commit-Position: refs/heads/main@{#37942} --- api/test/peerconnection_quality_test_fixture.h | 4 ++++ test/pc/e2e/media/media_helper.cc | 15 +++++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/api/test/peerconnection_quality_test_fixture.h b/api/test/peerconnection_quality_test_fixture.h index b5d3f3ce20..b60c3b4285 100644 --- a/api/test/peerconnection_quality_test_fixture.h +++ b/api/test/peerconnection_quality_test_fixture.h @@ -381,6 +381,10 @@ class PeerConnectionE2EQualityTestFixture { // According to bugs.webrtc.org/4762 WebRTC supports synchronization only // for pair of single audio and single video stream. absl::optional sync_group; + // If specified, it will be set into RtpParameters of corresponding + // RtpSenderInterface for this video stream. + // Note that this setting takes precedence over `content_hint`. + absl::optional degradation_preference; }; // Contains properties for audio in the call. diff --git a/test/pc/e2e/media/media_helper.cc b/test/pc/e2e/media/media_helper.cc index 22fcc51ffe..4885a28ad0 100644 --- a/test/pc/e2e/media/media_helper.cc +++ b/test/pc/e2e/media/media_helper.cc @@ -83,11 +83,18 @@ MediaHelper::MaybeAddVideo(TestPeer* peer) { RTCErrorOr> sender = peer->AddTrack(track, {sync_group, *video_config.stream_label}); RTC_CHECK(sender.ok()); - if (video_config.temporal_layers_count) { + if (video_config.temporal_layers_count || + video_config.degradation_preference) { RtpParameters rtp_parameters = sender.value()->GetParameters(); - for (auto& encoding_parameters : rtp_parameters.encodings) { - encoding_parameters.num_temporal_layers = - video_config.temporal_layers_count; + if (video_config.temporal_layers_count) { + for (auto& encoding_parameters : rtp_parameters.encodings) { + encoding_parameters.num_temporal_layers = + video_config.temporal_layers_count; + } + } + if (video_config.degradation_preference) { + rtp_parameters.degradation_preference = + video_config.degradation_preference; } RTCError res = sender.value()->SetParameters(rtp_parameters); RTC_CHECK(res.ok()) << "Failed to set RTP parameters";