| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 } | 78 } |
| 79 return c; | 79 return c; |
| 80 } | 80 } |
| 81 | 81 |
| 82 PacketsPerSsrc CountRtpPacketsPerSsrc() { | 82 PacketsPerSsrc CountRtpPacketsPerSsrc() { |
| 83 PacketsPerSsrc pps; | 83 PacketsPerSsrc pps; |
| 84 test::RtpPacket packet; | 84 test::RtpPacket packet; |
| 85 while (rtp_packet_source_->NextPacket(&packet)) { | 85 while (rtp_packet_source_->NextPacket(&packet)) { |
| 86 RtpUtility::RtpHeaderParser rtp_header_parser(packet.data, packet.length); | 86 RtpUtility::RtpHeaderParser rtp_header_parser(packet.data, packet.length); |
| 87 webrtc::RTPHeader header; | 87 webrtc::RTPHeader header; |
| 88 if (!rtp_header_parser.RTCP() && rtp_header_parser.Parse(header, NULL)) { | 88 if (!rtp_header_parser.RTCP() && |
| 89 rtp_header_parser.Parse(&header, nullptr)) { |
| 89 pps[header.ssrc]++; | 90 pps[header.ssrc]++; |
| 90 } | 91 } |
| 91 } | 92 } |
| 92 return pps; | 93 return pps; |
| 93 } | 94 } |
| 94 | 95 |
| 95 private: | 96 private: |
| 96 rtc::scoped_ptr<test::RtpFileReader> rtp_packet_source_; | 97 rtc::scoped_ptr<test::RtpFileReader> rtp_packet_source_; |
| 97 }; | 98 }; |
| 98 | 99 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 116 | 117 |
| 117 TEST_F(TestPcapFileReader, TestThreeSsrc) { | 118 TEST_F(TestPcapFileReader, TestThreeSsrc) { |
| 118 Init("ssrcs-3"); | 119 Init("ssrcs-3"); |
| 119 PacketsPerSsrc pps = CountRtpPacketsPerSsrc(); | 120 PacketsPerSsrc pps = CountRtpPacketsPerSsrc(); |
| 120 EXPECT_EQ(3UL, pps.size()); | 121 EXPECT_EQ(3UL, pps.size()); |
| 121 EXPECT_EQ(162, pps[0x938c5eaa]); | 122 EXPECT_EQ(162, pps[0x938c5eaa]); |
| 122 EXPECT_EQ(113, pps[0x59fe6ef0]); | 123 EXPECT_EQ(113, pps[0x59fe6ef0]); |
| 123 EXPECT_EQ(61, pps[0xed2bd2ac]); | 124 EXPECT_EQ(61, pps[0xed2bd2ac]); |
| 124 } | 125 } |
| 125 } // namespace webrtc | 126 } // namespace webrtc |
| OLD | NEW |