From a1b82010094bc48d02c13cb934966296370902fa Mon Sep 17 00:00:00 2001 From: Markus Handell Date: Wed, 26 May 2021 18:56:30 +0200 Subject: [PATCH] Move proxies into pc/. Bug: webrtc:12787 Change-Id: Ia244d9d22d35436a02cf5a448bd1520cb66ff352 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/220321 Reviewed-by: Harald Alvestrand Commit-Queue: Markus Handell Cr-Commit-Position: refs/heads/master@{#34141} --- api/BUILD.gn | 8 ----- pc/BUILD.gn | 29 +++++++++++++++++++ pc/audio_rtp_receiver.cc | 2 +- pc/audio_rtp_receiver.h | 2 +- pc/dtmf_sender.h | 2 +- {api => pc}/media_stream_proxy.h | 12 ++++---- {api => pc}/media_stream_track_proxy.h | 13 ++++----- pc/peer_connection_bundle_unittest.cc | 2 +- pc/peer_connection_data_channel_unittest.cc | 2 +- pc/peer_connection_factory.cc | 8 ++--- {api => pc}/peer_connection_factory_proxy.h | 12 ++++---- pc/peer_connection_histogram_unittest.cc | 2 +- pc/peer_connection_ice_unittest.cc | 2 +- {api => pc}/peer_connection_proxy.h | 12 ++++---- pc/peer_connection_signaling_unittest.cc | 2 +- {api => pc}/proxy.cc | 2 +- {api => pc}/proxy.h | 6 ++-- pc/proxy_unittest.cc | 2 +- pc/rtp_receiver.cc | 2 +- pc/rtp_receiver_proxy.h | 2 +- pc/rtp_sender_proxy.h | 2 +- pc/rtp_transceiver.h | 2 +- pc/sctp_data_channel.cc | 2 +- pc/sdp_offer_answer.cc | 2 +- pc/test/integration_test_helpers.h | 2 +- pc/video_rtp_receiver.h | 2 +- {api => pc}/video_track_source_proxy.cc | 2 +- {api => pc}/video_track_source_proxy.h | 12 ++++---- sdk/BUILD.gn | 1 + sdk/objc/api/peerconnection/RTCVideoSource.mm | 2 +- sdk/objc/native/api/video_capturer.mm | 6 ++-- 31 files changed, 90 insertions(+), 69 deletions(-) rename {api => pc}/media_stream_proxy.h (83%) rename {api => pc}/media_stream_track_proxy.h (89%) rename {api => pc}/peer_connection_factory_proxy.h (86%) rename {api => pc}/peer_connection_proxy.h (96%) rename {api => pc}/proxy.cc (96%) rename {api => pc}/proxy.h (99%) rename {api => pc}/video_track_source_proxy.cc (95%) rename {api => pc}/video_track_source_proxy.h (86%) diff --git a/api/BUILD.gn b/api/BUILD.gn index aee9787f3f..6a04f4fcf3 100644 --- a/api/BUILD.gn +++ b/api/BUILD.gn @@ -135,14 +135,8 @@ rtc_library("libjingle_peerconnection_api") { "jsep_ice_candidate.cc", "jsep_ice_candidate.h", "jsep_session_description.h", - "media_stream_proxy.h", - "media_stream_track_proxy.h", - "peer_connection_factory_proxy.h", "peer_connection_interface.cc", "peer_connection_interface.h", - "peer_connection_proxy.h", - "proxy.cc", - "proxy.h", "rtp_receiver_interface.cc", "rtp_receiver_interface.h", "rtp_sender_interface.cc", @@ -157,8 +151,6 @@ rtc_library("libjingle_peerconnection_api") { "stats_types.h", "turn_customizer.h", "uma_metrics.h", - "video_track_source_proxy.cc", - "video_track_source_proxy.h", "video_track_source_proxy_factory.h", ] deps = [ diff --git a/pc/BUILD.gn b/pc/BUILD.gn index 98c30be3e4..a6eae1604b 100644 --- a/pc/BUILD.gn +++ b/pc/BUILD.gn @@ -23,6 +23,20 @@ config("rtc_pc_config") { } } +rtc_library("proxy") { + sources = [ + "proxy.cc", + "proxy.h", + ] + deps = [ + "../api:scoped_refptr", + "../api/task_queue", + "../rtc_base:rtc_base_approved", + "../rtc_base:threading", + "../rtc_base/system:rtc_export", + ] +} + rtc_library("rtc_pc_base") { visibility = [ "*" ] defines = [] @@ -46,6 +60,10 @@ rtc_library("rtc_pc_base") { "jsep_transport_controller.h", "media_session.cc", "media_session.h", + "media_stream_proxy.h", + "media_stream_track_proxy.h", + "peer_connection_factory_proxy.h", + "peer_connection_proxy.h", "rtcp_mux_filter.cc", "rtcp_mux_filter.h", "rtp_media_utils.cc", @@ -74,10 +92,13 @@ rtc_library("rtc_pc_base") { "transport_stats.cc", "transport_stats.h", "used_ids.h", + "video_track_source_proxy.cc", + "video_track_source_proxy.h", ] deps = [ ":media_protocol_names", + ":proxy", "../api:array_view", "../api:async_dns_resolver", "../api:audio_options_api", @@ -85,6 +106,7 @@ rtc_library("rtc_pc_base") { "../api:function_view", "../api:ice_transport_factory", "../api:libjingle_peerconnection_api", + "../api:media_stream_interface", "../api:packet_socket_factory", "../api:priority", "../api:rtc_error", @@ -221,6 +243,7 @@ rtc_library("peerconnection") { ":media_protocol_names", ":media_stream", ":peer_connection_message_handler", + ":proxy", ":remote_audio_source", ":rtc_pc_base", ":rtp_parameters_conversion", @@ -382,6 +405,7 @@ rtc_library("rtp_transceiver") { "rtp_transceiver.h", ] deps = [ + ":proxy", ":rtc_pc_base", ":rtp_parameters_conversion", ":rtp_receiver", @@ -473,6 +497,7 @@ rtc_library("rtp_receiver") { ] deps = [ ":media_stream", + ":rtc_pc_base", ":video_track_source", "../api:libjingle_peerconnection_api", "../api:media_stream_interface", @@ -504,6 +529,7 @@ rtc_library("audio_rtp_receiver") { ":jitter_buffer_delay", ":media_stream", ":remote_audio_source", + ":rtc_pc_base", ":rtp_receiver", "../api:frame_transformer_interface", "../api:libjingle_peerconnection_api", @@ -537,6 +563,7 @@ rtc_library("video_rtp_receiver") { deps = [ ":jitter_buffer_delay", ":media_stream", + ":rtc_pc_base", ":rtp_receiver", ":video_rtp_track_source", ":video_track", @@ -725,6 +752,7 @@ rtc_library("dtmf_sender") { "dtmf_sender.h", ] deps = [ + ":proxy", "../api:libjingle_peerconnection_api", "../api:scoped_refptr", "../rtc_base:checks", @@ -997,6 +1025,7 @@ if (rtc_include_tests && !build_with_chromium) { ":jitter_buffer_delay", ":media_stream", ":peerconnection", + ":proxy", ":remote_audio_source", ":rtc_pc_base", ":rtp_parameters_conversion", diff --git a/pc/audio_rtp_receiver.cc b/pc/audio_rtp_receiver.cc index 5f815c589e..4efab24d15 100644 --- a/pc/audio_rtp_receiver.cc +++ b/pc/audio_rtp_receiver.cc @@ -15,9 +15,9 @@ #include #include -#include "api/media_stream_track_proxy.h" #include "api/sequence_checker.h" #include "pc/audio_track.h" +#include "pc/media_stream_track_proxy.h" #include "rtc_base/checks.h" #include "rtc_base/location.h" #include "rtc_base/logging.h" diff --git a/pc/audio_rtp_receiver.h b/pc/audio_rtp_receiver.h index 7f2e557126..c3468721d8 100644 --- a/pc/audio_rtp_receiver.h +++ b/pc/audio_rtp_receiver.h @@ -21,7 +21,6 @@ #include "api/dtls_transport_interface.h" #include "api/frame_transformer_interface.h" #include "api/media_stream_interface.h" -#include "api/media_stream_track_proxy.h" #include "api/media_types.h" #include "api/rtp_parameters.h" #include "api/rtp_receiver_interface.h" @@ -31,6 +30,7 @@ #include "media/base/media_channel.h" #include "pc/audio_track.h" #include "pc/jitter_buffer_delay.h" +#include "pc/media_stream_track_proxy.h" #include "pc/remote_audio_source.h" #include "pc/rtp_receiver.h" #include "rtc_base/ref_counted_object.h" diff --git a/pc/dtmf_sender.h b/pc/dtmf_sender.h index 5cf7b2eba1..cb515e850d 100644 --- a/pc/dtmf_sender.h +++ b/pc/dtmf_sender.h @@ -16,8 +16,8 @@ #include #include "api/dtmf_sender_interface.h" -#include "api/proxy.h" #include "api/scoped_refptr.h" +#include "pc/proxy.h" #include "rtc_base/constructor_magic.h" #include "rtc_base/location.h" #include "rtc_base/ref_count.h" diff --git a/api/media_stream_proxy.h b/pc/media_stream_proxy.h similarity index 83% rename from api/media_stream_proxy.h rename to pc/media_stream_proxy.h index 773c5d8b14..b2d4443e6c 100644 --- a/api/media_stream_proxy.h +++ b/pc/media_stream_proxy.h @@ -8,18 +8,18 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef API_MEDIA_STREAM_PROXY_H_ -#define API_MEDIA_STREAM_PROXY_H_ +#ifndef PC_MEDIA_STREAM_PROXY_H_ +#define PC_MEDIA_STREAM_PROXY_H_ #include #include "api/media_stream_interface.h" -#include "api/proxy.h" +#include "pc/proxy.h" namespace webrtc { -// TODO(deadbeef): Move this to .cc file and out of api/. What threads methods -// are called on is an implementation detail. +// TODO(deadbeef): Move this to a .cc file. What threads methods are called on +// is an implementation detail. BEGIN_PRIMARY_PROXY_MAP(MediaStream) PROXY_PRIMARY_THREAD_DESTRUCTOR() BYPASS_PROXY_CONSTMETHOD0(std::string, id) @@ -41,4 +41,4 @@ END_PROXY_MAP() } // namespace webrtc -#endif // API_MEDIA_STREAM_PROXY_H_ +#endif // PC_MEDIA_STREAM_PROXY_H_ diff --git a/api/media_stream_track_proxy.h b/pc/media_stream_track_proxy.h similarity index 89% rename from api/media_stream_track_proxy.h rename to pc/media_stream_track_proxy.h index f2d5f214d6..1727799a84 100644 --- a/api/media_stream_track_proxy.h +++ b/pc/media_stream_track_proxy.h @@ -11,19 +11,18 @@ // This file includes proxy classes for tracks. The purpose is // to make sure tracks are only accessed from the signaling thread. -#ifndef API_MEDIA_STREAM_TRACK_PROXY_H_ -#define API_MEDIA_STREAM_TRACK_PROXY_H_ +#ifndef PC_MEDIA_STREAM_TRACK_PROXY_H_ +#define PC_MEDIA_STREAM_TRACK_PROXY_H_ #include #include "api/media_stream_interface.h" -#include "api/proxy.h" +#include "pc/proxy.h" namespace webrtc { -// TODO(deadbeef): Move this to .cc file and out of api/. What threads methods -// are called on is an implementation detail. - +// TODO(deadbeef): Move this to .cc file. What threads methods are called on is +// an implementation detail. BEGIN_PRIMARY_PROXY_MAP(AudioTrack) PROXY_PRIMARY_THREAD_DESTRUCTOR() BYPASS_PROXY_CONSTMETHOD0(std::string, kind) @@ -62,4 +61,4 @@ END_PROXY_MAP() } // namespace webrtc -#endif // API_MEDIA_STREAM_TRACK_PROXY_H_ +#endif // PC_MEDIA_STREAM_TRACK_PROXY_H_ diff --git a/pc/peer_connection_bundle_unittest.cc b/pc/peer_connection_bundle_unittest.cc index fa5be62745..08754c6820 100644 --- a/pc/peer_connection_bundle_unittest.cc +++ b/pc/peer_connection_bundle_unittest.cc @@ -13,7 +13,6 @@ #include "api/audio_codecs/builtin_audio_decoder_factory.h" #include "api/audio_codecs/builtin_audio_encoder_factory.h" #include "api/create_peerconnection_factory.h" -#include "api/peer_connection_proxy.h" #include "api/video_codecs/builtin_video_decoder_factory.h" #include "api/video_codecs/builtin_video_encoder_factory.h" #include "p2p/base/fake_port_allocator.h" @@ -21,6 +20,7 @@ #include "p2p/client/basic_port_allocator.h" #include "pc/media_session.h" #include "pc/peer_connection.h" +#include "pc/peer_connection_proxy.h" #include "pc/peer_connection_wrapper.h" #include "pc/sdp_utils.h" #ifdef WEBRTC_ANDROID diff --git a/pc/peer_connection_data_channel_unittest.cc b/pc/peer_connection_data_channel_unittest.cc index 157dcd25c8..2544473536 100644 --- a/pc/peer_connection_data_channel_unittest.cc +++ b/pc/peer_connection_data_channel_unittest.cc @@ -19,7 +19,6 @@ #include "api/jsep.h" #include "api/media_types.h" #include "api/peer_connection_interface.h" -#include "api/peer_connection_proxy.h" #include "api/scoped_refptr.h" #include "api/task_queue/default_task_queue_factory.h" #include "media/base/codec.h" @@ -32,6 +31,7 @@ #include "pc/media_session.h" #include "pc/peer_connection.h" #include "pc/peer_connection_factory.h" +#include "pc/peer_connection_proxy.h" #include "pc/peer_connection_wrapper.h" #include "pc/sdp_utils.h" #include "pc/session_description.h" diff --git a/pc/peer_connection_factory.cc b/pc/peer_connection_factory.cc index 81a4cd8455..d4e199cbe2 100644 --- a/pc/peer_connection_factory.cc +++ b/pc/peer_connection_factory.cc @@ -18,12 +18,8 @@ #include "api/call/call_factory_interface.h" #include "api/fec_controller.h" #include "api/ice_transport_interface.h" -#include "api/media_stream_proxy.h" -#include "api/media_stream_track_proxy.h" #include "api/network_state_predictor.h" #include "api/packet_socket_factory.h" -#include "api/peer_connection_factory_proxy.h" -#include "api/peer_connection_proxy.h" #include "api/rtc_event_log/rtc_event_log.h" #include "api/sequence_checker.h" #include "api/transport/bitrate_settings.h" @@ -38,7 +34,11 @@ #include "pc/audio_track.h" #include "pc/local_audio_source.h" #include "pc/media_stream.h" +#include "pc/media_stream_proxy.h" +#include "pc/media_stream_track_proxy.h" #include "pc/peer_connection.h" +#include "pc/peer_connection_factory_proxy.h" +#include "pc/peer_connection_proxy.h" #include "pc/rtp_parameters_conversion.h" #include "pc/session_description.h" #include "pc/video_track.h" diff --git a/api/peer_connection_factory_proxy.h b/pc/peer_connection_factory_proxy.h similarity index 86% rename from api/peer_connection_factory_proxy.h rename to pc/peer_connection_factory_proxy.h index de6250fe92..b257be70fe 100644 --- a/api/peer_connection_factory_proxy.h +++ b/pc/peer_connection_factory_proxy.h @@ -8,20 +8,20 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef API_PEER_CONNECTION_FACTORY_PROXY_H_ -#define API_PEER_CONNECTION_FACTORY_PROXY_H_ +#ifndef PC_PEER_CONNECTION_FACTORY_PROXY_H_ +#define PC_PEER_CONNECTION_FACTORY_PROXY_H_ #include #include #include #include "api/peer_connection_interface.h" -#include "api/proxy.h" +#include "pc/proxy.h" namespace webrtc { -// TODO(deadbeef): Move this to .cc file and out of api/. What threads methods -// are called on is an implementation detail. +// TODO(deadbeef): Move this to .cc file. What threads methods are called on is +// an implementation detail. BEGIN_PROXY_MAP(PeerConnectionFactory) PROXY_PRIMARY_THREAD_DESTRUCTOR() PROXY_METHOD1(void, SetOptions, const Options&) @@ -55,4 +55,4 @@ END_PROXY_MAP() } // namespace webrtc -#endif // API_PEER_CONNECTION_FACTORY_PROXY_H_ +#endif // PC_PEER_CONNECTION_FACTORY_PROXY_H_ diff --git a/pc/peer_connection_histogram_unittest.cc b/pc/peer_connection_histogram_unittest.cc index 97fbde2f86..fa46ce9802 100644 --- a/pc/peer_connection_histogram_unittest.cc +++ b/pc/peer_connection_histogram_unittest.cc @@ -19,7 +19,6 @@ #include "api/jsep.h" #include "api/jsep_session_description.h" #include "api/peer_connection_interface.h" -#include "api/peer_connection_proxy.h" #include "api/rtc_error.h" #include "api/scoped_refptr.h" #include "api/task_queue/default_task_queue_factory.h" @@ -29,6 +28,7 @@ #include "p2p/client/basic_port_allocator.h" #include "pc/peer_connection.h" #include "pc/peer_connection_factory.h" +#include "pc/peer_connection_proxy.h" #include "pc/peer_connection_wrapper.h" #include "pc/sdp_utils.h" #include "pc/test/mock_peer_connection_observers.h" diff --git a/pc/peer_connection_ice_unittest.cc b/pc/peer_connection_ice_unittest.cc index ed30377f20..7971547ffa 100644 --- a/pc/peer_connection_ice_unittest.cc +++ b/pc/peer_connection_ice_unittest.cc @@ -23,10 +23,10 @@ #include "api/audio_codecs/builtin_audio_decoder_factory.h" #include "api/audio_codecs/builtin_audio_encoder_factory.h" #include "api/create_peerconnection_factory.h" -#include "api/peer_connection_proxy.h" #include "api/uma_metrics.h" #include "api/video_codecs/builtin_video_decoder_factory.h" #include "api/video_codecs/builtin_video_encoder_factory.h" +#include "pc/peer_connection_proxy.h" #include "pc/test/fake_audio_capture_module.h" #include "pc/test/mock_peer_connection_observers.h" #include "rtc_base/fake_network.h" diff --git a/api/peer_connection_proxy.h b/pc/peer_connection_proxy.h similarity index 96% rename from api/peer_connection_proxy.h rename to pc/peer_connection_proxy.h index de7664f4bf..212f6192e3 100644 --- a/api/peer_connection_proxy.h +++ b/pc/peer_connection_proxy.h @@ -8,23 +8,23 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef API_PEER_CONNECTION_PROXY_H_ -#define API_PEER_CONNECTION_PROXY_H_ +#ifndef PC_PEER_CONNECTION_PROXY_H_ +#define PC_PEER_CONNECTION_PROXY_H_ #include #include #include #include "api/peer_connection_interface.h" -#include "api/proxy.h" +#include "pc/proxy.h" namespace webrtc { // PeerConnection proxy objects will be constructed with two thread pointers, // signaling and network. The proxy macros don't have 'network' specific macros // and support for a secondary thread is provided via 'SECONDARY' macros. -// TODO(deadbeef): Move this to .cc file and out of api/. What threads methods -// are called on is an implementation detail. +// TODO(deadbeef): Move this to .cc file. What threads methods are called on is +// an implementation detail. BEGIN_PROXY_MAP(PeerConnection) PROXY_PRIMARY_THREAD_DESTRUCTOR() PROXY_METHOD0(rtc::scoped_refptr, local_streams) @@ -161,4 +161,4 @@ END_PROXY_MAP() } // namespace webrtc -#endif // API_PEER_CONNECTION_PROXY_H_ +#endif // PC_PEER_CONNECTION_PROXY_H_ diff --git a/pc/peer_connection_signaling_unittest.cc b/pc/peer_connection_signaling_unittest.cc index a4f05c14c8..1c94570ec7 100644 --- a/pc/peer_connection_signaling_unittest.cc +++ b/pc/peer_connection_signaling_unittest.cc @@ -19,10 +19,10 @@ #include "api/audio_codecs/builtin_audio_encoder_factory.h" #include "api/create_peerconnection_factory.h" #include "api/jsep_session_description.h" -#include "api/peer_connection_proxy.h" #include "api/video_codecs/builtin_video_decoder_factory.h" #include "api/video_codecs/builtin_video_encoder_factory.h" #include "pc/peer_connection.h" +#include "pc/peer_connection_proxy.h" #include "pc/peer_connection_wrapper.h" #include "pc/sdp_utils.h" #include "pc/webrtc_sdp.h" diff --git a/api/proxy.cc b/pc/proxy.cc similarity index 96% rename from api/proxy.cc rename to pc/proxy.cc index a7653ce057..7dc47865cf 100644 --- a/api/proxy.cc +++ b/pc/proxy.cc @@ -8,7 +8,7 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "api/proxy.h" +#include "pc/proxy.h" #include "rtc_base/trace_event.h" diff --git a/api/proxy.h b/pc/proxy.h similarity index 99% rename from api/proxy.h rename to pc/proxy.h index a530e98a77..c4e4966869 100644 --- a/api/proxy.h +++ b/pc/proxy.h @@ -56,8 +56,8 @@ // The variant defined with BEGIN_OWNED_PROXY_MAP does not use // refcounting, and instead just takes ownership of the object being proxied. -#ifndef API_PROXY_H_ -#define API_PROXY_H_ +#ifndef PC_PROXY_H_ +#define PC_PROXY_H_ #include #include @@ -440,4 +440,4 @@ class ConstMethodCall : public QueuedTask { } // namespace webrtc -#endif // API_PROXY_H_ +#endif // PC_PROXY_H_ diff --git a/pc/proxy_unittest.cc b/pc/proxy_unittest.cc index f59250d49f..497c99a54a 100644 --- a/pc/proxy_unittest.cc +++ b/pc/proxy_unittest.cc @@ -8,7 +8,7 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "api/proxy.h" +#include "pc/proxy.h" #include #include diff --git a/pc/rtp_receiver.cc b/pc/rtp_receiver.cc index 88f32d88e5..2444c9b60d 100644 --- a/pc/rtp_receiver.cc +++ b/pc/rtp_receiver.cc @@ -15,8 +15,8 @@ #include #include -#include "api/media_stream_proxy.h" #include "pc/media_stream.h" +#include "pc/media_stream_proxy.h" #include "rtc_base/location.h" namespace webrtc { diff --git a/pc/rtp_receiver_proxy.h b/pc/rtp_receiver_proxy.h index 5b9b443332..409612e744 100644 --- a/pc/rtp_receiver_proxy.h +++ b/pc/rtp_receiver_proxy.h @@ -14,8 +14,8 @@ #include #include -#include "api/proxy.h" #include "api/rtp_receiver_interface.h" +#include "pc/proxy.h" namespace webrtc { diff --git a/pc/rtp_sender_proxy.h b/pc/rtp_sender_proxy.h index 1c5040eab3..e23f57b38e 100644 --- a/pc/rtp_sender_proxy.h +++ b/pc/rtp_sender_proxy.h @@ -14,8 +14,8 @@ #include #include -#include "api/proxy.h" #include "api/rtp_sender_interface.h" +#include "pc/proxy.h" namespace webrtc { diff --git a/pc/rtp_transceiver.h b/pc/rtp_transceiver.h index 66a0bea32e..3c7db95c5a 100644 --- a/pc/rtp_transceiver.h +++ b/pc/rtp_transceiver.h @@ -21,7 +21,6 @@ #include "absl/types/optional.h" #include "api/array_view.h" #include "api/media_types.h" -#include "api/proxy.h" #include "api/rtc_error.h" #include "api/rtp_parameters.h" #include "api/rtp_transceiver_direction.h" @@ -30,6 +29,7 @@ #include "api/task_queue/task_queue_base.h" #include "pc/channel_interface.h" #include "pc/channel_manager.h" +#include "pc/proxy.h" #include "pc/rtp_receiver.h" #include "pc/rtp_receiver_proxy.h" #include "pc/rtp_sender.h" diff --git a/pc/sctp_data_channel.cc b/pc/sctp_data_channel.cc index 682d76829c..76091c25bf 100644 --- a/pc/sctp_data_channel.cc +++ b/pc/sctp_data_channel.cc @@ -15,8 +15,8 @@ #include #include -#include "api/proxy.h" #include "media/sctp/sctp_transport_internal.h" +#include "pc/proxy.h" #include "pc/sctp_utils.h" #include "rtc_base/checks.h" #include "rtc_base/location.h" diff --git a/pc/sdp_offer_answer.cc b/pc/sdp_offer_answer.cc index 32b3f69f90..30d07dbcb4 100644 --- a/pc/sdp_offer_answer.cc +++ b/pc/sdp_offer_answer.cc @@ -23,7 +23,6 @@ #include "api/array_view.h" #include "api/crypto/crypto_options.h" #include "api/dtls_transport_interface.h" -#include "api/media_stream_proxy.h" #include "api/rtp_parameters.h" #include "api/rtp_receiver_interface.h" #include "api/rtp_sender_interface.h" @@ -41,6 +40,7 @@ #include "pc/data_channel_utils.h" #include "pc/dtls_transport.h" #include "pc/media_stream.h" +#include "pc/media_stream_proxy.h" #include "pc/peer_connection.h" #include "pc/peer_connection_message_handler.h" #include "pc/rtp_media_utils.h" diff --git a/pc/test/integration_test_helpers.h b/pc/test/integration_test_helpers.h index f015312e8f..117f1b428b 100644 --- a/pc/test/integration_test_helpers.h +++ b/pc/test/integration_test_helpers.h @@ -37,7 +37,6 @@ #include "api/media_stream_interface.h" #include "api/media_types.h" #include "api/peer_connection_interface.h" -#include "api/peer_connection_proxy.h" #include "api/rtc_error.h" #include "api/rtc_event_log/rtc_event_log_factory.h" #include "api/rtc_event_log/rtc_event_log_factory_interface.h" @@ -84,6 +83,7 @@ #include "pc/media_session.h" #include "pc/peer_connection.h" #include "pc/peer_connection_factory.h" +#include "pc/peer_connection_proxy.h" #include "pc/rtp_media_utils.h" #include "pc/session_description.h" #include "pc/test/fake_audio_capture_module.h" diff --git a/pc/video_rtp_receiver.h b/pc/video_rtp_receiver.h index 89e15a5c79..f59db7a840 100644 --- a/pc/video_rtp_receiver.h +++ b/pc/video_rtp_receiver.h @@ -21,7 +21,6 @@ #include "api/dtls_transport_interface.h" #include "api/frame_transformer_interface.h" #include "api/media_stream_interface.h" -#include "api/media_stream_track_proxy.h" #include "api/media_types.h" #include "api/rtp_parameters.h" #include "api/rtp_receiver_interface.h" @@ -33,6 +32,7 @@ #include "api/video/video_source_interface.h" #include "media/base/media_channel.h" #include "pc/jitter_buffer_delay.h" +#include "pc/media_stream_track_proxy.h" #include "pc/rtp_receiver.h" #include "pc/video_rtp_track_source.h" #include "pc/video_track.h" diff --git a/api/video_track_source_proxy.cc b/pc/video_track_source_proxy.cc similarity index 95% rename from api/video_track_source_proxy.cc rename to pc/video_track_source_proxy.cc index a24faf82a5..309c1f20f8 100644 --- a/api/video_track_source_proxy.cc +++ b/pc/video_track_source_proxy.cc @@ -8,7 +8,7 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "api/video_track_source_proxy.h" +#include "pc/video_track_source_proxy.h" #include "api/media_stream_interface.h" #include "api/video_track_source_proxy_factory.h" diff --git a/api/video_track_source_proxy.h b/pc/video_track_source_proxy.h similarity index 86% rename from api/video_track_source_proxy.h rename to pc/video_track_source_proxy.h index 0b60d20de5..5a6def6935 100644 --- a/api/video_track_source_proxy.h +++ b/pc/video_track_source_proxy.h @@ -8,18 +8,18 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef API_VIDEO_TRACK_SOURCE_PROXY_H_ -#define API_VIDEO_TRACK_SOURCE_PROXY_H_ +#ifndef PC_VIDEO_TRACK_SOURCE_PROXY_H_ +#define PC_VIDEO_TRACK_SOURCE_PROXY_H_ #include "api/media_stream_interface.h" -#include "api/proxy.h" +#include "pc/proxy.h" namespace webrtc { // Makes sure the real VideoTrackSourceInterface implementation is destroyed on // the signaling thread and marshals all method calls to the signaling thread. -// TODO(deadbeef): Move this to .cc file and out of api/. What threads methods -// are called on is an implementation detail. +// TODO(deadbeef): Move this to .cc file. What threads methods are called on is +// an implementation detail. BEGIN_PROXY_MAP(VideoTrackSource) PROXY_PRIMARY_THREAD_DESTRUCTOR() PROXY_CONSTMETHOD0(SourceState, state) @@ -46,4 +46,4 @@ END_PROXY_MAP() } // namespace webrtc -#endif // API_VIDEO_TRACK_SOURCE_PROXY_H_ +#endif // PC_VIDEO_TRACK_SOURCE_PROXY_H_ diff --git a/sdk/BUILD.gn b/sdk/BUILD.gn index e01ab97a6e..4ae6023667 100644 --- a/sdk/BUILD.gn +++ b/sdk/BUILD.gn @@ -390,6 +390,7 @@ if (is_ios || is_mac) { "../api/video:video_rtp_headers", "../common_video", "../media:rtc_media_base", + "../pc:rtc_pc_base", "../rtc_base", "../rtc_base:checks", "../rtc_base:threading", diff --git a/sdk/objc/api/peerconnection/RTCVideoSource.mm b/sdk/objc/api/peerconnection/RTCVideoSource.mm index 15b0d6f1be..3a1ea6a322 100644 --- a/sdk/objc/api/peerconnection/RTCVideoSource.mm +++ b/sdk/objc/api/peerconnection/RTCVideoSource.mm @@ -10,7 +10,7 @@ #import "RTCVideoSource+Private.h" -#include "api/video_track_source_proxy.h" +#include "pc/video_track_source_proxy.h" #include "rtc_base/checks.h" #include "sdk/objc/native/src/objc_video_track_source.h" diff --git a/sdk/objc/native/api/video_capturer.mm b/sdk/objc/native/api/video_capturer.mm index 6dd0edbcd9..cae7a50318 100644 --- a/sdk/objc/native/api/video_capturer.mm +++ b/sdk/objc/native/api/video_capturer.mm @@ -11,7 +11,8 @@ #include "sdk/objc/native/api/video_capturer.h" #include "absl/memory/memory.h" -#include "api/video_track_source_proxy.h" +#include "api/video_track_source_proxy_factory.h" +#include "rtc_base/ref_counted_object.h" #include "sdk/objc/native/src/objc_video_track_source.h" namespace webrtc { @@ -24,8 +25,7 @@ rtc::scoped_refptr ObjCToNativeVideoCapturer( rtc::scoped_refptr objc_video_track_source( new rtc::RefCountedObject(adapter)); rtc::scoped_refptr video_source = - webrtc::VideoTrackSourceProxy::Create( - signaling_thread, worker_thread, objc_video_track_source); + webrtc::CreateVideoTrackSourceProxy(signaling_thread, worker_thread, objc_video_track_source); objc_video_capturer.delegate = adapter;