diff --git a/api/test/pclf/media_configuration.cc b/api/test/pclf/media_configuration.cc index 56b9e52e01..4446e11400 100644 --- a/api/test/pclf/media_configuration.cc +++ b/api/test/pclf/media_configuration.cc @@ -27,7 +27,7 @@ namespace webrtc { namespace webrtc_pc_e2e { namespace { -std::string SpecToString(VideoResolution::Spec spec) { +absl::string_view SpecToString(VideoResolution::Spec spec) { switch (spec) { case VideoResolution::Spec::kNone: return "None"; @@ -207,24 +207,22 @@ VideoConfig::VideoConfig(const VideoResolution& resolution) } VideoConfig::VideoConfig(size_t width, size_t height, int32_t fps) : width(width), height(height), fps(fps) {} -VideoConfig::VideoConfig(std::string stream_label, +VideoConfig::VideoConfig(absl::string_view stream_label, size_t width, size_t height, int32_t fps) - : width(width), - height(height), - fps(fps), - stream_label(std::move(stream_label)) {} + : width(width), height(height), fps(fps), stream_label(stream_label) {} -AudioConfig::AudioConfig(std::string stream_label) - : stream_label(std::move(stream_label)) {} +AudioConfig::AudioConfig(absl::string_view stream_label) + : stream_label(stream_label) {} + +VideoCodecConfig::VideoCodecConfig(absl::string_view name) + : name(name), required_params() {} -VideoCodecConfig::VideoCodecConfig(std::string name) - : name(std::move(name)), required_params() {} VideoCodecConfig::VideoCodecConfig( - std::string name, + absl::string_view name, std::map required_params) - : name(std::move(name)), required_params(std::move(required_params)) {} + : name(name), required_params(std::move(required_params)) {} absl::optional VideoSubscription::GetMaxResolution( rtc::ArrayView video_configs) { diff --git a/api/test/pclf/media_configuration.h b/api/test/pclf/media_configuration.h index 8e841a265b..718a7b1723 100644 --- a/api/test/pclf/media_configuration.h +++ b/api/test/pclf/media_configuration.h @@ -306,7 +306,7 @@ class VideoDumpOptions { struct VideoConfig { explicit VideoConfig(const VideoResolution& resolution); VideoConfig(size_t width, size_t height, int32_t fps); - VideoConfig(std::string stream_label, + VideoConfig(absl::string_view stream_label, size_t width, size_t height, int32_t fps); @@ -381,7 +381,7 @@ struct AudioConfig { }; AudioConfig() = default; - explicit AudioConfig(std::string stream_label); + explicit AudioConfig(absl::string_view stream_label); // Have to be unique among all specified configs for all peers in the call. // Will be auto generated if omitted. @@ -405,8 +405,8 @@ struct AudioConfig { }; struct VideoCodecConfig { - explicit VideoCodecConfig(std::string name); - VideoCodecConfig(std::string name, + explicit VideoCodecConfig(absl::string_view name); + VideoCodecConfig(absl::string_view name, std::map required_params); // Next two fields are used to specify concrete video codec, that should be // used in the test. Video code will be negotiated in SDP during offer/ diff --git a/api/test/pclf/peer_configurer.cc b/api/test/pclf/peer_configurer.cc index de7600efc1..7acaddadda 100644 --- a/api/test/pclf/peer_configurer.cc +++ b/api/test/pclf/peer_configurer.cc @@ -181,12 +181,12 @@ PeerConfigurer* PeerConfigurer::SetUseNetworkThreadAsWorkerThread() { return this; } -PeerConfigurer* PeerConfigurer::SetRtcEventLogPath(std::string path) { - params_->rtc_event_log_path = std::move(path); +PeerConfigurer* PeerConfigurer::SetRtcEventLogPath(absl::string_view path) { + params_->rtc_event_log_path = std::string(path); return this; } -PeerConfigurer* PeerConfigurer::SetAecDumpPath(std::string path) { - params_->aec_dump_path = std::move(path); +PeerConfigurer* PeerConfigurer::SetAecDumpPath(absl::string_view path) { + params_->aec_dump_path = std::string(path); return this; } PeerConfigurer* PeerConfigurer::SetRTCConfiguration( diff --git a/api/test/pclf/peer_configurer.h b/api/test/pclf/peer_configurer.h index 10f37a1eec..3596bb67ab 100644 --- a/api/test/pclf/peer_configurer.h +++ b/api/test/pclf/peer_configurer.h @@ -152,10 +152,10 @@ class PeerConfigurer { // If is set, an RTCEventLog will be saved in that location and it will be // available for further analysis. - PeerConfigurer* SetRtcEventLogPath(std::string path); + PeerConfigurer* SetRtcEventLogPath(absl::string_view path); // If is set, an AEC dump will be saved in that location and it will be // available for further analysis. - PeerConfigurer* SetAecDumpPath(std::string path); + PeerConfigurer* SetAecDumpPath(absl::string_view path); PeerConfigurer* SetRTCConfiguration( PeerConnectionInterface::RTCConfiguration configuration); PeerConfigurer* SetRTCOfferAnswerOptions( diff --git a/pc/test/svc_e2e_tests.cc b/pc/test/svc_e2e_tests.cc index dea0763758..9e911a9dba 100644 --- a/pc/test/svc_e2e_tests.cc +++ b/pc/test/svc_e2e_tests.cc @@ -128,7 +128,7 @@ class SvcTest : public testing::TestWithParam< {{kVP9FmtpProfileId, VP9ProfileToString(VP9Profile::kProfile0)}}); } - return VideoCodecConfig(std::string(codec)); + return VideoCodecConfig(codec); } const SvcTestParameters& SvcTestParameters() const {