blob: f0c4b54c282fb3b14e27a334af3446d2648ba7f2 [file] [log] [blame]
zhihuang38ede132017-06-15 19:52:321/*
2 * Copyright 2017 The WebRTC project authors. All Rights Reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
Danil Chapovalov3d9c3682023-12-05 10:07:5411#include "call/create_call.h"
zhihuang38ede132017-06-15 19:52:3212
13#include <memory>
Florent Castelli8037fc62024-08-29 13:00:4014#include <optional>
zhihuang38ede132017-06-15 19:52:3215
Florent Castelli8037fc62024-08-29 13:00:4016#include "api/test/simulated_network.h"
17#include "api/units/time_delta.h"
Niels Möller8366e172018-02-14 11:20:1318#include "call/call.h"
19
zhihuang38ede132017-06-15 19:52:3220namespace webrtc {
21
Tony Herre5079e8a2024-07-29 05:54:2022std::unique_ptr<Call> CreateCall(CallConfig config) {
Erik Språngb5cba85c2022-02-08 11:35:4623 std::vector<DegradedCall::TimeScopedNetworkConfig> send_degradation_configs =
Danil Chapovalove79e7222023-12-04 17:53:0924 GetNetworkConfigs(config.env.field_trials(), /*send=*/true);
Erik Språngb5cba85c2022-02-08 11:35:4625 std::vector<DegradedCall::TimeScopedNetworkConfig>
26 receive_degradation_configs =
Danil Chapovalove79e7222023-12-04 17:53:0927 GetNetworkConfigs(config.env.field_trials(), /*send=*/false);
Erik Språng09708512018-03-14 14:16:5028
Tony Herre5079e8a2024-07-29 05:54:2029 std::unique_ptr<Call> call = Call::Create(std::move(config));
Danil Chapovalov80b7c6b2022-06-20 17:59:1130
Erik Språngb5cba85c2022-02-08 11:35:4631 if (!send_degradation_configs.empty() ||
32 !receive_degradation_configs.empty()) {
Danil Chapovalova3ce4072023-10-13 11:53:0033 return std::make_unique<DegradedCall>(
34 std::move(call), send_degradation_configs, receive_degradation_configs);
Erik Språng09708512018-03-14 14:16:5035 }
36
Danil Chapovalov80b7c6b2022-06-20 17:59:1137 return call;
zhihuang38ede132017-06-15 19:52:3238}
39
zhihuang38ede132017-06-15 19:52:3240} // namespace webrtc