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

Unified Diff: webrtc/ortc/rtptransportcontrolleradapter.cc

Issue 2981513002: Wire up RTP keep-alive in ortc api. (Closed)
Patch Set: Test 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/rtptransportcontrolleradapter.cc
diff --git a/webrtc/ortc/rtptransportcontrolleradapter.cc b/webrtc/ortc/rtptransportcontrolleradapter.cc
index 5e0b62112357ba849fec33d5e3428e1e5c235932..89fd53e0df111270f36a914b6b0a79388a9e3d9a 100644
--- a/webrtc/ortc/rtptransportcontrolleradapter.cc
+++ b/webrtc/ortc/rtptransportcontrolleradapter.cc
@@ -129,11 +129,10 @@ RtpTransportControllerAdapter::~RtpTransportControllerAdapter() {
RTCErrorOr<std::unique_ptr<RtpTransportInterface>>
RtpTransportControllerAdapter::CreateProxiedRtpTransport(
- const RtcpParameters& rtcp_parameters,
+ const RtpTransportParameters& parameters,
PacketTransportInterface* rtp,
PacketTransportInterface* rtcp) {
- auto result =
- RtpTransportAdapter::CreateProxied(rtcp_parameters, rtp, rtcp, this);
+ auto result = RtpTransportAdapter::CreateProxied(parameters, rtp, rtcp, this);
if (result.ok()) {
transport_proxies_.push_back(result.value().get());
transport_proxies_.back()->GetInternal()->SignalDestroyed.connect(
@@ -144,11 +143,11 @@ RtpTransportControllerAdapter::CreateProxiedRtpTransport(
RTCErrorOr<std::unique_ptr<SrtpTransportInterface>>
RtpTransportControllerAdapter::CreateProxiedSrtpTransport(
- const RtcpParameters& rtcp_parameters,
+ const RtpTransportParameters& parameters,
PacketTransportInterface* rtp,
PacketTransportInterface* rtcp) {
auto result =
- RtpTransportAdapter::CreateSrtpProxied(rtcp_parameters, rtp, rtcp, this);
+ RtpTransportAdapter::CreateSrtpProxied(parameters, rtp, rtcp, this);
if (result.ok()) {
transport_proxies_.push_back(result.value().get());
transport_proxies_.back()->GetInternal()->SignalDestroyed.connect(
@@ -219,12 +218,17 @@ RtpTransportControllerAdapter::GetTransports() const {
return transport_proxies_;
}
-RTCError RtpTransportControllerAdapter::SetRtcpParameters(
- const RtcpParameters& parameters,
+RTCError RtpTransportControllerAdapter::SetRtpTransportAndRtcpParameters(
+ const RtpTransportParameters& parameters,
RtpTransportInterface* inner_transport) {
+ if (!call_->SetRtpKeepAliveConfig(parameters.keepalive)) {
+ LOG_AND_RETURN_ERROR(RTCErrorType::INTERNAL_ERROR,
+ "Failed to apply new RTP transport parameters.");
+ }
do {
if (inner_transport == inner_audio_transport_) {
- CopyRtcpParametersToDescriptions(parameters, &local_audio_description_,
+ CopyRtcpParametersToDescriptions(parameters.rtcp,
+ &local_audio_description_,
&remote_audio_description_);
if (!voice_channel_->SetLocalContent(&local_audio_description_,
cricket::CA_OFFER, nullptr)) {
@@ -235,7 +239,8 @@ RTCError RtpTransportControllerAdapter::SetRtcpParameters(
break;
}
} else if (inner_transport == inner_video_transport_) {
- CopyRtcpParametersToDescriptions(parameters, &local_video_description_,
+ CopyRtcpParametersToDescriptions(parameters.rtcp,
+ &local_video_description_,
&remote_video_description_);
if (!video_channel_->SetLocalContent(&local_video_description_,
cricket::CA_OFFER, nullptr)) {
@@ -270,7 +275,7 @@ RTCError RtpTransportControllerAdapter::ValidateAndApplyAudioSenderParameters(
}
auto stream_params_result = MakeSendStreamParamsVec(
- parameters.encodings, inner_audio_transport_->GetRtcpParameters().cname,
+ parameters.encodings, inner_audio_transport_->GetParameters().rtcp.cname,
local_audio_description_);
if (!stream_params_result.ok()) {
return stream_params_result.MoveError();
@@ -359,7 +364,7 @@ RTCError RtpTransportControllerAdapter::ValidateAndApplyVideoSenderParameters(
}
auto stream_params_result = MakeSendStreamParamsVec(
- parameters.encodings, inner_video_transport_->GetRtcpParameters().cname,
+ parameters.encodings, inner_video_transport_->GetParameters().rtcp.cname,
local_video_description_);
if (!stream_params_result.ok()) {
return stream_params_result.MoveError();
@@ -656,7 +661,7 @@ RTCError RtpTransportControllerAdapter::AttachAudioSender(
// If setting new transport, extract its RTCP parameters and create voice
// channel.
if (!inner_audio_transport_) {
- CopyRtcpParametersToDescriptions(inner_transport->GetRtcpParameters(),
+ CopyRtcpParametersToDescriptions(inner_transport->GetParameters().rtcp,
&local_audio_description_,
&remote_audio_description_);
inner_audio_transport_ = inner_transport;
@@ -691,7 +696,7 @@ RTCError RtpTransportControllerAdapter::AttachVideoSender(
// If setting new transport, extract its RTCP parameters and create video
// channel.
if (!inner_video_transport_) {
- CopyRtcpParametersToDescriptions(inner_transport->GetRtcpParameters(),
+ CopyRtcpParametersToDescriptions(inner_transport->GetParameters().rtcp,
&local_video_description_,
&remote_video_description_);
inner_video_transport_ = inner_transport;
@@ -726,7 +731,7 @@ RTCError RtpTransportControllerAdapter::AttachAudioReceiver(
// If setting new transport, extract its RTCP parameters and create voice
// channel.
if (!inner_audio_transport_) {
- CopyRtcpParametersToDescriptions(inner_transport->GetRtcpParameters(),
+ CopyRtcpParametersToDescriptions(inner_transport->GetParameters().rtcp,
&local_audio_description_,
&remote_audio_description_);
inner_audio_transport_ = inner_transport;
@@ -761,7 +766,7 @@ RTCError RtpTransportControllerAdapter::AttachVideoReceiver(
// If setting new transport, extract its RTCP parameters and create video
// channel.
if (!inner_video_transport_) {
- CopyRtcpParametersToDescriptions(inner_transport->GetRtcpParameters(),
+ CopyRtcpParametersToDescriptions(inner_transport->GetParameters().rtcp,
&local_video_description_,
&remote_video_description_);
inner_video_transport_ = inner_transport;

Powered by Google App Engine
This is Rietveld 408576698