summaryrefslogtreecommitdiffstats
path: root/third_party/libwebrtc/test/peer_scenario/peer_scenario_client.cc
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/libwebrtc/test/peer_scenario/peer_scenario_client.cc')
-rw-r--r--third_party/libwebrtc/test/peer_scenario/peer_scenario_client.cc12
1 files changed, 10 insertions, 2 deletions
diff --git a/third_party/libwebrtc/test/peer_scenario/peer_scenario_client.cc b/third_party/libwebrtc/test/peer_scenario/peer_scenario_client.cc
index 1397b32fe3..3ba4fdb677 100644
--- a/third_party/libwebrtc/test/peer_scenario/peer_scenario_client.cc
+++ b/third_party/libwebrtc/test/peer_scenario/peer_scenario_client.cc
@@ -370,10 +370,13 @@ void PeerScenarioClient::CreateAndSetSdp(
void PeerScenarioClient::SetSdpOfferAndGetAnswer(
std::string remote_offer,
+ std::function<void()> remote_description_set,
std::function<void(std::string)> answer_handler) {
if (!signaling_thread_->IsCurrent()) {
- signaling_thread_->PostTask(
- [=] { SetSdpOfferAndGetAnswer(remote_offer, answer_handler); });
+ signaling_thread_->PostTask([=] {
+ SetSdpOfferAndGetAnswer(remote_offer, remote_description_set,
+ answer_handler);
+ });
return;
}
RTC_DCHECK_RUN_ON(signaling_thread_);
@@ -381,6 +384,11 @@ void PeerScenarioClient::SetSdpOfferAndGetAnswer(
CreateSessionDescription(SdpType::kOffer, remote_offer),
rtc::make_ref_counted<LambdaSetRemoteDescriptionObserver>([=](RTCError) {
RTC_DCHECK_RUN_ON(signaling_thread_);
+ if (remote_description_set) {
+ // Allow the caller to modify transceivers
+ // before creating the answer.
+ remote_description_set();
+ }
peer_connection_->CreateAnswer(
rtc::make_ref_counted<LambdaCreateSessionDescriptionObserver>(
[=](std::unique_ptr<SessionDescriptionInterface> answer) {