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

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

Issue 2997983002: Completed the functionalities of SrtpTransport. (Closed)
Patch Set: Fix the chromimum issue. Created 3 years, 3 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/rtptransportinternal.h » ('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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 rtcp_packet_transport_ && rtcp_packet_transport_->writable()); 69 rtcp_packet_transport_ && rtcp_packet_transport_->writable());
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::SendRtpPacket(rtc::CopyOnWriteBuffer* packet,
80 const rtc::PacketOptions& options,
81 int flags) {
82 return SendPacket(false, packet, options, flags);
83 }
84
85 bool RtpTransport::SendRtcpPacket(rtc::CopyOnWriteBuffer* packet,
86 const rtc::PacketOptions& options,
87 int flags) {
88 return SendPacket(true, packet, options, flags);
89 }
90
79 bool RtpTransport::SendPacket(bool rtcp, 91 bool RtpTransport::SendPacket(bool rtcp,
80 rtc::CopyOnWriteBuffer* packet, 92 rtc::CopyOnWriteBuffer* packet,
81 const rtc::PacketOptions& options, 93 const rtc::PacketOptions& options,
82 int flags) { 94 int flags) {
83 rtc::PacketTransportInternal* transport = rtcp && !rtcp_mux_enabled_ 95 rtc::PacketTransportInternal* transport = rtcp && !rtcp_mux_enabled_
84 ? rtcp_packet_transport_ 96 ? rtcp_packet_transport_
85 : rtp_packet_transport_; 97 : rtp_packet_transport_;
86 int ret = transport->SendPacket(packet->data<char>(), packet->size(), options, 98 int ret = transport->SendPacket(packet->data<char>(), packet->size(), options,
87 flags); 99 flags);
88 if (ret != static_cast<int>(packet->size())) { 100 if (ret != static_cast<int>(packet->size())) {
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 } 221 }
210 if (rtcp) { 222 if (rtcp) {
211 // Permit all (seemingly valid) RTCP packets. 223 // Permit all (seemingly valid) RTCP packets.
212 return true; 224 return true;
213 } 225 }
214 // Check whether we handle this payload. 226 // Check whether we handle this payload.
215 return HandlesPacket(packet->data(), packet->size()); 227 return HandlesPacket(packet->data(), packet->size());
216 } 228 }
217 229
218 } // namespace webrtc 230 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/pc/rtptransport.h ('k') | webrtc/pc/rtptransportinternal.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698