From bb25641dd9691a407b95b5e1416044c7c03e004c Mon Sep 17 00:00:00 2001 From: Artem Titov Date: Fri, 13 Jan 2023 11:54:29 +0100 Subject: [PATCH] [PCLF] Add an API to add extra audio/video RTP header extensions Bug: None Change-Id: Ieee29419bc13efe1891c2ceda8a919c031cd4a58 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/290897 Commit-Queue: Artem Titov Reviewed-by: Alessio Bazzica Reviewed-by: Mirko Bonadei Cr-Commit-Position: refs/heads/main@{#39100} --- api/test/pclf/media_quality_test_params.h | 7 +++++++ api/test/pclf/peer_configurer.cc | 20 +++++++++++++++----- api/test/pclf/peer_configurer.h | 12 ++++++++++-- 3 files changed, 32 insertions(+), 7 deletions(-) diff --git a/api/test/pclf/media_quality_test_params.h b/api/test/pclf/media_quality_test_params.h index 65ca1c5cb7..3377d31f68 100644 --- a/api/test/pclf/media_quality_test_params.h +++ b/api/test/pclf/media_quality_test_params.h @@ -143,6 +143,13 @@ struct Params { PeerConnectionInterface::RTCOfferAnswerOptions rtc_offer_answer_options; BitrateSettings bitrate_settings; std::vector video_codecs; + + // A list of RTP header extensions which will be enforced on all video streams + // added to this peer. + std::vector extra_video_rtp_header_extensions; + // A list of RTP header extensions which will be enforced on all audio streams + // added to this peer. + std::vector extra_audio_rtp_header_extensions; }; // Contains parameters that maybe changed by test writer during the test call. diff --git a/api/test/pclf/peer_configurer.cc b/api/test/pclf/peer_configurer.cc index ead1b5db06..2203a4c4f0 100644 --- a/api/test/pclf/peer_configurer.cc +++ b/api/test/pclf/peer_configurer.cc @@ -119,10 +119,25 @@ PeerConfigurer* PeerConfigurer::SetVideoSubscription( configurable_params_->video_subscription = std::move(subscription); return this; } +PeerConfigurer* PeerConfigurer::SetVideoCodecs( + std::vector video_codecs) { + params_->video_codecs = std::move(video_codecs); + return this; +} +PeerConfigurer* PeerConfigurer::SetExtraVideoRtpHeaderExtensions( + std::vector extensions) { + params_->extra_video_rtp_header_extensions = std::move(extensions); + return this; +} PeerConfigurer* PeerConfigurer::SetAudioConfig(AudioConfig config) { params_->audio_config = std::move(config); return this; } +PeerConfigurer* PeerConfigurer::SetExtraAudioRtpHeaderExtensions( + std::vector extensions) { + params_->extra_audio_rtp_header_extensions = std::move(extensions); + return this; +} PeerConfigurer* PeerConfigurer::SetUseUlpFEC(bool value) { params_->use_ulp_fec = value; return this; @@ -180,11 +195,6 @@ PeerConfigurer* PeerConfigurer::SetBitrateSettings( params_->bitrate_settings = bitrate_settings; return this; } -PeerConfigurer* PeerConfigurer::SetVideoCodecs( - std::vector video_codecs) { - params_->video_codecs = std::move(video_codecs); - return this; -} PeerConfigurer* PeerConfigurer::SetIceTransportFactory( std::unique_ptr factory) { diff --git a/api/test/pclf/peer_configurer.h b/api/test/pclf/peer_configurer.h index 7841a261b3..996dc5cd89 100644 --- a/api/test/pclf/peer_configurer.h +++ b/api/test/pclf/peer_configurer.h @@ -113,16 +113,24 @@ class PeerConfigurer { // include all streams with `VideoSubscription::kSameAsSendStream` // resolution. To this behavior use this method. PeerConfigurer* SetVideoSubscription(VideoSubscription subscription); - // Set the list of video codecs used by the peer during the test. These + // Sets the list of video codecs used by the peer during the test. These // codecs will be negotiated in SDP during offer/answer exchange. The order // of these codecs during negotiation will be the same as in `video_codecs`. // Codecs have to be available in codecs list provided by peer connection to // be negotiated. If some of specified codecs won't be found, the test will // crash. PeerConfigurer* SetVideoCodecs(std::vector video_codecs); - // Set the audio stream for the call from this peer. If this method won't + // Sets a list of RTP header extensions which will be enforced on all video + // streams added to this peer. + PeerConfigurer* SetExtraVideoRtpHeaderExtensions( + std::vector extensions); + // Sets the audio stream for the call from this peer. If this method won't // be invoked, this peer will send no audio. PeerConfigurer* SetAudioConfig(AudioConfig config); + // Sets a list of RTP header extensions which will be enforced on all audio + // streams added to this peer. + PeerConfigurer* SetExtraAudioRtpHeaderExtensions( + std::vector extensions); // Set if ULP FEC should be used or not. False by default. PeerConfigurer* SetUseUlpFEC(bool value);