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 | 31 |
31 // Files generated at build-time by the protobuf compiler. | 32 // Files generated at build-time by the protobuf compiler. |
32 #ifdef WEBRTC_ANDROID_PLATFORM_BUILD | 33 #ifdef WEBRTC_ANDROID_PLATFORM_BUILD |
33 #include "external/webrtc/webrtc/call/rtc_event_log.pb.h" | 34 #include "external/webrtc/webrtc/call/rtc_event_log.pb.h" |
34 #else | 35 #else |
35 #include "webrtc/call/rtc_event_log.pb.h" | 36 #include "webrtc/call/rtc_event_log.pb.h" |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 return header_size; | 349 return header_size; |
349 } | 350 } |
350 | 351 |
351 rtc::scoped_ptr<rtcp::RawPacket> GenerateRtcpPacket(Random* prng) { | 352 rtc::scoped_ptr<rtcp::RawPacket> GenerateRtcpPacket(Random* prng) { |
352 rtcp::ReportBlock report_block; | 353 rtcp::ReportBlock report_block; |
353 report_block.To(prng->Rand<uint32_t>()); // Remote SSRC. | 354 report_block.To(prng->Rand<uint32_t>()); // Remote SSRC. |
354 report_block.WithFractionLost(prng->Rand(50)); | 355 report_block.WithFractionLost(prng->Rand(50)); |
355 | 356 |
356 rtcp::SenderReport sender_report; | 357 rtcp::SenderReport sender_report; |
357 sender_report.From(prng->Rand<uint32_t>()); // Sender SSRC. | 358 sender_report.From(prng->Rand<uint32_t>()); // Sender SSRC. |
358 sender_report.WithNtpSec(prng->Rand<uint32_t>()); | 359 sender_report.WithNtp( |
359 sender_report.WithNtpFrac(prng->Rand<uint32_t>()); | 360 NtpTime(prng->Rand<uint32_t>(), prng->Rand<uint32_t>())); |
360 sender_report.WithPacketCount(prng->Rand<uint32_t>()); | 361 sender_report.WithPacketCount(prng->Rand<uint32_t>()); |
361 sender_report.WithReportBlock(report_block); | 362 sender_report.WithReportBlock(report_block); |
362 | 363 |
363 return sender_report.Build(); | 364 return sender_report.Build(); |
364 } | 365 } |
365 | 366 |
366 void GenerateVideoReceiveConfig(uint32_t extensions_bitvector, | 367 void GenerateVideoReceiveConfig(uint32_t extensions_bitvector, |
367 VideoReceiveStream::Config* config, | 368 VideoReceiveStream::Config* config, |
368 Random* prng) { | 369 Random* prng) { |
369 // Create a map from a payload type to an encoder name. | 370 // Create a map from a payload type to an encoder name. |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
681 // Enable all header extensions | 682 // Enable all header extensions |
682 uint32_t extensions = (1u << kNumExtensions) - 1; | 683 uint32_t extensions = (1u << kNumExtensions) - 1; |
683 uint32_t csrcs_count = 2; | 684 uint32_t csrcs_count = 2; |
684 DropOldEvents(extensions, csrcs_count, 141421356); | 685 DropOldEvents(extensions, csrcs_count, 141421356); |
685 DropOldEvents(extensions, csrcs_count, 173205080); | 686 DropOldEvents(extensions, csrcs_count, 173205080); |
686 } | 687 } |
687 | 688 |
688 } // namespace webrtc | 689 } // namespace webrtc |
689 | 690 |
690 #endif // ENABLE_RTC_EVENT_LOG | 691 #endif // ENABLE_RTC_EVENT_LOG |
OLD | NEW |