| OLD | NEW |
| 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 30 matching lines...) Expand all Loading... |
| 41 kRtcpMinParseLength = 8, | 41 kRtcpMinParseLength = 8, |
| 42 | 42 |
| 43 kRtpExpectedVersion = 2, | 43 kRtpExpectedVersion = 2, |
| 44 kRtpMinParseLength = 12 | 44 kRtpMinParseLength = 12 |
| 45 }; | 45 }; |
| 46 | 46 |
| 47 /* | 47 /* |
| 48 * Misc utility routines | 48 * Misc utility routines |
| 49 */ | 49 */ |
| 50 | 50 |
| 51 #if defined(_WIN32) | 51 bool StringCompare(const char* str1, const char* str2, const uint32_t length) { |
| 52 bool StringCompare(const char* str1, const char* str2, | 52 return STR_NCASE_CMP(str1, str2, length) == 0; |
| 53 const uint32_t length) { | |
| 54 return _strnicmp(str1, str2, length) == 0; | |
| 55 } | 53 } |
| 56 #elif defined(WEBRTC_LINUX) || defined(WEBRTC_MAC) | 54 |
| 57 bool StringCompare(const char* str1, const char* str2, | 55 bool StringCompare(const char* str1, const char* str2) { |
| 58 const uint32_t length) { | 56 return STR_CASE_CMP(str1, str2) == 0; |
| 59 return strncasecmp(str1, str2, length) == 0; | |
| 60 } | 57 } |
| 61 #endif | |
| 62 | 58 |
| 63 size_t Word32Align(size_t size) { | 59 size_t Word32Align(size_t size) { |
| 64 uint32_t remainder = size % 4; | 60 uint32_t remainder = size % 4; |
| 65 if (remainder != 0) | 61 if (remainder != 0) |
| 66 return size + 4 - remainder; | 62 return size + 4 - remainder; |
| 67 return size; | 63 return size; |
| 68 } | 64 } |
| 69 | 65 |
| 70 RtpHeaderParser::RtpHeaderParser(const uint8_t* rtpData, | 66 RtpHeaderParser::RtpHeaderParser(const uint8_t* rtpData, |
| 71 const size_t rtpDataLength) | 67 const size_t rtpDataLength) |
| (...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 459 if (*ptr != 0) { | 455 if (*ptr != 0) { |
| 460 return num_zero_bytes; | 456 return num_zero_bytes; |
| 461 } | 457 } |
| 462 ptr++; | 458 ptr++; |
| 463 num_zero_bytes++; | 459 num_zero_bytes++; |
| 464 } | 460 } |
| 465 return num_zero_bytes; | 461 return num_zero_bytes; |
| 466 } | 462 } |
| 467 } // namespace RtpUtility | 463 } // namespace RtpUtility |
| 468 } // namespace webrtc | 464 } // namespace webrtc |
| OLD | NEW |