summaryrefslogtreecommitdiffstats
path: root/third_party/libwebrtc/test/peer_scenario
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/libwebrtc/test/peer_scenario')
-rw-r--r--third_party/libwebrtc/test/peer_scenario/peer_scenario_client.cc24
-rw-r--r--third_party/libwebrtc/test/peer_scenario/scenario_connection.cc20
2 files changed, 15 insertions, 29 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 697bf055a7..60f2ea7f2e 100644
--- a/third_party/libwebrtc/test/peer_scenario/peer_scenario_client.cc
+++ b/third_party/libwebrtc/test/peer_scenario/peer_scenario_client.cc
@@ -246,17 +246,13 @@ PeerScenarioClient::PeerScenarioClient(
pcf_deps.network_thread = manager->network_thread();
pcf_deps.signaling_thread = signaling_thread_;
pcf_deps.worker_thread = worker_thread_.get();
- pcf_deps.call_factory =
- CreateTimeControllerBasedCallFactory(net->time_controller());
pcf_deps.task_queue_factory =
net->time_controller()->CreateTaskQueueFactory();
pcf_deps.event_log_factory =
std::make_unique<RtcEventLogFactory>(task_queue_factory_);
pcf_deps.trials = std::make_unique<FieldTrialBasedConfig>();
- cricket::MediaEngineDependencies media_deps;
- media_deps.task_queue_factory = task_queue_factory_;
- media_deps.adm = TestAudioDeviceModule::Create(
+ pcf_deps.adm = TestAudioDeviceModule::Create(
task_queue_factory_,
TestAudioDeviceModule::CreatePulsedNoiseCapturer(
config.audio.pulsed_noise->amplitude *
@@ -264,28 +260,24 @@ PeerScenarioClient::PeerScenarioClient(
config.audio.sample_rate, config.audio.channels),
TestAudioDeviceModule::CreateDiscardRenderer(config.audio.sample_rate));
- media_deps.audio_processing = AudioProcessingBuilder().Create();
if (config.video.use_fake_codecs) {
- media_deps.video_encoder_factory =
- std::make_unique<FakeVideoEncoderFactory>(
- net->time_controller()->GetClock());
- media_deps.video_decoder_factory =
+ pcf_deps.video_encoder_factory = std::make_unique<FakeVideoEncoderFactory>(
+ net->time_controller()->GetClock());
+ pcf_deps.video_decoder_factory =
std::make_unique<FakeVideoDecoderFactory>();
} else {
- media_deps.video_encoder_factory =
+ pcf_deps.video_encoder_factory =
std::make_unique<VideoEncoderFactoryTemplate<
LibvpxVp8EncoderTemplateAdapter, LibvpxVp9EncoderTemplateAdapter,
OpenH264EncoderTemplateAdapter, LibaomAv1EncoderTemplateAdapter>>();
- media_deps.video_decoder_factory =
+ pcf_deps.video_decoder_factory =
std::make_unique<VideoDecoderFactoryTemplate<
LibvpxVp8DecoderTemplateAdapter, LibvpxVp9DecoderTemplateAdapter,
OpenH264DecoderTemplateAdapter, Dav1dDecoderTemplateAdapter>>();
}
- media_deps.audio_encoder_factory = CreateBuiltinAudioEncoderFactory();
- media_deps.audio_decoder_factory = CreateBuiltinAudioDecoderFactory();
- media_deps.trials = pcf_deps.trials.get();
- pcf_deps.media_engine = cricket::CreateMediaEngine(std::move(media_deps));
+ EnableMediaWithDefaultsAndTimeController(*net->time_controller(), pcf_deps);
+
pcf_deps.fec_controller_factory = nullptr;
pcf_deps.network_controller_factory = nullptr;
pcf_deps.network_state_predictor_factory = nullptr;
diff --git a/third_party/libwebrtc/test/peer_scenario/scenario_connection.cc b/third_party/libwebrtc/test/peer_scenario/scenario_connection.cc
index 66eca275d1..8b2081a4c3 100644
--- a/third_party/libwebrtc/test/peer_scenario/scenario_connection.cc
+++ b/third_party/libwebrtc/test/peer_scenario/scenario_connection.cc
@@ -173,21 +173,14 @@ void ScenarioIceConnectionImpl::SetRemoteSdp(SdpType type,
});
auto res = jsep_controller_->SetRemoteDescription(
- remote_description_->GetType(), remote_description_->description());
+ remote_description_->GetType(),
+ local_description_ ? local_description_->description() : nullptr,
+ remote_description_->description());
RTC_CHECK(res.ok()) << res.message();
RtpDemuxerCriteria criteria;
for (const auto& content : remote_description_->description()->contents()) {
- if (content.media_description()->as_audio()) {
- for (const auto& codec :
- content.media_description()->as_audio()->codecs()) {
- criteria.payload_types().insert(codec.id);
- }
- }
- if (content.media_description()->as_video()) {
- for (const auto& codec :
- content.media_description()->as_video()->codecs()) {
- criteria.payload_types().insert(codec.id);
- }
+ for (const auto& codec : content.media_description()->codecs()) {
+ criteria.payload_types().insert(codec.id);
}
}
@@ -203,7 +196,8 @@ void ScenarioIceConnectionImpl::SetLocalSdp(SdpType type,
RTC_DCHECK_RUN_ON(signaling_thread_);
local_description_ = webrtc::CreateSessionDescription(type, local_sdp);
auto res = jsep_controller_->SetLocalDescription(
- local_description_->GetType(), local_description_->description());
+ local_description_->GetType(), local_description_->description(),
+ remote_description_ ? remote_description_->description() : nullptr);
RTC_CHECK(res.ok()) << res.message();
jsep_controller_->MaybeStartGathering();
}