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 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 config->rtp.extensions.push_back(RtpExtension(extension_name, rand())); | 303 config->rtp.extensions.push_back(RtpExtension(extension_name, rand())); |
304 } | 304 } |
305 | 305 |
306 // Test for the RtcEventLog class. Dumps some RTP packets to disk, then reads | 306 // Test for the RtcEventLog class. Dumps some RTP packets to disk, then reads |
307 // them back to see if they match. | 307 // them back to see if they match. |
308 void LogSessionAndReadBack(size_t rtp_count, unsigned random_seed) { | 308 void LogSessionAndReadBack(size_t rtp_count, unsigned random_seed) { |
309 std::vector<std::vector<uint8_t>> rtp_packets; | 309 std::vector<std::vector<uint8_t>> rtp_packets; |
310 std::vector<uint8_t> incoming_rtcp_packet; | 310 std::vector<uint8_t> incoming_rtcp_packet; |
311 std::vector<uint8_t> outgoing_rtcp_packet; | 311 std::vector<uint8_t> outgoing_rtcp_packet; |
312 | 312 |
313 VideoReceiveStream::Config receiver_config; | 313 VideoReceiveStream::Config receiver_config(nullptr); |
314 VideoSendStream::Config sender_config; | 314 VideoSendStream::Config sender_config(nullptr); |
315 | 315 |
316 srand(random_seed); | 316 srand(random_seed); |
317 | 317 |
318 // Create rtp_count RTP packets containing random data. | 318 // Create rtp_count RTP packets containing random data. |
319 const size_t rtp_header_size = 20; | 319 const size_t rtp_header_size = 20; |
320 for (size_t i = 0; i < rtp_count; i++) { | 320 for (size_t i = 0; i < rtp_count; i++) { |
321 size_t packet_size = 1000 + rand() % 30; | 321 size_t packet_size = 1000 + rand() % 30; |
322 rtp_packets.push_back(std::vector<uint8_t>()); | 322 rtp_packets.push_back(std::vector<uint8_t>()); |
323 rtp_packets[i].reserve(packet_size); | 323 rtp_packets[i].reserve(packet_size); |
324 for (size_t j = 0; j < packet_size; j++) { | 324 for (size_t j = 0; j < packet_size; j++) { |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 | 420 |
421 TEST(RtcEventLogTest, LogSessionAndReadBack) { | 421 TEST(RtcEventLogTest, LogSessionAndReadBack) { |
422 LogSessionAndReadBack(5, 321); | 422 LogSessionAndReadBack(5, 321); |
423 LogSessionAndReadBack(8, 3141592653u); | 423 LogSessionAndReadBack(8, 3141592653u); |
424 LogSessionAndReadBack(9, 2718281828u); | 424 LogSessionAndReadBack(9, 2718281828u); |
425 } | 425 } |
426 | 426 |
427 } // namespace webrtc | 427 } // namespace webrtc |
428 | 428 |
429 #endif // ENABLE_RTC_EVENT_LOG | 429 #endif // ENABLE_RTC_EVENT_LOG |
OLD | NEW |