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

Unified Diff: webrtc/ortc/rtptransportadapter.cc

Issue 2981513002: Wire up RTP keep-alive in ortc api. (Closed)
Patch Set: Moved RtcpParameters into RtpTransportParameters Created 3 years, 5 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/ortc/rtptransportadapter.cc
diff --git a/webrtc/ortc/rtptransportadapter.cc b/webrtc/ortc/rtptransportadapter.cc
index 1154ff629b87367fadefdbe2fe527322d2465a95..94bb8d2db905683a3b11a84a5e2c43c1357f6cfa 100644
--- a/webrtc/ortc/rtptransportadapter.cc
+++ b/webrtc/ortc/rtptransportadapter.cc
@@ -24,8 +24,8 @@ BEGIN_OWNED_PROXY_MAP(RtpTransport)
PROXY_SIGNALING_THREAD_DESTRUCTOR()
PROXY_CONSTMETHOD0(PacketTransportInterface*, GetRtpPacketTransport)
PROXY_CONSTMETHOD0(PacketTransportInterface*, GetRtcpPacketTransport)
-PROXY_METHOD1(RTCError, SetRtcpParameters, const RtcpParameters&)
-PROXY_CONSTMETHOD0(RtcpParameters, GetRtcpParameters)
+PROXY_METHOD1(RTCError, SetParameters, const RtpTransportParameters&)
+PROXY_CONSTMETHOD0(RtpTransportParameters, GetParameters)
protected:
RtpTransportAdapter* GetInternal() override {
return internal();
@@ -36,8 +36,8 @@ BEGIN_OWNED_PROXY_MAP(SrtpTransport)
PROXY_SIGNALING_THREAD_DESTRUCTOR()
PROXY_CONSTMETHOD0(PacketTransportInterface*, GetRtpPacketTransport)
PROXY_CONSTMETHOD0(PacketTransportInterface*, GetRtcpPacketTransport)
-PROXY_METHOD1(RTCError, SetRtcpParameters, const RtcpParameters&)
-PROXY_CONSTMETHOD0(RtcpParameters, GetRtcpParameters)
+PROXY_METHOD1(RTCError, SetParameters, const RtpTransportParameters&)
+PROXY_CONSTMETHOD0(RtpTransportParameters, GetParameters)
PROXY_METHOD1(RTCError, SetSrtpSendKey, const cricket::CryptoParams&)
PROXY_METHOD1(RTCError, SetSrtpReceiveKey, const cricket::CryptoParams&)
protected:
@@ -49,7 +49,7 @@ END_PROXY_MAP()
// static
RTCErrorOr<std::unique_ptr<RtpTransportInterface>>
RtpTransportAdapter::CreateProxied(
- const RtcpParameters& rtcp_parameters,
+ const RtpTransportParameters& parameters,
PacketTransportInterface* rtp,
PacketTransportInterface* rtcp,
RtpTransportControllerAdapter* rtp_transport_controller) {
@@ -57,12 +57,12 @@ RtpTransportAdapter::CreateProxied(
LOG_AND_RETURN_ERROR(RTCErrorType::INVALID_PARAMETER,
"Must provide an RTP packet transport.");
}
- if (!rtcp_parameters.mux && !rtcp) {
+ if (!parameters.rtcp.mux && !rtcp) {
LOG_AND_RETURN_ERROR(
RTCErrorType::INVALID_PARAMETER,
"Must provide an RTCP packet transport when RTCP muxing is not used.");
}
- if (rtcp_parameters.mux && rtcp) {
+ if (parameters.rtcp.mux && rtcp) {
LOG_AND_RETURN_ERROR(RTCErrorType::INVALID_PARAMETER,
"Creating an RtpTransport with RTCP muxing enabled, "
"with a separate RTCP packet transport?");
@@ -78,13 +78,13 @@ RtpTransportAdapter::CreateProxied(
rtp_transport_controller->signaling_thread(),
rtp_transport_controller->worker_thread(),
std::unique_ptr<RtpTransportAdapter>(new RtpTransportAdapter(
- rtcp_parameters, rtp, rtcp, rtp_transport_controller,
+ parameters, rtp, rtcp, rtp_transport_controller,
/*is_srtp_transport*/ false)));
}
RTCErrorOr<std::unique_ptr<SrtpTransportInterface>>
RtpTransportAdapter::CreateSrtpProxied(
- const RtcpParameters& rtcp_parameters,
+ const RtpTransportParameters& parameters,
PacketTransportInterface* rtp,
PacketTransportInterface* rtcp,
RtpTransportControllerAdapter* rtp_transport_controller) {
@@ -92,12 +92,12 @@ RtpTransportAdapter::CreateSrtpProxied(
LOG_AND_RETURN_ERROR(RTCErrorType::INVALID_PARAMETER,
"Must provide an RTP packet transport.");
}
- if (!rtcp_parameters.mux && !rtcp) {
+ if (!parameters.rtcp.mux && !rtcp) {
LOG_AND_RETURN_ERROR(
RTCErrorType::INVALID_PARAMETER,
"Must provide an RTCP packet transport when RTCP muxing is not used.");
}
- if (rtcp_parameters.mux && rtcp) {
+ if (parameters.rtcp.mux && rtcp) {
LOG_AND_RETURN_ERROR(RTCErrorType::INVALID_PARAMETER,
"Creating an RtpTransport with RTCP muxing enabled, "
"with a separate RTCP packet transport?");
@@ -113,7 +113,7 @@ RtpTransportAdapter::CreateSrtpProxied(
rtp_transport_controller->signaling_thread(),
rtp_transport_controller->worker_thread(),
std::unique_ptr<RtpTransportAdapter>(new RtpTransportAdapter(
- rtcp_parameters, rtp, rtcp, rtp_transport_controller,
+ parameters, rtp, rtcp, rtp_transport_controller,
/*is_srtp_transport*/ true)));
}
@@ -125,7 +125,7 @@ void RtpTransportAdapter::TakeOwnershipOfRtpTransportController(
}
RtpTransportAdapter::RtpTransportAdapter(
- const RtcpParameters& rtcp_parameters,
+ const RtpTransportParameters& parameters,
PacketTransportInterface* rtp,
PacketTransportInterface* rtcp,
RtpTransportControllerAdapter* rtp_transport_controller,
@@ -133,11 +133,11 @@ RtpTransportAdapter::RtpTransportAdapter(
: rtp_packet_transport_(rtp),
rtcp_packet_transport_(rtcp),
rtp_transport_controller_(rtp_transport_controller),
- rtcp_parameters_(rtcp_parameters),
+ parameters_(parameters),
is_srtp_transport_(is_srtp_transport) {
RTC_DCHECK(rtp_transport_controller);
// CNAME should have been filled by OrtcFactory if empty.
- RTC_DCHECK(!rtcp_parameters_.cname.empty());
+ RTC_DCHECK(!parameters_.rtcp.cname.empty());
}
RtpTransportAdapter::~RtpTransportAdapter() {
@@ -152,27 +152,28 @@ PacketTransportInterface* RtpTransportAdapter::GetRtcpPacketTransport() const {
return rtcp_packet_transport_;
}
-RTCError RtpTransportAdapter::SetRtcpParameters(
- const RtcpParameters& parameters) {
- if (!parameters.mux && rtcp_parameters_.mux) {
+RTCError RtpTransportAdapter::SetParameters(
+ const RtpTransportParameters& parameters) {
+ if (!parameters.rtcp.mux && parameters_.rtcp.mux) {
LOG_AND_RETURN_ERROR(webrtc::RTCErrorType::INVALID_STATE,
"Can't disable RTCP muxing after enabling.");
}
- if (!parameters.cname.empty() && parameters.cname != rtcp_parameters_.cname) {
+ if (!parameters.rtcp.cname.empty() &&
+ parameters.rtcp.cname != parameters_.rtcp.cname) {
LOG_AND_RETURN_ERROR(webrtc::RTCErrorType::UNSUPPORTED_OPERATION,
"Changing the RTCP CNAME is currently unsupported.");
}
// If the CNAME is empty, use the existing one.
- RtcpParameters copy = parameters;
- if (copy.cname.empty()) {
- copy.cname = rtcp_parameters_.cname;
+ RtpTransportParameters copy = parameters;
+ if (copy.rtcp.cname.empty()) {
+ copy.rtcp.cname = parameters_.rtcp.cname;
}
- RTCError err = rtp_transport_controller_->SetRtcpParameters(copy, this);
+ RTCError err = rtp_transport_controller_->SetRtcpParameters(copy.rtcp, this);
if (!err.ok()) {
return err;
}
- rtcp_parameters_ = copy;
- if (rtcp_parameters_.mux) {
+ parameters_ = copy;
+ if (parameters_.rtcp.mux) {
rtcp_packet_transport_ = nullptr;
}
return RTCError::OK();

Powered by Google App Engine
This is Rietveld 408576698