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

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

Issue 2981013002: Introduce RtpTransportInternal and SrtpTransport. (Closed)
Patch Set: Depend on test:test_support for gmock. 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 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
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