Enables PeerConnectionFactory using external fec controller
Bug: webrtc:8799 Change-Id: Ieb2cf6163b9a83844ab9ed4822b4a7f1db4c24b8 Reviewed-on: https://webrtc-review.googlesource.com/43961 Commit-Queue: Ying Wang <yinwa@webrtc.org> Reviewed-by: Stefan Holmer <stefan@webrtc.org> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> Reviewed-by: Niels Moller <nisse@webrtc.org> Reviewed-by: Sami Kalliomäki <sakal@webrtc.org> Cr-Commit-Position: refs/heads/master@{#22038}
This commit is contained in:
24
call/call.cc
24
call/call.cc
@ -407,6 +407,9 @@ Call* Call::Create(
|
||||
return new internal::Call(config, std::move(transport_send));
|
||||
}
|
||||
|
||||
// This method here to avoid subclasses has to implement this method.
|
||||
// Call perf test will use Internal::Call::CreateVideoSendStream() to inject
|
||||
// FecController.
|
||||
VideoSendStream* Call::CreateVideoSendStream(
|
||||
VideoSendStream::Config config,
|
||||
VideoEncoderConfig encoder_config,
|
||||
@ -723,14 +726,7 @@ void Call::DestroyAudioReceiveStream(
|
||||
delete audio_receive_stream;
|
||||
}
|
||||
|
||||
webrtc::VideoSendStream* Call::CreateVideoSendStream(
|
||||
webrtc::VideoSendStream::Config config,
|
||||
VideoEncoderConfig encoder_config) {
|
||||
return CreateVideoSendStream(
|
||||
std::move(config), std::move(encoder_config),
|
||||
rtc::MakeUnique<FecControllerDefault>(Clock::GetRealTimeClock()));
|
||||
}
|
||||
|
||||
// This method can be used for Call tests with external fec controller factory.
|
||||
webrtc::VideoSendStream* Call::CreateVideoSendStream(
|
||||
webrtc::VideoSendStream::Config config,
|
||||
VideoEncoderConfig encoder_config,
|
||||
@ -749,6 +745,7 @@ webrtc::VideoSendStream* Call::CreateVideoSendStream(
|
||||
// the call has already started.
|
||||
// Copy ssrcs from |config| since |config| is moved.
|
||||
std::vector<uint32_t> ssrcs = config.rtp.ssrcs;
|
||||
|
||||
VideoSendStream* send_stream = new VideoSendStream(
|
||||
num_cpu_cores_, module_process_thread_.get(), &worker_queue_,
|
||||
call_stats_.get(), transport_send_.get(), bitrate_allocator_.get(),
|
||||
@ -770,6 +767,17 @@ webrtc::VideoSendStream* Call::CreateVideoSendStream(
|
||||
return send_stream;
|
||||
}
|
||||
|
||||
webrtc::VideoSendStream* Call::CreateVideoSendStream(
|
||||
webrtc::VideoSendStream::Config config,
|
||||
VideoEncoderConfig encoder_config) {
|
||||
std::unique_ptr<FecController> fec_controller =
|
||||
config_.fec_controller_factory
|
||||
? config_.fec_controller_factory->CreateFecController()
|
||||
: rtc::MakeUnique<FecControllerDefault>(Clock::GetRealTimeClock());
|
||||
return CreateVideoSendStream(std::move(config), std::move(encoder_config),
|
||||
std::move(fec_controller));
|
||||
}
|
||||
|
||||
void Call::DestroyVideoSendStream(webrtc::VideoSendStream* send_stream) {
|
||||
TRACE_EVENT0("webrtc", "Call::DestroyVideoSendStream");
|
||||
RTC_DCHECK(send_stream != nullptr);
|
||||
|
||||
Reference in New Issue
Block a user