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

Side by Side Diff: webrtc/pc/rtptransport.cc

Issue 2981513002: Wire up RTP keep-alive in ortc api. (Closed)
Patch Set: deps, again 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 unified diff | Download patch
« no previous file with comments | « webrtc/pc/rtptransport.h ('k') | webrtc/pc/rtptransport_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2017 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2017 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 } 108 }
109 109
110 PacketTransportInterface* RtpTransport::GetRtpPacketTransport() const { 110 PacketTransportInterface* RtpTransport::GetRtpPacketTransport() const {
111 return rtp_packet_transport_; 111 return rtp_packet_transport_;
112 } 112 }
113 113
114 PacketTransportInterface* RtpTransport::GetRtcpPacketTransport() const { 114 PacketTransportInterface* RtpTransport::GetRtcpPacketTransport() const {
115 return rtcp_packet_transport_; 115 return rtcp_packet_transport_;
116 } 116 }
117 117
118 RTCError RtpTransport::SetRtcpParameters(const RtcpParameters& parameters) { 118 RTCError RtpTransport::SetParameters(const RtpTransportParameters& parameters) {
119 if (rtcp_parameters_.mux && !parameters.mux) { 119 if (parameters_.rtcp.mux && !parameters.rtcp.mux) {
120 LOG_AND_RETURN_ERROR(RTCErrorType::INVALID_STATE, 120 LOG_AND_RETURN_ERROR(RTCErrorType::INVALID_STATE,
121 "Disabling RTCP muxing is not allowed."); 121 "Disabling RTCP muxing is not allowed.");
122 } 122 }
123 123 if (parameters.keepalive != parameters_.keepalive) {
124 RtcpParameters new_parameters = parameters; 124 // TODO(sprang): Wire up support for keep-alive (only ORTC support for now).
125 125 LOG_AND_RETURN_ERROR(
126 if (new_parameters.cname.empty()) { 126 RTCErrorType::INVALID_MODIFICATION,
127 new_parameters.cname = rtcp_parameters_.cname; 127 "RTP keep-alive parameters not supported by this channel.");
128 } 128 }
129 129
130 rtcp_parameters_ = new_parameters; 130 RtpTransportParameters new_parameters = parameters;
131
132 if (new_parameters.rtcp.cname.empty()) {
133 new_parameters.rtcp.cname = parameters_.rtcp.cname;
134 }
135
136 parameters_ = new_parameters;
131 return RTCError::OK(); 137 return RTCError::OK();
132 } 138 }
133 139
134 RtcpParameters RtpTransport::GetRtcpParameters() const { 140 RtpTransportParameters RtpTransport::GetParameters() const {
135 return rtcp_parameters_; 141 return parameters_;
136 } 142 }
137 143
138 RtpTransportAdapter* RtpTransport::GetInternal() { 144 RtpTransportAdapter* RtpTransport::GetInternal() {
139 return nullptr; 145 return nullptr;
140 } 146 }
141 147
142 void RtpTransport::OnReadyToSend(rtc::PacketTransportInternal* transport) { 148 void RtpTransport::OnReadyToSend(rtc::PacketTransportInternal* transport) {
143 SetReadyToSend(transport == rtcp_packet_transport_, true); 149 SetReadyToSend(transport == rtcp_packet_transport_, true);
144 } 150 }
145 151
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 } 209 }
204 if (rtcp) { 210 if (rtcp) {
205 // Permit all (seemingly valid) RTCP packets. 211 // Permit all (seemingly valid) RTCP packets.
206 return true; 212 return true;
207 } 213 }
208 // Check whether we handle this payload. 214 // Check whether we handle this payload.
209 return HandlesPacket(packet->data(), packet->size()); 215 return HandlesPacket(packet->data(), packet->size());
210 } 216 }
211 217
212 } // namespace webrtc 218 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/pc/rtptransport.h ('k') | webrtc/pc/rtptransport_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698