diff --git a/src/fake_network_call_factory.cpp b/src/fake_network_call_factory.cpp index cd93049..7be664e 100644 --- a/src/fake_network_call_factory.cpp +++ b/src/fake_network_call_factory.cpp @@ -16,8 +16,8 @@ FakeNetworkCallFactory::FakeNetworkCallFactory( const webrtc::DegradedCall::TimeScopedNetworkConfig& receive_config) : send_config_(send_config), receive_config_(receive_config) {} -webrtc::Call* FakeNetworkCallFactory::CreateCall( - const webrtc::Call::Config& config) { +std::unique_ptr FakeNetworkCallFactory::CreateCall( + const webrtc::CallConfig& config) { webrtc::DegradedCall::TimeScopedNetworkConfig default_config; webrtc::RtpTransportConfig transport_config = config.ExtractTransportConfig(); @@ -27,7 +27,7 @@ webrtc::Call* FakeNetworkCallFactory::CreateCall( bool receive_config_changed = memcmp(&receive_config_, &default_config, sizeof(default_config)) != 0; - webrtc::Call* call = webrtc::Call::Create( + auto call = webrtc::Call::Create( config, webrtc::Clock::GetRealTimeClock(), config.rtp_transport_controller_send_factory->Create( transport_config, webrtc::Clock::GetRealTimeClock())); @@ -37,8 +37,8 @@ webrtc::Call* FakeNetworkCallFactory::CreateCall( send_config_}; std::vector receive_config = {receive_config_}; - return new webrtc::DegradedCall(std::unique_ptr(call), - send_config, receive_config); + return std::make_unique(std::move(call), send_config, + receive_config); } return call; diff --git a/src/fake_network_call_factory.h b/src/fake_network_call_factory.h index 8ae6370..511d6a1 100644 --- a/src/fake_network_call_factory.h +++ b/src/fake_network_call_factory.h @@ -17,7 +17,8 @@ class FakeNetworkCallFactory : public webrtc::CallFactoryInterface { private: ~FakeNetworkCallFactory() override {} - webrtc::Call* CreateCall(const webrtc::CallConfig& config) override; + std::unique_ptr CreateCall( + const webrtc::CallConfig& config) override; webrtc::DegradedCall::TimeScopedNetworkConfig send_config_; webrtc::DegradedCall::TimeScopedNetworkConfig receive_config_;