Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(206)

Unified Diff: webrtc/api/ortc/rtptransportinterface.h

Issue 2981513002: Wire up RTP keep-alive in ortc api. (Closed)
Patch Set: Moved tests around Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/api/ortc/rtptransportinterface.h
diff --git a/webrtc/api/ortc/rtptransportinterface.h b/webrtc/api/ortc/rtptransportinterface.h
index 119d662edde283815170dbab234103ea8c763f7b..b992b864dc15c7f28f45d677bb1f13970cdc7f00 100644
--- a/webrtc/api/ortc/rtptransportinterface.h
+++ b/webrtc/api/ortc/rtptransportinterface.h
@@ -15,13 +15,14 @@
#include "webrtc/api/ortc/packettransportinterface.h"
#include "webrtc/api/rtcerror.h"
+#include "webrtc/common_types.h"
#include "webrtc/rtc_base/optional.h"
namespace webrtc {
class RtpTransportAdapter;
-struct RtcpParameters {
+struct RtcpParameters final {
// The SSRC to be used in the "SSRC of packet sender" field. If not set, one
// will be chosen by the implementation.
// TODO(deadbeef): Not implemented.
@@ -34,7 +35,7 @@ struct RtcpParameters {
// RtpTransports created by the same OrtcFactory will use the same generated
// CNAME.
//
- // If empty when passed into SetRtcpParameters, the CNAME simply won't be
+ // If empty when passed into SetParameters, the CNAME simply won't be
// modified.
std::string cname;
@@ -51,6 +52,21 @@ struct RtcpParameters {
bool operator!=(const RtcpParameters& o) const { return !(*this == o); }
};
+struct RtpTransportParameters final {
+ RtcpParameters rtcp;
+
+ // Enabled periodic sending of keep-alive packets, that help prevent timeouts
+ // on the network level, such as NAT bindings. See RFC6263 section 4.6.
+ RtpKeepAliveConfig keepalive;
+
+ bool operator==(const RtpTransportParameters& o) const {
+ return rtcp == o.rtcp && keepalive == o.keepalive;
+ }
+ 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.
//
@@ -74,16 +90,19 @@ class RtpTransportInterface {
// RTCP multiplexing is being used, returns null.
virtual PacketTransportInterface* GetRtcpPacketTransport() const = 0;
- // Set/get RTCP params. Can be used to enable RTCP muxing or reduced-size
- // RTCP if initially not enabled.
+ // 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.
- virtual RTCError SetRtcpParameters(const RtcpParameters& parameters) = 0;
+ // RTP keep-alive settings need to be set before creating any send-streams,
Taylor Brandstetter 2017/08/03 01:18:03 nit: Someone using this API probably doesn't know
sprang_webrtc 2017/08/03 13:08:14 How about changing "send stream" to "media channel
Taylor Brandstetter 2017/08/03 16:50:36 Again, we don't define what a "media channel" is i
sprang_webrtc 2017/08/07 10:39:36 Alright, "before an RtpSender has started sending"
+ // altering the payload type or timeout interval after this point is not
+ // supported.
+ 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 RtcpParameters GetRtcpParameters() const = 0;
+ virtual RtpTransportParameters GetParameters() const = 0;
protected:
// Only for internal use. Returns a pointer to an internal interface, for use

Powered by Google App Engine
This is Rietveld 408576698