[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 <daniel.l@hpcnt.com>
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37942}
This commit is contained in:
Byoungchan Lee 2022-08-30 11:58:49 +09:00 committed by WebRTC LUCI CQ
parent 021512b76a
commit 11093b2ca3
2 changed files with 15 additions and 4 deletions

View File

@ -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<std::string> 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<DegradationPreference> degradation_preference;
};
// Contains properties for audio in the call.

View File

@ -83,11 +83,18 @@ MediaHelper::MaybeAddVideo(TestPeer* peer) {
RTCErrorOr<rtc::scoped_refptr<RtpSenderInterface>> 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";