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

Side by Side Diff: webrtc/media/base/rtputils.cc

Issue 2890263003: Move RTP/RTCP demuxing logic from BaseChannel to RtpTransport. (Closed)
Patch Set: Disconnect transport channels in method called from Deinit to prevent races during object destructi… Created 3 years, 6 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/media/base/rtputils.h ('k') | webrtc/pc/channel.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 (c) 2011 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2011 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 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 if (len < kMinRtpPacketLen) 272 if (len < kMinRtpPacketLen)
273 return false; 273 return false;
274 274
275 return (static_cast<const uint8_t*>(data)[0] >> 6) == kRtpVersion; 275 return (static_cast<const uint8_t*>(data)[0] >> 6) == kRtpVersion;
276 } 276 }
277 277
278 bool IsValidRtpPayloadType(int payload_type) { 278 bool IsValidRtpPayloadType(int payload_type) {
279 return payload_type >= 0 && payload_type <= 127; 279 return payload_type >= 0 && payload_type <= 127;
280 } 280 }
281 281
282 bool IsValidRtpRtcpPacketSize(bool rtcp, size_t size) {
283 return (rtcp ? size >= kMinRtcpPacketLen : size >= kMinRtpPacketLen) &&
284 size <= kMaxRtpPacketLen;
285 }
286
287 const char* RtpRtcpStringLiteral(bool rtcp) {
288 return rtcp ? "RTCP" : "RTP";
289 }
290
282 bool ValidateRtpHeader(const uint8_t* rtp, 291 bool ValidateRtpHeader(const uint8_t* rtp,
283 size_t length, 292 size_t length,
284 size_t* header_length) { 293 size_t* header_length) {
285 if (header_length) { 294 if (header_length) {
286 *header_length = 0; 295 *header_length = 0;
287 } 296 }
288 297
289 if (length < kMinRtpPacketLen) { 298 if (length < kMinRtpPacketLen) {
290 return false; 299 return false;
291 } 300 }
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
455 UpdateRtpAbsSendTimeExtension(start, rtp_length, 464 UpdateRtpAbsSendTimeExtension(start, rtp_length,
456 packet_time_params.rtp_sendtime_extension_id, 465 packet_time_params.rtp_sendtime_extension_id,
457 time_us); 466 time_us);
458 } 467 }
459 468
460 UpdateRtpAuthTag(start, rtp_length, packet_time_params); 469 UpdateRtpAuthTag(start, rtp_length, packet_time_params);
461 return true; 470 return true;
462 } 471 }
463 472
464 } // namespace cricket 473 } // namespace cricket
OLDNEW
« no previous file with comments | « webrtc/media/base/rtputils.h ('k') | webrtc/pc/channel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698