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

Side by Side Diff: webrtc/modules/rtp_rtcp/source/rtcp_utility.cc

Issue 2479193002: Finish reformatting RTCPUtility::RTCPParserV2::Validate() (Closed)
Patch Set: Created 4 years, 1 month 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 | « no previous file | no next file » | 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) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 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 415 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 return; // NOT VALID 426 return; // NOT VALID
427 427
428 RtcpCommonHeader header; 428 RtcpCommonHeader header;
429 if (_ptrRTCPDataEnd <= _ptrRTCPDataBegin) 429 if (_ptrRTCPDataEnd <= _ptrRTCPDataBegin)
430 return; // NOT VALID 430 return; // NOT VALID
431 431
432 if (!RtcpParseCommonHeader(_ptrRTCPDataBegin, 432 if (!RtcpParseCommonHeader(_ptrRTCPDataBegin,
433 _ptrRTCPDataEnd - _ptrRTCPDataBegin, &header)) 433 _ptrRTCPDataEnd - _ptrRTCPDataBegin, &header))
434 return; // NOT VALID! 434 return; // NOT VALID!
435 435
436 // * if (!reducedSize) : first packet must be RR or SR. 436 // * if (!reducedSize) : first packet must be RR or SR.
437 // 437 //
438 // * The padding bit (P) should be zero for the first packet of a 438 // * The padding bit (P) should be zero for the first packet of a
439 // compound RTCP packet because padding should only be applied, 439 // compound RTCP packet because padding should only be applied,
440 // if it is needed, to the last packet. (NOT CHECKED!) 440 // if it is needed, to the last packet. (NOT CHECKED!)
441 // 441 //
442 // * The length fields of the individual RTCP packets must add up 442 // * The length fields of the individual RTCP packets must add up
443 // to the overall length of the compound RTCP packet as 443 // to the overall length of the compound RTCP packet as
444 // received. This is a fairly strong check. (NOT CHECKED!) 444 // received. This is a fairly strong check. (NOT CHECKED!)
445 445
446 if (!_RTCPReducedSizeEnable) 446 if (!_RTCPReducedSizeEnable) {
447 { 447 if ((header.packet_type != PT_SR) && (header.packet_type != PT_RR))
448 if ((header.packet_type != PT_SR) && (header.packet_type != PT_RR)) { 448 return; // NOT VALID
449 return; // NOT VALID 449 }
450 }
451 }
452 450
453 _validPacket = true; 451 _validPacket = true;
454 } 452 }
455 453
456 bool 454 bool
457 RTCPUtility::RTCPParserV2::IsValid() const 455 RTCPUtility::RTCPParserV2::IsValid() const
458 { 456 {
459 return _validPacket; 457 return _validPacket;
460 } 458 }
461 459
462 void 460 void
463 RTCPUtility::RTCPParserV2::EndCurrentBlock() 461 RTCPUtility::RTCPParserV2::EndCurrentBlock()
(...skipping 1281 matching lines...) Expand 10 before | Expand all | Expand 10 after
1745 const RTCPUtility::RtcpCommonHeader* 1743 const RTCPUtility::RtcpCommonHeader*
1746 RTCPUtility::RTCPPacketIterator::Current() { 1744 RTCPUtility::RTCPPacketIterator::Current() {
1747 if (!_ptrBlock) 1745 if (!_ptrBlock)
1748 { 1746 {
1749 return NULL; 1747 return NULL;
1750 } 1748 }
1751 1749
1752 return &_header; 1750 return &_header;
1753 } 1751 }
1754 } // namespace webrtc 1752 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698