Chromium Code Reviews

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

Issue 2981513002: Wire up RTP keep-alive in ortc api. (Closed)
Patch Set: wip Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« no previous file with comments | « no previous file | webrtc/call/call.h » ('j') | webrtc/call/call.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/api/ortc/rtptransportinterface.h
diff --git a/webrtc/api/ortc/rtptransportinterface.h b/webrtc/api/ortc/rtptransportinterface.h
index 119d662edde283815170dbab234103ea8c763f7b..d673c503d385d4e9b2f5b8d2729834f3934896d8 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.
@@ -51,6 +52,19 @@ struct RtcpParameters {
bool operator!=(const RtcpParameters& o) const { return !(*this == o); }
};
+struct RtpTransportParameters final {
+ // 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 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.
//
@@ -85,6 +99,10 @@ class RtpTransportInterface {
// parameters (see above).
virtual RtcpParameters GetRtcpParameters() const = 0;
+ virtual RTCError SetRtpTransportParameters(
+ const RtpTransportParameters& parameters) = 0;
+ virtual RtpTransportParameters GetRtpTransportParameters() const = 0;
+
protected:
// Only for internal use. Returns a pointer to an internal interface, for use
// by the implementation.
« no previous file with comments | « no previous file | webrtc/call/call.h » ('j') | webrtc/call/call.h » ('J')

Powered by Google App Engine