| OLD | NEW |
| 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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 // transport. We check the RTP payload type to determine if it is RTCP. | 183 // transport. We check the RTP payload type to determine if it is RTCP. |
| 184 bool rtcp = transport == rtcp_packet_transport() || | 184 bool rtcp = transport == rtcp_packet_transport() || |
| 185 IsRtcp(data, static_cast<int>(len)); | 185 IsRtcp(data, static_cast<int>(len)); |
| 186 rtc::CopyOnWriteBuffer packet(data, len); | 186 rtc::CopyOnWriteBuffer packet(data, len); |
| 187 | 187 |
| 188 if (!WantsPacket(rtcp, &packet)) { | 188 if (!WantsPacket(rtcp, &packet)) { |
| 189 return; | 189 return; |
| 190 } | 190 } |
| 191 | 191 |
| 192 // This mutates |packet| if it is protected. | 192 // This mutates |packet| if it is protected. |
| 193 SignalPacketReceived(rtcp, packet, packet_time); | 193 SignalPacketReceived(rtcp, &packet, packet_time); |
| 194 } | 194 } |
| 195 | 195 |
| 196 bool RtpTransport::WantsPacket(bool rtcp, | 196 bool RtpTransport::WantsPacket(bool rtcp, |
| 197 const rtc::CopyOnWriteBuffer* packet) { | 197 const rtc::CopyOnWriteBuffer* packet) { |
| 198 // Protect ourselves against crazy data. | 198 // Protect ourselves against crazy data. |
| 199 if (!packet || !cricket::IsValidRtpRtcpPacketSize(rtcp, packet->size())) { | 199 if (!packet || !cricket::IsValidRtpRtcpPacketSize(rtcp, packet->size())) { |
| 200 LOG(LS_ERROR) << "Dropping incoming " << cricket::RtpRtcpStringLiteral(rtcp) | 200 LOG(LS_ERROR) << "Dropping incoming " << cricket::RtpRtcpStringLiteral(rtcp) |
| 201 << " packet: wrong size=" << packet->size(); | 201 << " packet: wrong size=" << packet->size(); |
| 202 return false; | 202 return false; |
| 203 } | 203 } |
| 204 if (rtcp) { | 204 if (rtcp) { |
| 205 // Permit all (seemingly valid) RTCP packets. | 205 // Permit all (seemingly valid) RTCP packets. |
| 206 return true; | 206 return true; |
| 207 } | 207 } |
| 208 // Check whether we handle this payload. | 208 // Check whether we handle this payload. |
| 209 return HandlesPacket(packet->data(), packet->size()); | 209 return HandlesPacket(packet->data(), packet->size()); |
| 210 } | 210 } |
| 211 | 211 |
| 212 } // namespace webrtc | 212 } // namespace webrtc |
| OLD | NEW |