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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 size_t payload_size = packet_size - rtp_packet.headers_size(); | 132 size_t payload_size = packet_size - rtp_packet.headers_size(); |
133 uint8_t* payload = rtp_packet.AllocatePayload(payload_size); | 133 uint8_t* payload = rtp_packet.AllocatePayload(payload_size); |
134 for (size_t i = 0; i < payload_size; i++) { | 134 for (size_t i = 0; i < payload_size; i++) { |
135 payload[i] = prng->Rand<uint8_t>(); | 135 payload[i] = prng->Rand<uint8_t>(); |
136 } | 136 } |
137 return rtp_packet; | 137 return rtp_packet; |
138 } | 138 } |
139 | 139 |
140 rtc::Buffer GenerateRtcpPacket(Random* prng) { | 140 rtc::Buffer GenerateRtcpPacket(Random* prng) { |
141 rtcp::ReportBlock report_block; | 141 rtcp::ReportBlock report_block; |
142 report_block.SetMediaSsrc(prng->Rand<uint32_t>()); // Remote SSRC. | 142 report_block.To(prng->Rand<uint32_t>()); // Remote SSRC. |
143 report_block.SetFractionLost(prng->Rand(50)); | 143 report_block.WithFractionLost(prng->Rand(50)); |
144 | 144 |
145 rtcp::SenderReport sender_report; | 145 rtcp::SenderReport sender_report; |
146 sender_report.SetSenderSsrc(prng->Rand<uint32_t>()); | 146 sender_report.From(prng->Rand<uint32_t>()); // Sender SSRC. |
147 sender_report.SetNtp(NtpTime(prng->Rand<uint32_t>(), prng->Rand<uint32_t>())); | 147 sender_report.WithNtp( |
148 sender_report.SetPacketCount(prng->Rand<uint32_t>()); | 148 NtpTime(prng->Rand<uint32_t>(), prng->Rand<uint32_t>())); |
149 sender_report.AddReportBlock(report_block); | 149 sender_report.WithPacketCount(prng->Rand<uint32_t>()); |
| 150 sender_report.WithReportBlock(report_block); |
150 | 151 |
151 return sender_report.Build(); | 152 return sender_report.Build(); |
152 } | 153 } |
153 | 154 |
154 void GenerateVideoReceiveConfig(uint32_t extensions_bitvector, | 155 void GenerateVideoReceiveConfig(uint32_t extensions_bitvector, |
155 VideoReceiveStream::Config* config, | 156 VideoReceiveStream::Config* config, |
156 Random* prng) { | 157 Random* prng) { |
157 // Create a map from a payload type to an encoder name. | 158 // Create a map from a payload type to an encoder name. |
158 VideoReceiveStream::Decoder decoder; | 159 VideoReceiveStream::Decoder decoder; |
159 decoder.payload_type = prng->Rand(0, 127); | 160 decoder.payload_type = prng->Rand(0, 127); |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
451 MediaType::VIDEO, rtcp_packet.data(), | 452 MediaType::VIDEO, rtcp_packet.data(), |
452 rtcp_packet.size()); | 453 rtcp_packet.size()); |
453 | 454 |
454 RtcEventLogTestHelper::VerifyLogEndEvent(parsed_log, 3); | 455 RtcEventLogTestHelper::VerifyLogEndEvent(parsed_log, 3); |
455 | 456 |
456 // Clean up temporary file - can be pretty slow. | 457 // Clean up temporary file - can be pretty slow. |
457 remove(temp_filename.c_str()); | 458 remove(temp_filename.c_str()); |
458 } | 459 } |
459 | 460 |
460 } // namespace webrtc | 461 } // namespace webrtc |
OLD | NEW |