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 |
11 #ifdef ENABLE_RTC_EVENT_LOG | 11 #ifdef ENABLE_RTC_EVENT_LOG |
12 | 12 |
13 #include <string> | 13 #include <string> |
14 #include <utility> | 14 #include <utility> |
15 #include <vector> | 15 #include <vector> |
16 | 16 |
17 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
18 #include "webrtc/base/buffer.h" | 18 #include "webrtc/base/buffer.h" |
19 #include "webrtc/base/checks.h" | 19 #include "webrtc/base/checks.h" |
20 #include "webrtc/base/random.h" | 20 #include "webrtc/base/random.h" |
21 #include "webrtc/base/scoped_ptr.h" | 21 #include "webrtc/base/scoped_ptr.h" |
22 #include "webrtc/base/thread.h" | 22 #include "webrtc/base/thread.h" |
23 #include "webrtc/call.h" | 23 #include "webrtc/call.h" |
24 #include "webrtc/call/rtc_event_log.h" | 24 #include "webrtc/call/rtc_event_log.h" |
25 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet.h" | 25 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet.h" |
| 26 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/sender_report.h" |
26 #include "webrtc/modules/rtp_rtcp/source/rtp_sender.h" | 27 #include "webrtc/modules/rtp_rtcp/source/rtp_sender.h" |
27 #include "webrtc/system_wrappers/include/clock.h" | 28 #include "webrtc/system_wrappers/include/clock.h" |
28 #include "webrtc/test/test_suite.h" | 29 #include "webrtc/test/test_suite.h" |
29 #include "webrtc/test/testsupport/fileutils.h" | 30 #include "webrtc/test/testsupport/fileutils.h" |
30 #include "webrtc/test/testsupport/gtest_disable.h" | 31 #include "webrtc/test/testsupport/gtest_disable.h" |
31 | 32 |
32 // Files generated at build-time by the protobuf compiler. | 33 // Files generated at build-time by the protobuf compiler. |
33 #ifdef WEBRTC_ANDROID_PLATFORM_BUILD | 34 #ifdef WEBRTC_ANDROID_PLATFORM_BUILD |
34 #include "external/webrtc/webrtc/call/rtc_event_log.pb.h" | 35 #include "external/webrtc/webrtc/call/rtc_event_log.pb.h" |
35 #else | 36 #else |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 return header_size; | 350 return header_size; |
350 } | 351 } |
351 | 352 |
352 rtc::scoped_ptr<rtcp::RawPacket> GenerateRtcpPacket(Random* prng) { | 353 rtc::scoped_ptr<rtcp::RawPacket> GenerateRtcpPacket(Random* prng) { |
353 rtcp::ReportBlock report_block; | 354 rtcp::ReportBlock report_block; |
354 report_block.To(prng->Rand<uint32_t>()); // Remote SSRC. | 355 report_block.To(prng->Rand<uint32_t>()); // Remote SSRC. |
355 report_block.WithFractionLost(prng->Rand(50)); | 356 report_block.WithFractionLost(prng->Rand(50)); |
356 | 357 |
357 rtcp::SenderReport sender_report; | 358 rtcp::SenderReport sender_report; |
358 sender_report.From(prng->Rand<uint32_t>()); // Sender SSRC. | 359 sender_report.From(prng->Rand<uint32_t>()); // Sender SSRC. |
359 sender_report.WithNtpSec(prng->Rand<uint32_t>()); | 360 sender_report.WithNtp( |
360 sender_report.WithNtpFrac(prng->Rand<uint32_t>()); | 361 NtpTime(prng->Rand<uint32_t>(), prng->Rand<uint32_t>())); |
361 sender_report.WithPacketCount(prng->Rand<uint32_t>()); | 362 sender_report.WithPacketCount(prng->Rand<uint32_t>()); |
362 sender_report.WithReportBlock(report_block); | 363 sender_report.WithReportBlock(report_block); |
363 | 364 |
364 return sender_report.Build(); | 365 return sender_report.Build(); |
365 } | 366 } |
366 | 367 |
367 void GenerateVideoReceiveConfig(uint32_t extensions_bitvector, | 368 void GenerateVideoReceiveConfig(uint32_t extensions_bitvector, |
368 VideoReceiveStream::Config* config, | 369 VideoReceiveStream::Config* config, |
369 Random* prng) { | 370 Random* prng) { |
370 // Create a map from a payload type to an encoder name. | 371 // Create a map from a payload type to an encoder name. |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
682 // Enable all header extensions | 683 // Enable all header extensions |
683 uint32_t extensions = (1u << kNumExtensions) - 1; | 684 uint32_t extensions = (1u << kNumExtensions) - 1; |
684 uint32_t csrcs_count = 2; | 685 uint32_t csrcs_count = 2; |
685 DropOldEvents(extensions, csrcs_count, 141421356); | 686 DropOldEvents(extensions, csrcs_count, 141421356); |
686 DropOldEvents(extensions, csrcs_count, 173205080); | 687 DropOldEvents(extensions, csrcs_count, 173205080); |
687 } | 688 } |
688 | 689 |
689 } // namespace webrtc | 690 } // namespace webrtc |
690 | 691 |
691 #endif // ENABLE_RTC_EVENT_LOG | 692 #endif // ENABLE_RTC_EVENT_LOG |
OLD | NEW |