From 3c31ee0793e2e4dde0e3944c994f404109a810ea Mon Sep 17 00:00:00 2001 From: Artem Titov Date: Fri, 9 Apr 2021 12:17:53 +0200 Subject: [PATCH] Reduce logging for PC supported codecs in PC level tests Bug: None Change-Id: I78db2d129c277c11375d8903d3127944ff832fec Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/214760 Commit-Queue: Tommi Reviewed-by: Tommi Cr-Commit-Position: refs/heads/master@{#33669} --- test/pc/e2e/sdp/sdp_changer.cc | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/test/pc/e2e/sdp/sdp_changer.cc b/test/pc/e2e/sdp/sdp_changer.cc index ac0c46ae3c..b46aea1c5f 100644 --- a/test/pc/e2e/sdp/sdp_changer.cc +++ b/test/pc/e2e/sdp/sdp_changer.cc @@ -34,6 +34,23 @@ std::string CodecRequiredParamsToString( return out.str(); } +std::string SupportedCodecsToString( + rtc::ArrayView supported_codecs) { + rtc::StringBuilder out; + for (const auto& codec : supported_codecs) { + out << codec.name; + if (!codec.parameters.empty()) { + out << "("; + for (const auto& param : codec.parameters) { + out << param.first << "=" << param.second << ";"; + } + out << ")"; + } + out << "; "; + } + return out.str(); +} + } // namespace std::vector FilterVideoCodecCapabilities( @@ -42,16 +59,6 @@ std::vector FilterVideoCodecCapabilities( bool use_ulpfec, bool use_flexfec, rtc::ArrayView supported_codecs) { - RTC_LOG(INFO) << "Peer connection support these codecs:"; - for (const auto& codec : supported_codecs) { - RTC_LOG(INFO) << "Codec: " << codec.name; - if (!codec.parameters.empty()) { - RTC_LOG(INFO) << "Params:"; - for (const auto& param : codec.parameters) { - RTC_LOG(INFO) << " " << param.first << "=" << param.second; - } - } - } std::vector output_codecs; // Find requested codecs among supported and add them to output in the order // they were requested. @@ -80,7 +87,8 @@ std::vector FilterVideoCodecCapabilities( RTC_CHECK_GT(output_codecs.size(), size_before) << "Codec with name=" << codec_request.name << " and params {" << CodecRequiredParamsToString(codec_request.required_params) - << "} is unsupported for this peer connection"; + << "} is unsupported for this peer connection. Supported codecs are: " + << SupportedCodecsToString(supported_codecs); } // Add required FEC and RTX codecs to output.