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";