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

Unified Diff: webrtc/ortc/rtptransportcontrolleradapter.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/rtptransportcontrolleradapter.cc
diff --git a/webrtc/ortc/rtptransportcontrolleradapter.cc b/webrtc/ortc/rtptransportcontrolleradapter.cc
index 5e0b62112357ba849fec33d5e3428e1e5c235932..2f39bf75efca72f0580a0e1104354650097dc690 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(
@@ -252,6 +251,15 @@ RTCError RtpTransportControllerAdapter::SetRtcpParameters(
"Failed to apply new RTCP parameters.");
}
+RTCError RtpTransportControllerAdapter::SetRtpTransportParameters(
+ const RtpTransportParameters& parameters) {
+ if (!call_->SetRtpKeepAliveConfig(parameters.keepalive)) {
+ LOG_AND_RETURN_ERROR(RTCErrorType::INTERNAL_ERROR,
+ "Failed to apply new RTP transport parameters.");
+ }
+ return RTCError::OK();
+}
+
RTCError RtpTransportControllerAdapter::ValidateAndApplyAudioSenderParameters(
const RtpParameters& parameters,
uint32_t* primary_ssrc) {
@@ -270,7 +278,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 +367,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 +664,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 +699,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 +734,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 +769,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