| 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 } | 70 } |
| 71 | 71 |
| 72 bool RtpTransport::IsWritable(bool rtcp) const { | 72 bool RtpTransport::IsWritable(bool rtcp) const { |
| 73 rtc::PacketTransportInternal* transport = rtcp && !rtcp_mux_enabled_ | 73 rtc::PacketTransportInternal* transport = rtcp && !rtcp_mux_enabled_ |
| 74 ? rtcp_packet_transport_ | 74 ? rtcp_packet_transport_ |
| 75 : rtp_packet_transport_; | 75 : rtp_packet_transport_; |
| 76 return transport && transport->writable(); | 76 return transport && transport->writable(); |
| 77 } | 77 } |
| 78 | 78 |
| 79 bool RtpTransport::SendPacket(bool rtcp, | 79 bool RtpTransport::SendPacket(bool rtcp, |
| 80 const rtc::CopyOnWriteBuffer* packet, | 80 rtc::CopyOnWriteBuffer* packet, |
| 81 const rtc::PacketOptions& options, | 81 const rtc::PacketOptions& options, |
| 82 int flags) { | 82 int flags) { |
| 83 rtc::PacketTransportInternal* transport = rtcp && !rtcp_mux_enabled_ | 83 rtc::PacketTransportInternal* transport = rtcp && !rtcp_mux_enabled_ |
| 84 ? rtcp_packet_transport_ | 84 ? rtcp_packet_transport_ |
| 85 : rtp_packet_transport_; | 85 : rtp_packet_transport_; |
| 86 int ret = transport->SendPacket(packet->data<char>(), packet->size(), options, | 86 int ret = transport->SendPacket(packet->data<char>(), packet->size(), options, |
| 87 flags); | 87 flags); |
| 88 if (ret != static_cast<int>(packet->size())) { | 88 if (ret != static_cast<int>(packet->size())) { |
| 89 if (transport->GetError() == ENOTCONN) { | 89 if (transport->GetError() == ENOTCONN) { |
| 90 LOG(LS_WARNING) << "Got ENOTCONN from transport."; | 90 LOG(LS_WARNING) << "Got ENOTCONN from transport."; |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |