Move the payload type picker to call/
Since media/ and pc/ both have to use this, and both depend on call/, this seems to be the right place to put it. Also factor out the interface that media will use in a separate interface class. Bug: webrtc:360058654 Change-Id: I34acbecc618f23e19542ce4b0110d0e8ed9e55ee Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/361281 Commit-Queue: Harald Alvestrand <hta@webrtc.org> Reviewed-by: Florent Castelli <orphis@webrtc.org> Auto-Submit: Harald Alvestrand <hta@webrtc.org> Cr-Commit-Position: refs/heads/main@{#42933}
This commit is contained in:
parent
682f7945d5
commit
c17ca01f54
@ -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",
|
||||
|
||||
18
call/DEPS
18
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",
|
||||
]
|
||||
}
|
||||
|
||||
50
call/call.cc
50
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<PayloadType> 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<int, int>& 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<RtpTransportControllerSendInterface> 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<PayloadTypeSuggesterForTests> 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<rtc::SentPacket> 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<RtpTransportControllerSendInterface> 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<PayloadTypeSuggesterForTests>();
|
||||
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_);
|
||||
|
||||
|
||||
14
call/call.h
14
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;
|
||||
|
||||
44
call/payload_type.h
Normal file
44
call/payload_type.h
Normal file
@ -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 <cstdint>
|
||||
#include <string>
|
||||
|
||||
#include "api/rtc_error.h"
|
||||
#include "media/base/codec.h"
|
||||
#include "rtc_base/strong_alias.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
class PayloadType : public StrongAlias<class PayloadTypeTag, uint8_t> {
|
||||
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<PayloadType> SuggestPayloadType(const std::string& mid,
|
||||
cricket::Codec codec) = 0;
|
||||
};
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // CALL_PAYLOAD_TYPE_H_
|
||||
@ -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 <algorithm>
|
||||
#include <set>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#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 {
|
||||
|
||||
@ -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 <map>
|
||||
#include <set>
|
||||
@ -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<class PayloadTypeTag, uint8_t> {
|
||||
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_
|
||||
@ -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 {
|
||||
@ -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",
|
||||
|
||||
@ -34,4 +34,8 @@ specific_include_rules = {
|
||||
".*fake_webrtc_call\.cc": [
|
||||
"+video/config",
|
||||
],
|
||||
# temporary
|
||||
".*webrtc_voice_engine\.cc": [
|
||||
"+pc/payload_type_picker.h",
|
||||
],
|
||||
}
|
||||
|
||||
@ -11,22 +11,27 @@
|
||||
#ifndef MEDIA_BASE_MEDIA_ENGINE_H_
|
||||
#define MEDIA_BASE_MEDIA_ENGINE_H_
|
||||
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <optional>
|
||||
#include <vector>
|
||||
|
||||
#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<Codec>& send_codecs() const = 0;
|
||||
virtual const std::vector<Codec>& 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<Codec> send_codecs() const = 0;
|
||||
virtual std::vector<Codec> recv_codecs() const = 0;
|
||||
// As above, but if include_rtx is false, don't include RTX codecs.
|
||||
|
||||
30
pc/BUILD.gn
30
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",
|
||||
|
||||
@ -12,7 +12,6 @@
|
||||
#define PC_JSEP_TRANSPORT_H_
|
||||
|
||||
#include <functional>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
@ -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"
|
||||
|
||||
@ -18,11 +18,11 @@
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#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<PayloadType> 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
|
||||
|
||||
@ -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",
|
||||
|
||||
@ -9,15 +9,46 @@
|
||||
*/
|
||||
#include "test/peer_scenario/scenario_connection.h"
|
||||
|
||||
#include "absl/memory/memory.h"
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#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,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user