Delete the remaining ORTC interfaces.
These are unused except in tests, and just add clutter.
Bug: webrtc:9824
Change-Id: Ica209d09850f5ff9b122ce21306aaf1bbfc7bda4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/138280
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Commit-Queue: Bjorn Mellem <mellem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28064}
diff --git a/api/BUILD.gn b/api/BUILD.gn
index dc83db9..375cf9d 100644
--- a/api/BUILD.gn
+++ b/api/BUILD.gn
@@ -368,21 +368,6 @@
]
}
-rtc_source_set("ortc_api") {
- visibility = [ "*" ]
- sources = [
- "ortc/packet_transport_interface.h",
- "ortc/rtp_transport_interface.h",
- "ortc/srtp_transport_interface.h",
- ]
-
- deps = [
- ":libjingle_peerconnection_api",
- ":rtp_headers",
- "//third_party/abseil-cpp/absl/types:optional",
- ]
-}
-
rtc_source_set("rtc_stats_api") {
visibility = [ "*" ]
cflags = []
diff --git a/api/ortc/packet_transport_interface.h b/api/ortc/packet_transport_interface.h
deleted file mode 100644
index 78e280a..0000000
--- a/api/ortc/packet_transport_interface.h
+++ /dev/null
@@ -1,38 +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_ORTC_PACKET_TRANSPORT_INTERFACE_H_
-#define API_ORTC_PACKET_TRANSPORT_INTERFACE_H_
-
-namespace rtc {
-
-class PacketTransportInternal;
-
-} // namespace rtc
-
-namespace webrtc {
-
-// Base class for different packet-based transports.
-class PacketTransportInterface {
- public:
- virtual ~PacketTransportInterface() {}
-
- protected:
- // Only for internal use. Returns a pointer to an internal interface, for use
- // by the implementation.
- virtual rtc::PacketTransportInternal* GetInternal() = 0;
-
- // Classes that can use this internal interface.
- friend class RtpTransportControllerAdapter;
-};
-
-} // namespace webrtc
-
-#endif // API_ORTC_PACKET_TRANSPORT_INTERFACE_H_
diff --git a/api/ortc/rtp_transport_interface.h b/api/ortc/rtp_transport_interface.h
deleted file mode 100644
index 2e16885..0000000
--- a/api/ortc/rtp_transport_interface.h
+++ /dev/null
@@ -1,83 +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_ORTC_RTP_TRANSPORT_INTERFACE_H_
-#define API_ORTC_RTP_TRANSPORT_INTERFACE_H_
-
-#include <string>
-
-#include "absl/types/optional.h"
-#include "api/ortc/packet_transport_interface.h"
-#include "api/rtc_error.h"
-#include "api/rtp_headers.h"
-#include "api/rtp_parameters.h"
-
-namespace webrtc {
-
-struct RtpTransportParameters final {
- RtcpParameters rtcp;
-
- bool operator==(const RtpTransportParameters& o) const {
- return rtcp == o.rtcp;
- }
- bool operator!=(const RtpTransportParameters& o) const {
- return !(*this == o);
- }
-};
-
-// Base class for different types of RTP transports that can be created by an
-// OrtcFactory. Used by RtpSenders/RtpReceivers.
-//
-// This is not present in the standard ORTC API, but exists here for a few
-// reasons. Firstly, it allows different types of RTP transports to be used:
-// DTLS-SRTP (which is required for the web), but also SDES-SRTP and
-// unencrypted RTP. It also simplifies the handling of RTCP muxing, and
-// provides a better API point for it.
-//
-// Note that Edge's implementation of ORTC provides a similar API point, called
-// RTCSrtpSdesTransport:
-// https://msdn.microsoft.com/en-us/library/mt502527(v=vs.85).aspx
-class RtpTransportInterface {
- public:
- virtual ~RtpTransportInterface() {}
-
- // Returns packet transport that's used to send RTP packets.
- virtual PacketTransportInterface* GetRtpPacketTransport() const = 0;
-
- // Returns separate packet transport that's used to send RTCP packets. If
- // RTCP multiplexing is being used, returns null.
- virtual PacketTransportInterface* GetRtcpPacketTransport() const = 0;
-
- // Set/get RTP/RTCP transport params. Can be used to enable RTCP muxing or
- // reduced-size RTCP if initially not enabled.
- //
- // Changing |mux| from "true" to "false" is not allowed, and changing the
- // CNAME is currently unsupported.
- // RTP keep-alive settings need to be set before before an RtpSender has
- // started sending, altering the payload type or timeout interval after this
- // point is not supported. The parameters must also match across all RTP
- // transports for a given RTP transport controller.
- virtual RTCError SetParameters(const RtpTransportParameters& parameters) = 0;
- // Returns last set or constructed-with parameters. If |cname| was empty in
- // construction, the generated CNAME will be present in the returned
- // parameters (see above).
- virtual RtpTransportParameters GetParameters() const = 0;
-
- protected:
- // Classes that can use this internal interface.
- friend class OrtcFactory;
- friend class OrtcRtpSenderAdapter;
- friend class OrtcRtpReceiverAdapter;
- friend class RtpTransportControllerAdapter;
-};
-
-} // namespace webrtc
-
-#endif // API_ORTC_RTP_TRANSPORT_INTERFACE_H_
diff --git a/api/ortc/srtp_transport_interface.h b/api/ortc/srtp_transport_interface.h
deleted file mode 100644
index 65ef1ef..0000000
--- a/api/ortc/srtp_transport_interface.h
+++ /dev/null
@@ -1,48 +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_ORTC_SRTP_TRANSPORT_INTERFACE_H_
-#define API_ORTC_SRTP_TRANSPORT_INTERFACE_H_
-
-#include "api/crypto_params.h"
-#include "api/ortc/rtp_transport_interface.h"
-#include "api/rtc_error.h"
-
-namespace webrtc {
-
-// The subclass of the RtpTransport which uses SRTP. The keying information
-// is explicitly passed in from the application.
-//
-// If using SDP and SDES (RFC4568) for signaling, then after applying the
-// answer, the negotiated keying information from the offer and answer would be
-// set and the SRTP would be active.
-//
-// Note that Edge's implementation of ORTC provides a similar API point, called
-// RTCSrtpSdesTransport:
-// https://msdn.microsoft.com/en-us/library/mt502527(v=vs.85).aspx
-class SrtpTransportInterface : public RtpTransportInterface {
- public:
- virtual ~SrtpTransportInterface() {}
-
- // There are some limitations of the current implementation:
- // 1. Send and receive keys must use the same crypto suite.
- // 2. The keys can't be changed after initially set.
- // 3. The keys must be set before creating a sender/receiver using the SRTP
- // transport.
- // Set the SRTP keying material for sending RTP and RTCP.
- virtual RTCError SetSrtpSendKey(const cricket::CryptoParams& params) = 0;
-
- // Set the SRTP keying material for receiving RTP and RTCP.
- virtual RTCError SetSrtpReceiveKey(const cricket::CryptoParams& params) = 0;
-};
-
-} // namespace webrtc
-
-#endif // API_ORTC_SRTP_TRANSPORT_INTERFACE_H_
diff --git a/p2p/BUILD.gn b/p2p/BUILD.gn
index e404896..c389e81 100644
--- a/p2p/BUILD.gn
+++ b/p2p/BUILD.gn
@@ -87,7 +87,6 @@
deps = [
"../api:libjingle_peerconnection_api",
- "../api:ortc_api",
"../api:scoped_refptr",
"../api/transport:enums",
"../logging:ice_log",
@@ -159,7 +158,6 @@
":p2p_server_utils",
":rtc_p2p",
"../api:libjingle_peerconnection_api",
- "../api:ortc_api",
"../rtc_base",
"../rtc_base:gunit_helpers",
"../rtc_base:rtc_base_approved",
@@ -205,7 +203,6 @@
":p2p_test_utils",
":rtc_p2p",
"../api:libjingle_peerconnection_api",
- "../api:ortc_api",
"../api:scoped_refptr",
"../api/units:time_delta",
"../rtc_base",
diff --git a/p2p/base/fake_packet_transport.h b/p2p/base/fake_packet_transport.h
index 6f79aad..f59aa39 100644
--- a/p2p/base/fake_packet_transport.h
+++ b/p2p/base/fake_packet_transport.h
@@ -13,7 +13,6 @@
#include <string>
-#include "api/ortc/packet_transport_interface.h"
#include "p2p/base/packet_transport_internal.h"
#include "rtc_base/async_invoker.h"
#include "rtc_base/copy_on_write_buffer.h"
diff --git a/p2p/base/packet_transport_internal.cc b/p2p/base/packet_transport_internal.cc
index 8fda899..0904cb2 100644
--- a/p2p/base/packet_transport_internal.cc
+++ b/p2p/base/packet_transport_internal.cc
@@ -16,10 +16,6 @@
PacketTransportInternal::~PacketTransportInternal() = default;
-PacketTransportInternal* PacketTransportInternal::GetInternal() {
- return this;
-}
-
bool PacketTransportInternal::GetOption(rtc::Socket::Option opt, int* value) {
return false;
}
diff --git a/p2p/base/packet_transport_internal.h b/p2p/base/packet_transport_internal.h
index 24723e9..a532183 100644
--- a/p2p/base/packet_transport_internal.h
+++ b/p2p/base/packet_transport_internal.h
@@ -15,8 +15,6 @@
#include <vector>
#include "absl/types/optional.h"
-// This is included for PacketOptions.
-#include "api/ortc/packet_transport_interface.h"
#include "p2p/base/port.h"
#include "rtc_base/async_packet_socket.h"
#include "rtc_base/network_route.h"
@@ -28,9 +26,7 @@
struct PacketOptions;
struct SentPacket;
-class RTC_EXPORT PacketTransportInternal
- : public virtual webrtc::PacketTransportInterface,
- public sigslot::has_slots<> {
+class RTC_EXPORT PacketTransportInternal : public sigslot::has_slots<> {
public:
virtual const std::string& transport_name() const = 0;
@@ -102,8 +98,6 @@
protected:
PacketTransportInternal();
~PacketTransportInternal() override;
-
- PacketTransportInternal* GetInternal() override;
};
} // namespace rtc
diff --git a/pc/BUILD.gn b/pc/BUILD.gn
index 62a8186..120d3f8 100644
--- a/pc/BUILD.gn
+++ b/pc/BUILD.gn
@@ -77,7 +77,6 @@
"../api:audio_options_api",
"../api:call_api",
"../api:libjingle_peerconnection_api",
- "../api:ortc_api",
"../api:rtp_headers",
"../api:scoped_refptr",
"../api/video:builtin_video_bitrate_allocator_factory",
diff --git a/pc/rtp_transport.cc b/pc/rtp_transport.cc
index e6129b5..b7d3a9d 100644
--- a/pc/rtp_transport.cc
+++ b/pc/rtp_transport.cc
@@ -164,26 +164,6 @@
return true;
}
-RTCError RtpTransport::SetParameters(const RtpTransportParameters& parameters) {
- if (parameters_.rtcp.mux && !parameters.rtcp.mux) {
- LOG_AND_RETURN_ERROR(RTCErrorType::INVALID_STATE,
- "Disabling RTCP muxing is not allowed.");
- }
-
- RtpTransportParameters new_parameters = parameters;
-
- if (new_parameters.rtcp.cname.empty()) {
- new_parameters.rtcp.cname = parameters_.rtcp.cname;
- }
-
- parameters_ = new_parameters;
- return RTCError::OK();
-}
-
-RtpTransportParameters RtpTransport::GetParameters() const {
- return parameters_;
-}
-
void RtpTransport::DemuxPacket(rtc::CopyOnWriteBuffer packet,
int64_t packet_time_us) {
webrtc::RtpPacketReceived parsed_packet(&header_extension_map_);
diff --git a/pc/rtp_transport.h b/pc/rtp_transport.h
index 4573d3c..269a61a 100644
--- a/pc/rtp_transport.h
+++ b/pc/rtp_transport.h
@@ -49,17 +49,6 @@
}
void SetRtcpPacketTransport(rtc::PacketTransportInternal* rtcp) override;
- PacketTransportInterface* GetRtpPacketTransport() const override {
- return rtp_packet_transport_;
- }
- PacketTransportInterface* GetRtcpPacketTransport() const override {
- return rtcp_packet_transport_;
- }
-
- // TODO(zstein): Use these RtcpParameters for configuration elsewhere.
- RTCError SetParameters(const RtpTransportParameters& parameters) override;
- RtpTransportParameters GetParameters() const override;
-
bool IsReadyToSend() const override { return ready_to_send_; }
bool IsWritable(bool rtcp) const override;
@@ -119,18 +108,6 @@
bool IsTransportWritable();
- // SRTP specific methods.
- // TODO(zhihuang): Improve the inheritance model so that the RtpTransport
- // doesn't need to implement SRTP specfic methods.
- RTCError SetSrtpSendKey(const cricket::CryptoParams& params) override {
- RTC_NOTREACHED();
- return RTCError::OK();
- }
- RTCError SetSrtpReceiveKey(const cricket::CryptoParams& params) override {
- RTC_NOTREACHED();
- return RTCError::OK();
- }
-
bool rtcp_mux_enabled_;
rtc::PacketTransportInternal* rtp_packet_transport_ = nullptr;
@@ -140,7 +117,6 @@
bool rtp_ready_to_send_ = false;
bool rtcp_ready_to_send_ = false;
- RtpTransportParameters parameters_;
RtpDemuxer rtp_demuxer_;
// Used for identifying the MID for RtpDemuxer.
diff --git a/pc/rtp_transport_internal.h b/pc/rtp_transport_internal.h
index f8a5f2b..fce1f9b 100644
--- a/pc/rtp_transport_internal.h
+++ b/pc/rtp_transport_internal.h
@@ -13,7 +13,6 @@
#include <string>
-#include "api/ortc/srtp_transport_interface.h"
#include "call/rtp_demuxer.h"
#include "p2p/base/ice_transport_internal.h"
#include "pc/session_description.h"
@@ -32,9 +31,10 @@
// it is not accessible to API consumers but is accessible to internal classes
// in order to send and receive RTP and RTCP packets belonging to a single RTP
// session. Additional convenience and configuration methods are also provided.
-class RtpTransportInternal : public SrtpTransportInterface,
- public sigslot::has_slots<> {
+class RtpTransportInternal : public sigslot::has_slots<> {
public:
+ virtual ~RtpTransportInternal() = default;
+
virtual void SetRtcpMuxEnabled(bool enable) = 0;
// TODO(zstein): Remove PacketTransport setters. Clients should pass these
diff --git a/pc/rtp_transport_unittest.cc b/pc/rtp_transport_unittest.cc
index 54f182d..4248ba7 100644
--- a/pc/rtp_transport_unittest.cc
+++ b/pc/rtp_transport_unittest.cc
@@ -31,27 +31,6 @@
constexpr int kLastPacketId = 100;
constexpr int kTransportOverheadPerPacket = 28; // Ipv4(20) + UDP(8).
-TEST(RtpTransportTest, SetRtcpParametersCantDisableRtcpMux) {
- RtpTransport transport(kMuxDisabled);
- RtpTransportParameters params;
- transport.SetParameters(params);
- params.rtcp.mux = false;
- EXPECT_FALSE(transport.SetParameters(params).ok());
-}
-
-TEST(RtpTransportTest, SetRtcpParametersEmptyCnameUsesExisting) {
- static const char kName[] = "name";
- RtpTransport transport(kMuxDisabled);
- RtpTransportParameters params_with_name;
- params_with_name.rtcp.cname = kName;
- transport.SetParameters(params_with_name);
- EXPECT_EQ(transport.GetParameters().rtcp.cname, kName);
-
- RtpTransportParameters params_without_name;
- transport.SetParameters(params_without_name);
- EXPECT_EQ(transport.GetParameters().rtcp.cname, kName);
-}
-
class SignalObserver : public sigslot::has_slots<> {
public:
explicit SignalObserver(RtpTransport* transport) {
diff --git a/pc/srtp_transport.h b/pc/srtp_transport.h
index e725733..ed92379 100644
--- a/pc/srtp_transport.h
+++ b/pc/srtp_transport.h
@@ -40,8 +40,8 @@
virtual ~SrtpTransport() = default;
// SrtpTransportInterface specific implementation.
- RTCError SetSrtpSendKey(const cricket::CryptoParams& params) override;
- RTCError SetSrtpReceiveKey(const cricket::CryptoParams& params) override;
+ virtual RTCError SetSrtpSendKey(const cricket::CryptoParams& params);
+ virtual RTCError SetSrtpReceiveKey(const cricket::CryptoParams& params);
bool SendRtpPacket(rtc::CopyOnWriteBuffer* packet,
const rtc::PacketOptions& options,