diff --git a/call/BUILD.gn b/call/BUILD.gn index 1094b48002..a74e8ac4bf 100644 --- a/call/BUILD.gn +++ b/call/BUILD.gn @@ -38,6 +38,8 @@ rtc_library("call_interfaces") { deps = [ ":audio_sender_interface", + ":payload_type", + ":payload_type", ":receive_stream_interface", ":rtp_interfaces", ":video_stream_api", @@ -307,6 +309,9 @@ rtc_library("call") { ":bitrate_allocator", ":call_interfaces", ":fake_network", + ":payload_type", + ":payload_type", + ":payload_type_picker", ":receive_stream_interface", ":rtp_interfaces", ":rtp_receiver", @@ -317,6 +322,7 @@ rtc_library("call") { "../api:array_view", "../api:fec_controller_api", "../api:field_trials_view", + "../api:rtc_error", "../api:rtp_headers", "../api:rtp_parameters", "../api:scoped_refptr", @@ -340,6 +346,7 @@ rtc_library("call") { "../logging:rtc_event_rtp_rtcp", "../logging:rtc_event_video", "../logging:rtc_stream_config", + "../media:codec", "../modules/congestion_controller", "../modules/pacing", "../modules/rtp_rtcp", @@ -374,6 +381,32 @@ rtc_library("call") { ] } +rtc_library("payload_type_picker") { + sources = [ + "payload_type_picker.cc", + "payload_type_picker.h", + ] + deps = [ + ":payload_type", + "../api:rtc_error", + "../api/audio_codecs:audio_codecs_api", + "../media:codec", + "../media:media_constants", + "../rtc_base:logging", + "../rtc_base:strong_alias", + "//third_party/abseil-cpp/absl/strings", + ] +} + +rtc_source_set("payload_type") { + sources = [ "payload_type.h" ] + deps = [ + "../api:rtc_error", + "../media:codec", + "../rtc_base:strong_alias", + ] +} + rtc_source_set("receive_stream_interface") { sources = [ "receive_stream.h" ] deps = [ @@ -472,6 +505,7 @@ if (rtc_include_tests) { "bitrate_estimator_tests.cc", "call_unittest.cc", "flexfec_receive_stream_unittest.cc", + "payload_type_picker_unittest.cc", "receive_time_calculator_unittest.cc", "rtp_bitrate_configurator_unittest.cc", "rtp_demuxer_unittest.cc", @@ -485,6 +519,8 @@ if (rtc_include_tests) { ":call", ":call_interfaces", ":mock_rtp_interfaces", + ":payload_type", + ":payload_type_picker", ":rtp_interfaces", ":rtp_receiver", ":rtp_sender", @@ -527,6 +563,8 @@ if (rtc_include_tests) { "../audio", "../common_video:frame_counts", "../common_video/generic_frame_descriptor", + "../media:codec", + "../media:media_constants", "../modules/audio_device:mock_audio_device", "../modules/audio_mixer", "../modules/audio_mixer:audio_mixer_impl", diff --git a/call/DEPS b/call/DEPS index daff3e9efe..1fe352db20 100644 --- a/call/DEPS +++ b/call/DEPS @@ -52,4 +52,22 @@ specific_include_rules = { "+common_video/frame_counts.h", "+common_video/generic_frame_descriptor", ], + "payload_type\.h": [ + "+media/base/codec.h", + ], + "payload_type_picker\.h": [ + "+media/base/codec.h", + "+media/base/media_constants.h", + ], + "payload_type_picker\.cc": [ + "+media/base/codec.h", + "+media/base/media_constants.h", + ], + "payload_type_picker_unittest\.cc": [ + "+media/base/codec.h", + "+media/base/media_constants.h", + ], + "call\.cc": [ + "+media/base/codec.h", + ] } diff --git a/call/call.cc b/call/call.cc index 0b1ca6f237..cf94cb8910 100644 --- a/call/call.cc +++ b/call/call.cc @@ -30,6 +30,7 @@ #include "api/fec_controller.h" #include "api/field_trials_view.h" #include "api/media_types.h" +#include "api/rtc_error.h" #include "api/rtc_event_log/rtc_event_log.h" #include "api/rtp_headers.h" #include "api/scoped_refptr.h" @@ -52,6 +53,8 @@ #include "call/flexfec_receive_stream.h" #include "call/flexfec_receive_stream_impl.h" #include "call/packet_receiver.h" +#include "call/payload_type.h" +#include "call/payload_type_picker.h" #include "call/receive_stream.h" #include "call/receive_time_calculator.h" #include "call/rtp_config.h" @@ -66,6 +69,7 @@ #include "logging/rtc_event_log/events/rtc_event_video_receive_stream_config.h" #include "logging/rtc_event_log/events/rtc_event_video_send_stream_config.h" #include "logging/rtc_event_log/rtc_stream_config.h" +#include "media/base/codec.h" #include "modules/congestion_controller/include/receive_side_congestion_controller.h" #include "modules/rtp_rtcp/include/flexfec_receiver.h" #include "modules/rtp_rtcp/include/rtp_rtcp_defines.h" @@ -100,6 +104,21 @@ namespace webrtc { namespace { +// In normal operation, the PTS comes from the PeerConnection. +// However, it is too much of a bother to insert it in all tests, +// so defaulting here. +class PayloadTypeSuggesterForTests : public PayloadTypeSuggester { + public: + PayloadTypeSuggesterForTests() = default; + RTCErrorOr SuggestPayloadType(const std::string& mid, + cricket::Codec codec) override { + return payload_type_picker_.SuggestMapping(codec, nullptr); + } + + private: + PayloadTypePicker payload_type_picker_; +}; + const int* FindKeyByValue(const std::map& m, int v) { for (const auto& kv : m) { if (kv.second == v) @@ -249,6 +268,9 @@ class Call final : public webrtc::Call, RtpTransportControllerSendInterface* GetTransportControllerSend() override; + PayloadTypeSuggester* GetPayloadTypeSuggester() override; + void SetPayloadTypeSuggester(PayloadTypeSuggester* suggester) override; + Stats GetStats() const override; const FieldTrialsView& trials() const override; @@ -465,17 +487,21 @@ class Call final : public webrtc::Call, // https://bugs.chromium.org/p/chromium/issues/detail?id=992640 RtpTransportControllerSendInterface* const transport_send_ptr_ RTC_GUARDED_BY(send_transport_sequence_checker_); - // Declared last since it will issue callbacks from a task queue. Declaring it - // last ensures that it is destroyed first and any running tasks are finished. - const std::unique_ptr transport_send_; bool is_started_ RTC_GUARDED_BY(worker_thread_) = false; + // Mechanism for proposing payload types in RTP mappings. + PayloadTypeSuggester* pt_suggester_ = nullptr; + std::unique_ptr owned_pt_suggester_; + // Sequence checker for outgoing network traffic. Could be the network thread. // Could also be a pacer owned thread or TQ such as the TaskQueueSender. RTC_NO_UNIQUE_ADDRESS SequenceChecker sent_packet_sequence_checker_; std::optional last_sent_packet_ RTC_GUARDED_BY(sent_packet_sequence_checker_); + // Declared last since it will issue callbacks from a task queue. Declaring it + // last ensures that it is destroyed first and any running tasks are finished. + const std::unique_ptr transport_send_; }; } // namespace internal @@ -1119,6 +1145,24 @@ RtpTransportControllerSendInterface* Call::GetTransportControllerSend() { return transport_send_.get(); } +PayloadTypeSuggester* Call::GetPayloadTypeSuggester() { + // TODO: https://issues.webrtc.org/360058654 - make mandatory at + // initialization. Currently, only some channels use it. + RTC_DCHECK_RUN_ON(worker_thread_); + if (!pt_suggester_) { + // Make something that will work most of the time for testing. + owned_pt_suggester_ = std::make_unique(); + SetPayloadTypeSuggester(owned_pt_suggester_.get()); + } + return pt_suggester_; +} + +void Call::SetPayloadTypeSuggester(PayloadTypeSuggester* suggester) { + RTC_CHECK(!pt_suggester_) + << "SetPayloadTypeSuggester can be called only once"; + pt_suggester_ = suggester; +} + Call::Stats Call::GetStats() const { RTC_DCHECK_RUN_ON(worker_thread_); diff --git a/call/call.h b/call/call.h index 6c6bc46c2a..313e8a85d1 100644 --- a/call/call.h +++ b/call/call.h @@ -28,9 +28,11 @@ #include "call/call_config.h" #include "call/flexfec_receive_stream.h" #include "call/packet_receiver.h" +#include "call/payload_type.h" #include "call/rtp_transport_controller_send_interface.h" #include "call/video_receive_stream.h" #include "call/video_send_stream.h" +#include "rtc_base/checks.h" #include "rtc_base/network/sent_packet.h" #include "video/config/video_encoder_config.h" @@ -109,6 +111,18 @@ class Call { // remove this method interface. virtual RtpTransportControllerSendInterface* GetTransportControllerSend() = 0; + // A class that keeps track of payload types on the transport(s), and + // suggests new ones when needed. + virtual PayloadTypeSuggester* GetPayloadTypeSuggester() { + // TODO: https://issues.webrtc.org/360058654 - make pure virtual + RTC_CHECK_NOTREACHED(); + return nullptr; + } + virtual void SetPayloadTypeSuggester(PayloadTypeSuggester* suggester) { + // TODO: https://issues.webrtc.org/360058654 - make pure virtual + RTC_CHECK_NOTREACHED(); + } + // Returns the call statistics, such as estimated send and receive bandwidth, // pacing delay, etc. virtual Stats GetStats() const = 0; diff --git a/call/payload_type.h b/call/payload_type.h new file mode 100644 index 0000000000..428096b023 --- /dev/null +++ b/call/payload_type.h @@ -0,0 +1,44 @@ +/* + * Copyright 2024 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 CALL_PAYLOAD_TYPE_H_ +#define CALL_PAYLOAD_TYPE_H_ + +#include +#include + +#include "api/rtc_error.h" +#include "media/base/codec.h" +#include "rtc_base/strong_alias.h" + +namespace webrtc { + +class PayloadType : public StrongAlias { + public: + // Non-explicit conversions from and to ints are to be deprecated and + // removed once calling code is upgraded. + PayloadType(uint8_t pt) { value_ = pt; } // NOLINT: explicit + constexpr operator uint8_t() const& { return value_; } // NOLINT: Explicit +}; + +class PayloadTypeSuggester { + public: + virtual ~PayloadTypeSuggester() = default; + // Suggest a payload type for a given codec on a given media section. + // Media section is indicated by MID. + // The function will either return a PT already in use on the connection + // or a newly suggested one. + virtual RTCErrorOr SuggestPayloadType(const std::string& mid, + cricket::Codec codec) = 0; +}; + +} // namespace webrtc + +#endif // CALL_PAYLOAD_TYPE_H_ diff --git a/pc/payload_type_picker.cc b/call/payload_type_picker.cc similarity index 97% rename from pc/payload_type_picker.cc rename to call/payload_type_picker.cc index 8720b204a8..4c5936b46d 100644 --- a/pc/payload_type_picker.cc +++ b/call/payload_type_picker.cc @@ -8,15 +8,20 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "pc/payload_type_picker.h" +#include "call/payload_type_picker.h" #include +#include #include #include #include "absl/strings/match.h" +#include "api/audio_codecs/audio_format.h" #include "api/rtc_error.h" +#include "call/payload_type.h" #include "media/base/codec.h" +#include "media/base/media_constants.h" +#include "rtc_base/logging.h" namespace webrtc { diff --git a/pc/payload_type_picker.h b/call/payload_type_picker.h similarity index 82% rename from pc/payload_type_picker.h rename to call/payload_type_picker.h index 4726a31635..0b2141c7e3 100644 --- a/pc/payload_type_picker.h +++ b/call/payload_type_picker.h @@ -8,8 +8,8 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef PC_PAYLOAD_TYPE_PICKER_H_ -#define PC_PAYLOAD_TYPE_PICKER_H_ +#ifndef CALL_PAYLOAD_TYPE_PICKER_H_ +#define CALL_PAYLOAD_TYPE_PICKER_H_ #include #include @@ -18,18 +18,10 @@ #include "api/rtc_error.h" #include "media/base/codec.h" -#include "rtc_base/strong_alias.h" +#include "call/payload_type.h" namespace webrtc { -class PayloadType : public StrongAlias { - public: - // Non-explicit conversions from and to ints are to be deprecated and - // removed once calling code is upgraded. - PayloadType(uint8_t pt) { value_ = pt; } // NOLINT: explicit - constexpr operator uint8_t() const& { return value_; } // NOLINT: Explicit -}; - class PayloadTypeRecorder; class PayloadTypePicker { @@ -84,4 +76,4 @@ class PayloadTypeRecorder { } // namespace webrtc -#endif // PC_PAYLOAD_TYPE_PICKER_H_ +#endif // CALL_PAYLOAD_TYPE_PICKER_H_ diff --git a/pc/payload_type_picker_unittest.cc b/call/payload_type_picker_unittest.cc similarity index 97% rename from pc/payload_type_picker_unittest.cc rename to call/payload_type_picker_unittest.cc index 71a338346f..e1704cf72a 100644 --- a/pc/payload_type_picker_unittest.cc +++ b/call/payload_type_picker_unittest.cc @@ -8,9 +8,11 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "pc/payload_type_picker.h" +#include "call/payload_type_picker.h" +#include "call/payload_type.h" #include "media/base/codec.h" +#include "media/base/media_constants.h" #include "test/gtest.h" namespace webrtc { diff --git a/media/BUILD.gn b/media/BUILD.gn index 584ef91ec6..32af2321d2 100644 --- a/media/BUILD.gn +++ b/media/BUILD.gn @@ -231,9 +231,15 @@ rtc_library("media_engine") { ":media_channel", ":media_channel_impl", ":rtc_media_config", + ":stream_params", ":video_common", + "../api:array_view", + "../api:audio_options_api", "../api:field_trials_view", + "../api:rtc_error", "../api:rtp_parameters", + "../api:scoped_refptr", + "../api/audio:audio_device", "../api/audio_codecs:audio_codecs_api", "../api/crypto:options", "../api/video:video_bitrate_allocation", diff --git a/media/DEPS b/media/DEPS index 7fbbc0fd47..bcdbcac20c 100644 --- a/media/DEPS +++ b/media/DEPS @@ -34,4 +34,8 @@ specific_include_rules = { ".*fake_webrtc_call\.cc": [ "+video/config", ], + # temporary + ".*webrtc_voice_engine\.cc": [ + "+pc/payload_type_picker.h", + ], } diff --git a/media/base/media_engine.h b/media/base/media_engine.h index b13d7df5bb..780bac0022 100644 --- a/media/base/media_engine.h +++ b/media/base/media_engine.h @@ -11,22 +11,27 @@ #ifndef MEDIA_BASE_MEDIA_ENGINE_H_ #define MEDIA_BASE_MEDIA_ENGINE_H_ +#include #include -#include +#include #include -#include "api/audio_codecs/audio_decoder_factory.h" -#include "api/audio_codecs/audio_encoder_factory.h" +#include "api/array_view.h" +#include "api/audio/audio_device.h" +#include "api/audio_codecs/audio_codec_pair_id.h" +#include "api/audio_options.h" #include "api/crypto/crypto_options.h" #include "api/field_trials_view.h" +#include "api/rtc_error.h" #include "api/rtp_parameters.h" +#include "api/scoped_refptr.h" #include "api/video/video_bitrate_allocator_factory.h" #include "call/audio_state.h" #include "media/base/codec.h" #include "media/base/media_channel.h" -#include "media/base/media_channel_impl.h" #include "media/base/media_config.h" -#include "media/base/video_common.h" +#include "media/base/stream_params.h" +#include "rtc_base/checks.h" #include "rtc_base/system/file_wrapper.h" namespace webrtc { @@ -121,6 +126,10 @@ class VoiceEngineInterface : public RtpHeaderExtensionQueryInterface { return nullptr; } + // Legacy: Retrieve list of supported codecs. + // + protection codecs, and assigns PT numbers that may have to be + // reassigned. + // TODO: https://issues.webrtc.org/360058654 - deprecate and remove. virtual const std::vector& send_codecs() const = 0; virtual const std::vector& recv_codecs() const = 0; @@ -166,7 +175,10 @@ class VideoEngineInterface : public RtpHeaderExtensionQueryInterface { return nullptr; } - // Retrieve list of supported codecs. + // Legacy: Retrieve list of supported codecs. + // + protection codecs, and assigns PT numbers that may have to be + // reassigned. + // TODO: https://issues.webrtc.org/360058654 - deprecate and remove. virtual std::vector send_codecs() const = 0; virtual std::vector recv_codecs() const = 0; // As above, but if include_rtx is false, don't include RTX codecs. diff --git a/pc/BUILD.gn b/pc/BUILD.gn index c4aa4de08d..5e11f04398 100644 --- a/pc/BUILD.gn +++ b/pc/BUILD.gn @@ -145,7 +145,10 @@ rtc_source_set("dtls_srtp_transport") { } rtc_source_set("dtls_transport") { - visibility = [ ":*" ] + visibility = [ + ":*", + "../test/*", + ] sources = [ "dtls_transport.cc", "dtls_transport.h", @@ -210,7 +213,6 @@ rtc_source_set("jsep_transport") { deps = [ ":dtls_srtp_transport", ":dtls_transport", - ":payload_type_picker", ":rtcp_mux_filter", ":rtp_transport", ":rtp_transport_internal", @@ -226,6 +228,7 @@ rtc_source_set("jsep_transport") { "../api:scoped_refptr", "../api:sequence_checker", "../api/transport:datagram_transport_interface", + "../call:payload_type_picker", "../media:rtc_data_sctp_transport_internal", "../p2p:dtls_transport", "../p2p:dtls_transport_internal", @@ -304,7 +307,11 @@ rtc_source_set("jsep_transport_controller") { "../api/transport:datagram_transport_interface", "../api/transport:enums", "../api/transport:sctp_transport_factory_interface", + "../call:payload_type", + "../call:payload_type_picker", + "../media:codec", "../media:rtc_data_sctp_transport_internal", + "../modules/rtp_rtcp:rtp_rtcp_format", "../p2p:connection", "../p2p:dtls_transport", "../p2p:dtls_transport_factory", @@ -331,6 +338,7 @@ rtc_source_set("jsep_transport_controller") { "../rtc_base/third_party/sigslot", "//third_party/abseil-cpp/absl/algorithm:container", "//third_party/abseil-cpp/absl/functional:any_invocable", + "//third_party/abseil-cpp/absl/strings:string_view", ] } @@ -406,19 +414,6 @@ rtc_source_set("media_stream_track_proxy") { ] } -rtc_library("payload_type_picker") { - sources = [ - "payload_type_picker.cc", - "payload_type_picker.h", - ] - deps = [ - "../api:rtc_error", - "../media:codec", - "../rtc_base:strong_alias", - "//third_party/abseil-cpp/absl/strings", - ] -} - rtc_source_set("peer_connection_factory_proxy") { visibility = [ ":*" ] sources = [ "peer_connection_factory_proxy.h" ] @@ -1084,7 +1079,6 @@ rtc_source_set("peer_connection") { ":ice_server_parsing", ":jsep_transport_controller", ":legacy_stats_collector", - ":payload_type_picker", ":peer_connection_internal", ":peer_connection_message_handler", ":rtc_stats_collector", @@ -1130,6 +1124,7 @@ rtc_source_set("peer_connection") { "../api/transport:enums", "../api/video:video_codec_constants", "../call:call_interfaces", + "../call:payload_type_picker", "../media:media_channel", "../media:media_engine", "../media:rid_description", @@ -1953,7 +1948,6 @@ if (rtc_include_tests && !build_with_chromium) { "jsep_transport_controller_unittest.cc", "jsep_transport_unittest.cc", "media_session_unittest.cc", - "payload_type_picker_unittest.cc", "rtcp_mux_filter_unittest.cc", "rtp_transport_unittest.cc", "sctp_transport_unittest.cc", @@ -1981,7 +1975,6 @@ if (rtc_include_tests && !build_with_chromium) { ":libjingle_peerconnection", ":media_protocol_names", ":media_session", - ":payload_type_picker", ":pc_test_utils", ":rtc_pc", ":rtcp_mux_filter", @@ -2017,6 +2010,7 @@ if (rtc_include_tests && !build_with_chromium) { "../api/video:builtin_video_bitrate_allocator_factory", "../api/video:recordable_encoded_frame", "../api/video/test:mock_recordable_encoded_frame", + "../call:payload_type_picker", "../call:rtp_interfaces", "../call:rtp_receiver", "../media:codec", diff --git a/pc/jsep_transport.h b/pc/jsep_transport.h index 005e6067e1..56840a3146 100644 --- a/pc/jsep_transport.h +++ b/pc/jsep_transport.h @@ -12,7 +12,6 @@ #define PC_JSEP_TRANSPORT_H_ #include -#include #include #include #include @@ -25,16 +24,13 @@ #include "api/scoped_refptr.h" #include "api/sequence_checker.h" #include "api/transport/data_channel_transport_interface.h" +#include "call/payload_type_picker.h" #include "media/sctp/sctp_transport_internal.h" -#include "p2p/base/dtls_transport.h" #include "p2p/base/dtls_transport_internal.h" #include "p2p/base/ice_transport_internal.h" -#include "p2p/base/p2p_constants.h" #include "p2p/base/transport_description.h" -#include "p2p/base/transport_info.h" #include "pc/dtls_srtp_transport.h" #include "pc/dtls_transport.h" -#include "pc/payload_type_picker.h" #include "pc/rtcp_mux_filter.h" #include "pc/rtp_transport.h" #include "pc/rtp_transport_internal.h" @@ -42,7 +38,6 @@ #include "pc/session_description.h" #include "pc/srtp_transport.h" #include "pc/transport_stats.h" -#include "rtc_base/checks.h" #include "rtc_base/rtc_certificate.h" #include "rtc_base/ssl_fingerprint.h" #include "rtc_base/ssl_stream_adapter.h" diff --git a/pc/jsep_transport_controller.h b/pc/jsep_transport_controller.h index d18a375974..2846dab115 100644 --- a/pc/jsep_transport_controller.h +++ b/pc/jsep_transport_controller.h @@ -18,11 +18,11 @@ #include #include #include -#include #include #include #include "absl/functional/any_invocable.h" +#include "absl/strings/string_view.h" #include "api/async_dns_resolver.h" #include "api/candidate.h" #include "api/crypto/crypto_options.h" @@ -37,7 +37,10 @@ #include "api/sequence_checker.h" #include "api/transport/data_channel_transport_interface.h" #include "api/transport/sctp_transport_factory_interface.h" -#include "media/sctp/sctp_transport_internal.h" +#include "call/payload_type.h" +#include "call/payload_type_picker.h" +#include "media/base/codec.h" +#include "modules/rtp_rtcp/source/rtp_packet_received.h" #include "p2p/base/dtls_transport.h" #include "p2p/base/dtls_transport_factory.h" #include "p2p/base/dtls_transport_internal.h" @@ -59,9 +62,7 @@ #include "pc/srtp_transport.h" #include "pc/transport_stats.h" #include "rtc_base/callback_list.h" -#include "rtc_base/checks.h" #include "rtc_base/copy_on_write_buffer.h" -#include "rtc_base/crypto_random.h" #include "rtc_base/rtc_certificate.h" #include "rtc_base/ssl_certificate.h" #include "rtc_base/ssl_stream_adapter.h" @@ -76,7 +77,8 @@ class PacketTransportInternal; namespace webrtc { -class JsepTransportController : public sigslot::has_slots<> { +class JsepTransportController : public PayloadTypeSuggester, + public sigslot::has_slots<> { public: // Used when the RtpTransport/DtlsTransport of the m= section is changed // because the section is rejected or BUNDLE is enabled. @@ -240,7 +242,7 @@ class JsepTransportController : public sigslot::has_slots<> { // The function will either return a PT already in use on the connection // or a newly suggested one. RTCErrorOr SuggestPayloadType(const std::string& mid, - cricket::Codec codec); + cricket::Codec codec) override; // TODO(deadbeef): GetStats isn't const because all the way down to // OpenSSLStreamAdapter, GetSslCipherSuite and GetDtlsSrtpCryptoSuite are not diff --git a/test/peer_scenario/BUILD.gn b/test/peer_scenario/BUILD.gn index dda6345653..bf1781882f 100644 --- a/test/peer_scenario/BUILD.gn +++ b/test/peer_scenario/BUILD.gn @@ -27,17 +27,23 @@ if (rtc_include_tests) { "..:fileutils", "..:frame_generator_capturer", "..:test_support", + "../../api:array_view", "../../api:candidate", "../../api:create_time_controller", "../../api:libjingle_peerconnection_api", "../../api:network_emulation_manager_api", "../../api:rtc_stats_api", + "../../api:scoped_refptr", + "../../api:sequence_checker", "../../api:time_controller", "../../api/audio_codecs:builtin_audio_decoder_factory", "../../api/audio_codecs:builtin_audio_encoder_factory", "../../api/environment", "../../api/rtc_event_log:rtc_event_log_factory", "../../api/task_queue:default_task_queue_factory", + "../../api/test/network_emulation", + "../../api/transport:datagram_transport_interface", + "../../api/transport:enums", "../../api/transport:field_trial_based_config", "../../api/video_codecs:video_decoder_factory_template", "../../api/video_codecs:video_decoder_factory_template_dav1d_adapter", @@ -49,6 +55,9 @@ if (rtc_include_tests) { "../../api/video_codecs:video_encoder_factory_template_libvpx_vp8_adapter", "../../api/video_codecs:video_encoder_factory_template_libvpx_vp9_adapter", "../../api/video_codecs:video_encoder_factory_template_open_h264_adapter", + "../../call:payload_type_picker", + "../../call:rtp_interfaces", + "../../call:rtp_receiver", "../../media:rtc_audio_video", "../../media:rtp_utils", "../../modules/audio_device:test_audio_device_module", @@ -57,13 +66,19 @@ if (rtc_include_tests) { "../../p2p:rtc_p2p", "../../p2p:transport_description", "../../pc:channel", + "../../pc:dtls_transport", "../../pc:jsep_transport_controller", "../../pc:pc_test_utils", "../../pc:rtp_transport_internal", "../../pc:session_description", + "../../rtc_base:checks", + "../../rtc_base:crypto_random", + "../../rtc_base:macromagic", "../../rtc_base:null_socket_server", + "../../rtc_base:ssl", "../../rtc_base:stringutils", "../../rtc_base:task_queue_for_test", + "../../rtc_base/third_party/sigslot", "../../test:explicit_key_value_config", "../../test:scoped_key_value_config", "../logging:log_writer", diff --git a/test/peer_scenario/scenario_connection.cc b/test/peer_scenario/scenario_connection.cc index db3a290db2..856a0929fb 100644 --- a/test/peer_scenario/scenario_connection.cc +++ b/test/peer_scenario/scenario_connection.cc @@ -9,15 +9,46 @@ */ #include "test/peer_scenario/scenario_connection.h" -#include "absl/memory/memory.h" +#include +#include +#include +#include +#include + +#include "api/array_view.h" +#include "api/candidate.h" +#include "api/environment/environment.h" +#include "api/jsep.h" +#include "api/peer_connection_interface.h" +#include "api/scoped_refptr.h" +#include "api/sequence_checker.h" +#include "api/test/network_emulation/network_emulation_interfaces.h" +#include "api/test/network_emulation_manager.h" +#include "api/transport/data_channel_transport_interface.h" +#include "api/transport/enums.h" +#include "call/payload_type_picker.h" +#include "call/rtp_demuxer.h" +#include "call/rtp_packet_sink_interface.h" #include "media/base/rtp_utils.h" #include "modules/rtp_rtcp/source/rtp_packet_received.h" +#include "p2p/base/dtls_transport_internal.h" +#include "p2p/base/p2p_constants.h" +#include "p2p/base/port_allocator.h" +#include "p2p/base/transport_description.h" #include "p2p/client/basic_port_allocator.h" -#include "pc/channel.h" +#include "pc/dtls_transport.h" #include "pc/jsep_transport_controller.h" #include "pc/rtp_transport_internal.h" #include "pc/session_description.h" +#include "rtc_base/checks.h" +#include "rtc_base/crypto_random.h" +#include "rtc_base/rtc_certificate.h" +#include "rtc_base/ssl_fingerprint.h" +#include "rtc_base/ssl_identity.h" #include "rtc_base/task_queue_for_test.h" +#include "rtc_base/third_party/sigslot/sigslot.h" +#include "rtc_base/thread_annotations.h" +#include "test/network/network_emulation_manager.h" namespace webrtc { class ScenarioIceConnectionImpl : public ScenarioIceConnection,