OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 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 |
11 #include <algorithm> | 11 #include <algorithm> |
12 | 12 |
13 #include "webrtc/base/gunit.h" | |
14 #include "webrtc/media/base/fakertp.h" | 13 #include "webrtc/media/base/fakertp.h" |
| 14 #include "webrtc/rtc_base/gunit.h" |
15 | 15 |
16 void CompareHeaderExtensions(const char* packet1, size_t packet1_size, | 16 void CompareHeaderExtensions(const char* packet1, size_t packet1_size, |
17 const char* packet2, size_t packet2_size, | 17 const char* packet2, size_t packet2_size, |
18 const std::vector<int> encrypted_headers, bool expect_equal) { | 18 const std::vector<int> encrypted_headers, bool expect_equal) { |
19 // Sanity check: packets must be large enough to contain the RTP header and | 19 // Sanity check: packets must be large enough to contain the RTP header and |
20 // extensions header. | 20 // extensions header. |
21 RTC_CHECK_GE(packet1_size, 12 + 4); | 21 RTC_CHECK_GE(packet1_size, 12 + 4); |
22 RTC_CHECK_GE(packet2_size, 12 + 4); | 22 RTC_CHECK_GE(packet2_size, 12 + 4); |
23 // RTP extension headers are the same. | 23 // RTP extension headers are the same. |
24 EXPECT_EQ(0, memcmp(packet1 + 12, packet2 + 12, 4)); | 24 EXPECT_EQ(0, memcmp(packet1 + 12, packet2 + 12, 4)); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 | 57 |
58 extension_data1 += len; | 58 extension_data1 += len; |
59 extension_data2 += len; | 59 extension_data2 += len; |
60 // Skip padding. | 60 // Skip padding. |
61 while (extension_data1 < extension_end1 && *extension_data1 == 0) { | 61 while (extension_data1 < extension_end1 && *extension_data1 == 0) { |
62 extension_data1++; | 62 extension_data1++; |
63 extension_data2++; | 63 extension_data2++; |
64 } | 64 } |
65 } | 65 } |
66 } | 66 } |
OLD | NEW |