Cleanup names and extra checks for errors in PC test framework

Bug: webrtc:10138
Change-Id: I5585f30e941cf9914028a0040388a02778ab46c6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/141672
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28282}
This commit is contained in:
Artem Titov 2019-06-13 19:45:55 +02:00 committed by Commit Bot
parent 12d64deb6c
commit 7f2a67f8ce
3 changed files with 22 additions and 12 deletions

View File

@ -602,8 +602,10 @@ void PeerConnectionE2EQualityTest::SetupCallOnSignalingThread(
// Setup receive audio transceiver if Bob has audio to send. If we'll need
// multiple audio streams, then we need transceiver for each Bob's audio
// stream.
alice_->AddTransceiver(cricket::MediaType::MEDIA_TYPE_AUDIO,
receive_only_transceiver_init);
RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>> result =
alice_->AddTransceiver(cricket::MediaType::MEDIA_TYPE_AUDIO,
receive_only_transceiver_init);
RTC_CHECK(result.ok());
alice_transceivers_counter++;
}
@ -619,14 +621,18 @@ void PeerConnectionE2EQualityTest::SetupCallOnSignalingThread(
std::to_string(i);
transceiver_params.send_encodings.push_back(enc_params);
}
alice_->AddTransceiver(cricket::MediaType::MEDIA_TYPE_VIDEO,
transceiver_params);
RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>> result =
alice_->AddTransceiver(cricket::MediaType::MEDIA_TYPE_VIDEO,
transceiver_params);
RTC_CHECK(result.ok());
alice_transceivers_counter++;
}
}
for (size_t i = 0; i < bob_->params()->video_configs.size(); ++i) {
alice_->AddTransceiver(cricket::MediaType::MEDIA_TYPE_VIDEO,
receive_only_transceiver_init);
RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>> result =
alice_->AddTransceiver(cricket::MediaType::MEDIA_TYPE_VIDEO,
receive_only_transceiver_init);
RTC_CHECK(result.ok());
alice_transceivers_counter++;
}
// Then add media for Alice and Bob
@ -781,14 +787,14 @@ void PeerConnectionE2EQualityTest::SetPeerCodecPreferences(
TestPeer* peer,
const RunParams& run_params) {
std::vector<RtpCodecCapability> with_rtx_video_capabilities =
FilterCodecCapabilities(
FilterVideoCodecCapabilities(
run_params.video_codec_name, run_params.video_codec_required_params,
true, run_params.use_ulp_fec, run_params.use_flex_fec,
peer->pc_factory()
->GetRtpSenderCapabilities(cricket::MediaType::MEDIA_TYPE_VIDEO)
.codecs);
std::vector<RtpCodecCapability> without_rtx_video_capabilities =
FilterCodecCapabilities(
FilterVideoCodecCapabilities(
run_params.video_codec_name, run_params.video_codec_required_params,
false, run_params.use_ulp_fec, run_params.use_flex_fec,
peer->pc_factory()
@ -801,9 +807,13 @@ void PeerConnectionE2EQualityTest::SetPeerCodecPreferences(
if (transceiver->sender()->init_send_encodings().size() > 1) {
// If transceiver's sender has more then 1 send encodings, it means it
// has multiple simulcast streams, so we need disable RTX on it.
transceiver->SetCodecPreferences(without_rtx_video_capabilities);
RTCError result =
transceiver->SetCodecPreferences(without_rtx_video_capabilities);
RTC_CHECK(result.ok());
} else {
transceiver->SetCodecPreferences(with_rtx_video_capabilities);
RTCError result =
transceiver->SetCodecPreferences(with_rtx_video_capabilities);
RTC_CHECK(result.ok());
}
}
}

View File

@ -34,7 +34,7 @@ std::string CodecRequiredParamsToString(
} // namespace
std::vector<RtpCodecCapability> FilterCodecCapabilities(
std::vector<RtpCodecCapability> FilterVideoCodecCapabilities(
absl::string_view codec_name,
const std::map<std::string, std::string>& codec_required_params,
bool use_rtx,

View File

@ -39,7 +39,7 @@ namespace webrtc_pc_e2e {
// and |codec_required_params|, then all of them will be added to the output
// vector and they will be added in the same order, as they were in
// |supported_codecs|.
std::vector<RtpCodecCapability> FilterCodecCapabilities(
std::vector<RtpCodecCapability> FilterVideoCodecCapabilities(
absl::string_view codec_name,
const std::map<std::string, std::string>& codec_required_params,
bool use_rtx,