OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 for (unsigned i = 0; i < kNumExtensions; i++) { | 137 for (unsigned i = 0; i < kNumExtensions; i++) { |
138 if (extensions_bitvector & (1u << i)) { | 138 if (extensions_bitvector & (1u << i)) { |
139 rtp_sender.RegisterRtpHeaderExtension(kExtensionTypes[i], i + 1); | 139 rtp_sender.RegisterRtpHeaderExtension(kExtensionTypes[i], i + 1); |
140 } | 140 } |
141 } | 141 } |
142 | 142 |
143 int8_t payload_type = prng->Rand(0, 127); | 143 int8_t payload_type = prng->Rand(0, 127); |
144 bool marker_bit = prng->Rand<bool>(); | 144 bool marker_bit = prng->Rand<bool>(); |
145 uint32_t capture_timestamp = prng->Rand<uint32_t>(); | 145 uint32_t capture_timestamp = prng->Rand<uint32_t>(); |
146 int64_t capture_time_ms = prng->Rand<uint32_t>(); | 146 int64_t capture_time_ms = prng->Rand<uint32_t>(); |
147 bool timestamp_provided = prng->Rand<bool>(); | |
148 bool inc_sequence_number = prng->Rand<bool>(); | |
149 | 147 |
150 size_t header_size = rtp_sender.BuildRTPheader( | 148 size_t header_size = rtp_sender.BuildRtpHeader( |
151 packet, payload_type, marker_bit, capture_timestamp, capture_time_ms, | 149 packet, payload_type, marker_bit, capture_timestamp, capture_time_ms); |
152 timestamp_provided, inc_sequence_number); | |
153 | |
154 for (size_t i = header_size; i < packet_size; i++) { | 150 for (size_t i = header_size; i < packet_size; i++) { |
155 packet[i] = prng->Rand<uint8_t>(); | 151 packet[i] = prng->Rand<uint8_t>(); |
156 } | 152 } |
157 | 153 |
158 return header_size; | 154 return header_size; |
159 } | 155 } |
160 | 156 |
161 rtc::Buffer GenerateRtcpPacket(Random* prng) { | 157 rtc::Buffer GenerateRtcpPacket(Random* prng) { |
162 rtcp::ReportBlock report_block; | 158 rtcp::ReportBlock report_block; |
163 report_block.To(prng->Rand<uint32_t>()); // Remote SSRC. | 159 report_block.To(prng->Rand<uint32_t>()); // Remote SSRC. |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
472 rtcp_packet.size()); | 468 rtcp_packet.size()); |
473 | 469 |
474 RtcEventLogTestHelper::VerifyLogEndEvent(parsed_log, 3); | 470 RtcEventLogTestHelper::VerifyLogEndEvent(parsed_log, 3); |
475 | 471 |
476 // Clean up temporary file - can be pretty slow. | 472 // Clean up temporary file - can be pretty slow. |
477 remove(temp_filename.c_str()); | 473 remove(temp_filename.c_str()); |
478 } | 474 } |
479 } // namespace webrtc | 475 } // namespace webrtc |
480 | 476 |
481 #endif // ENABLE_RTC_EVENT_LOG | 477 #endif // ENABLE_RTC_EVENT_LOG |
OLD | NEW |