mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-12 21:30:45 +01:00
Delete CallFactoryInterface as no longer needed
Replace CallFactory class with a factory function Bug: webrtc:15574 Change-Id: Ib1d8cff8d7550da3af01693a7bc117a7bd342258 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/330000 Commit-Queue: Danil Chapovalov <danilchap@webrtc.org> Reviewed-by: Harald Alvestrand <hta@webrtc.org> Cr-Commit-Position: refs/heads/main@{#41321}
This commit is contained in:
parent
242ed95fd7
commit
3d9c3687a4
14 changed files with 10 additions and 98 deletions
10
api/BUILD.gn
10
api/BUILD.gn
|
@ -26,15 +26,6 @@ rtc_source_set("call_api") {
|
|||
sources = [ "call/audio_sink.h" ]
|
||||
}
|
||||
|
||||
rtc_source_set("callfactory_api") {
|
||||
visibility = [ "*" ]
|
||||
sources = [ "call/call_factory_interface.h" ]
|
||||
deps = [
|
||||
"../call:rtp_interfaces",
|
||||
"../rtc_base/system:rtc_export",
|
||||
]
|
||||
}
|
||||
|
||||
rtc_source_set("enable_media") {
|
||||
visibility = [ "*" ]
|
||||
sources = [
|
||||
|
@ -575,7 +566,6 @@ rtc_source_set("peer_connection_quality_test_fixture_api") {
|
|||
deps = [
|
||||
":array_view",
|
||||
":audio_quality_analyzer_api",
|
||||
":callfactory_api",
|
||||
":fec_controller_api",
|
||||
":frame_generator_api",
|
||||
":function_view",
|
||||
|
|
|
@ -1,43 +0,0 @@
|
|||
/*
|
||||
* Copyright 2017 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#ifndef API_CALL_CALL_FACTORY_INTERFACE_H_
|
||||
#define API_CALL_CALL_FACTORY_INTERFACE_H_
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "rtc_base/system/rtc_export.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
// These classes are not part of the API, and are treated as opaque pointers.
|
||||
class Call;
|
||||
struct CallConfig;
|
||||
|
||||
// This interface exists to allow webrtc to be optionally built without media
|
||||
// support (i.e., if only being used for data channels). PeerConnectionFactory
|
||||
// is constructed with a CallFactoryInterface, which may or may not be null.
|
||||
// TODO(bugs.webrtc.org/15574): Delete this interface when
|
||||
// `PeerConnectionFactoryDependencies::call_factory` is removed in favor of
|
||||
// `PeerConnectionFactoryDependencies::media_factory`.
|
||||
class CallFactoryInterface {
|
||||
public:
|
||||
virtual ~CallFactoryInterface() = default;
|
||||
|
||||
virtual std::unique_ptr<Call> CreateCall(const CallConfig& config) = 0;
|
||||
};
|
||||
|
||||
[[deprecated("bugs.webrtc.org/15574")]] //
|
||||
RTC_EXPORT std::unique_ptr<CallFactoryInterface>
|
||||
CreateCallFactory();
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // API_CALL_CALL_FACTORY_INTERFACE_H_
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
#include "api/environment/environment.h"
|
||||
#include "api/peer_connection_interface.h"
|
||||
#include "call/call_factory.h"
|
||||
#include "call/create_call.h"
|
||||
#include "media/engine/webrtc_media_engine.h"
|
||||
#include "media/engine/webrtc_video_engine.h"
|
||||
#include "media/engine/webrtc_voice_engine.h"
|
||||
|
@ -37,8 +37,7 @@ class MediaFactoryImpl : public MediaFactory {
|
|||
~MediaFactoryImpl() override = default;
|
||||
|
||||
std::unique_ptr<Call> CreateCall(const CallConfig& config) override {
|
||||
CallFactory call_factory;
|
||||
return static_cast<CallFactoryInterface&>(call_factory).CreateCall(config);
|
||||
return webrtc::CreateCall(config);
|
||||
}
|
||||
|
||||
std::unique_ptr<MediaEngineInterface> CreateMediaEngine(
|
||||
|
|
|
@ -20,7 +20,6 @@ rtc_source_set("media_configuration") {
|
|||
"../..:array_view",
|
||||
"../..:audio_options_api",
|
||||
"../..:audio_quality_analyzer_api",
|
||||
"../..:callfactory_api",
|
||||
"../..:fec_controller_api",
|
||||
"../..:frame_generator_api",
|
||||
"../..:function_view",
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
#include "api/array_view.h"
|
||||
#include "api/audio/audio_mixer.h"
|
||||
#include "api/audio_options.h"
|
||||
#include "api/call/call_factory_interface.h"
|
||||
#include "api/fec_controller.h"
|
||||
#include "api/function_view.h"
|
||||
#include "api/media_stream_interface.h"
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
#include "absl/types/optional.h"
|
||||
#include "api/array_view.h"
|
||||
#include "api/audio/audio_mixer.h"
|
||||
#include "api/call/call_factory_interface.h"
|
||||
#include "api/fec_controller.h"
|
||||
#include "api/function_view.h"
|
||||
#include "api/media_stream_interface.h"
|
||||
|
|
|
@ -274,8 +274,8 @@ rtc_library("bitrate_allocator") {
|
|||
rtc_library("call") {
|
||||
sources = [
|
||||
"call.cc",
|
||||
"call_factory.cc",
|
||||
"call_factory.h",
|
||||
"create_call.cc",
|
||||
"create_call.h",
|
||||
"degraded_call.cc",
|
||||
"degraded_call.h",
|
||||
"flexfec_receive_stream_impl.cc",
|
||||
|
@ -295,7 +295,6 @@ rtc_library("call") {
|
|||
":version",
|
||||
":video_stream_api",
|
||||
"../api:array_view",
|
||||
"../api:callfactory_api",
|
||||
"../api:fec_controller_api",
|
||||
"../api:field_trials_view",
|
||||
"../api:rtp_headers",
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#include "call/call_factory.h"
|
||||
#include "call/create_call.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
|
@ -78,13 +78,7 @@ std::vector<TimeScopedNetworkConfig> GetNetworkConfigs(
|
|||
|
||||
} // namespace
|
||||
|
||||
CallFactory::CallFactory() {
|
||||
call_thread_.Detach();
|
||||
}
|
||||
|
||||
std::unique_ptr<Call> CallFactory::CreateCall(const CallConfig& config) {
|
||||
RTC_DCHECK_RUN_ON(&call_thread_);
|
||||
|
||||
std::unique_ptr<Call> CreateCall(const CallConfig& config) {
|
||||
std::vector<DegradedCall::TimeScopedNetworkConfig> send_degradation_configs =
|
||||
GetNetworkConfigs(config.env.field_trials(), /*send=*/true);
|
||||
std::vector<DegradedCall::TimeScopedNetworkConfig>
|
||||
|
@ -107,8 +101,4 @@ std::unique_ptr<Call> CallFactory::CreateCall(const CallConfig& config) {
|
|||
return call;
|
||||
}
|
||||
|
||||
std::unique_ptr<CallFactoryInterface> CreateCallFactory() {
|
||||
return std::make_unique<CallFactory>();
|
||||
}
|
||||
|
||||
} // namespace webrtc
|
|
@ -8,30 +8,18 @@
|
|||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#ifndef CALL_CALL_FACTORY_H_
|
||||
#define CALL_CALL_FACTORY_H_
|
||||
#ifndef CALL_CREATE_CALL_H_
|
||||
#define CALL_CREATE_CALL_H_
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "api/call/call_factory_interface.h"
|
||||
#include "api/sequence_checker.h"
|
||||
#include "call/call.h"
|
||||
#include "call/call_config.h"
|
||||
#include "rtc_base/system/no_unique_address.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
class CallFactory : public CallFactoryInterface {
|
||||
public:
|
||||
CallFactory();
|
||||
~CallFactory() override = default;
|
||||
|
||||
private:
|
||||
std::unique_ptr<Call> CreateCall(const CallConfig& config) override;
|
||||
|
||||
RTC_NO_UNIQUE_ADDRESS SequenceChecker call_thread_;
|
||||
};
|
||||
std::unique_ptr<Call> CreateCall(const CallConfig& config);
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // CALL_CALL_FACTORY_H_
|
||||
#endif // CALL_CREATE_CALL_H_
|
|
@ -793,7 +793,6 @@ rtc_source_set("peerconnection") {
|
|||
"../api:async_dns_resolver",
|
||||
"../api:audio_options_api",
|
||||
"../api:call_api",
|
||||
"../api:callfactory_api",
|
||||
"../api:fec_controller_api",
|
||||
"../api:field_trials_view",
|
||||
"../api:frame_transformer_interface",
|
||||
|
@ -930,7 +929,6 @@ rtc_library("connection_context") {
|
|||
]
|
||||
deps = [
|
||||
":media_factory",
|
||||
"../api:callfactory_api",
|
||||
"../api:field_trials_view",
|
||||
"../api:libjingle_peerconnection_api",
|
||||
"../api:media_stream_interface",
|
||||
|
@ -1512,7 +1510,6 @@ rtc_source_set("peer_connection_factory") {
|
|||
":peer_connection_factory_proxy",
|
||||
":peer_connection_proxy",
|
||||
"../api:audio_options_api",
|
||||
"../api:callfactory_api",
|
||||
"../api:fec_controller_api",
|
||||
"../api:field_trials_view",
|
||||
"../api:ice_transport_interface",
|
||||
|
@ -2419,7 +2416,6 @@ if (rtc_include_tests && !build_with_chromium) {
|
|||
":webrtc_sdp",
|
||||
"../api:array_view",
|
||||
"../api:audio_options_api",
|
||||
"../api:callfactory_api",
|
||||
"../api:candidate",
|
||||
"../api:create_peerconnection_factory",
|
||||
"../api:dtls_transport_interface",
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "api/call/call_factory_interface.h"
|
||||
#include "api/environment/environment.h"
|
||||
#include "api/field_trials_view.h"
|
||||
#include "api/media_stream_interface.h"
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
#include <vector>
|
||||
|
||||
#include "absl/types/optional.h"
|
||||
#include "api/call/call_factory_interface.h"
|
||||
#include "api/jsep.h"
|
||||
#include "api/jsep_session_description.h"
|
||||
#include "api/peer_connection_interface.h"
|
||||
|
|
|
@ -117,7 +117,6 @@ if (rtc_include_tests && !build_with_chromium) {
|
|||
deps = [
|
||||
":emulated_network",
|
||||
"../:test_support",
|
||||
"../../api:callfactory_api",
|
||||
"../../api:enable_media_with_defaults",
|
||||
"../../api:libjingle_peerconnection_api",
|
||||
"../../api:scoped_refptr",
|
||||
|
|
|
@ -286,7 +286,6 @@ if (!build_with_chromium) {
|
|||
":default_audio_quality_analyzer",
|
||||
":network_quality_metrics_reporter",
|
||||
":stats_based_network_quality_metrics_reporter",
|
||||
"../../../api:callfactory_api",
|
||||
"../../../api:create_network_emulation_manager",
|
||||
"../../../api:create_peer_connection_quality_test_frame_generator",
|
||||
"../../../api:create_peerconnection_quality_test_fixture",
|
||||
|
|
Loading…
Reference in a new issue