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 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 | 307 |
308 RTPSender rtp_sender(false, // bool audio | 308 RTPSender rtp_sender(false, // bool audio |
309 clock, // Clock* clock | 309 clock, // Clock* clock |
310 nullptr, // Transport* | 310 nullptr, // Transport* |
311 nullptr, // RtpAudioFeedback* | 311 nullptr, // RtpAudioFeedback* |
312 nullptr, // PacedSender* | 312 nullptr, // PacedSender* |
313 nullptr, // PacketRouter* | 313 nullptr, // PacketRouter* |
314 nullptr, // SendTimeObserver* | 314 nullptr, // SendTimeObserver* |
315 nullptr, // BitrateStatisticsObserver* | 315 nullptr, // BitrateStatisticsObserver* |
316 nullptr, // FrameCountObserver* | 316 nullptr, // FrameCountObserver* |
317 nullptr); // SendSideDelayObserver* | 317 nullptr, // SendSideDelayObserver* |
| 318 nullptr); // RtcEventLog* |
318 | 319 |
319 std::vector<uint32_t> csrcs; | 320 std::vector<uint32_t> csrcs; |
320 for (unsigned i = 0; i < csrcs_count; i++) { | 321 for (unsigned i = 0; i < csrcs_count; i++) { |
321 csrcs.push_back(prng->Rand<uint32_t>()); | 322 csrcs.push_back(prng->Rand<uint32_t>()); |
322 } | 323 } |
323 rtp_sender.SetCsrcs(csrcs); | 324 rtp_sender.SetCsrcs(csrcs); |
324 rtp_sender.SetSSRC(prng->Rand<uint32_t>()); | 325 rtp_sender.SetSSRC(prng->Rand<uint32_t>()); |
325 rtp_sender.SetStartTimestamp(prng->Rand<uint32_t>(), true); | 326 rtp_sender.SetStartTimestamp(prng->Rand<uint32_t>(), true); |
326 rtp_sender.SetSequenceNumber(prng->Rand<uint16_t>()); | 327 rtp_sender.SetSequenceNumber(prng->Rand<uint16_t>()); |
327 | 328 |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
473 // to disk. | 474 // to disk. |
474 { | 475 { |
475 rtc::scoped_ptr<RtcEventLog> log_dumper(RtcEventLog::Create()); | 476 rtc::scoped_ptr<RtcEventLog> log_dumper(RtcEventLog::Create()); |
476 log_dumper->LogVideoReceiveStreamConfig(receiver_config); | 477 log_dumper->LogVideoReceiveStreamConfig(receiver_config); |
477 log_dumper->LogVideoSendStreamConfig(sender_config); | 478 log_dumper->LogVideoSendStreamConfig(sender_config); |
478 size_t rtcp_index = 1; | 479 size_t rtcp_index = 1; |
479 size_t playout_index = 1; | 480 size_t playout_index = 1; |
480 size_t bwe_loss_index = 1; | 481 size_t bwe_loss_index = 1; |
481 for (size_t i = 1; i <= rtp_count; i++) { | 482 for (size_t i = 1; i <= rtp_count; i++) { |
482 log_dumper->LogRtpHeader( | 483 log_dumper->LogRtpHeader( |
483 (i % 2 == 0), // Every second packet is incoming. | 484 (i % 2 == 0) ? kIncomingPacket : kOutgoingPacket, |
484 (i % 3 == 0) ? MediaType::AUDIO : MediaType::VIDEO, | 485 (i % 3 == 0) ? MediaType::AUDIO : MediaType::VIDEO, |
485 rtp_packets[i - 1].data(), rtp_packets[i - 1].size()); | 486 rtp_packets[i - 1].data(), rtp_packets[i - 1].size()); |
486 if (i * rtcp_count >= rtcp_index * rtp_count) { | 487 if (i * rtcp_count >= rtcp_index * rtp_count) { |
487 log_dumper->LogRtcpPacket( | 488 log_dumper->LogRtcpPacket( |
488 rtcp_index % 2 == 0, // Every second packet is incoming | 489 (rtcp_index % 2 == 0) ? kIncomingPacket : kOutgoingPacket, |
489 rtcp_index % 3 == 0 ? MediaType::AUDIO : MediaType::VIDEO, | 490 rtcp_index % 3 == 0 ? MediaType::AUDIO : MediaType::VIDEO, |
490 rtcp_packets[rtcp_index - 1]->Buffer(), | 491 rtcp_packets[rtcp_index - 1]->Buffer(), |
491 rtcp_packets[rtcp_index - 1]->Length()); | 492 rtcp_packets[rtcp_index - 1]->Length()); |
492 rtcp_index++; | 493 rtcp_index++; |
493 } | 494 } |
494 if (i * playout_count >= playout_index * rtp_count) { | 495 if (i * playout_count >= playout_index * rtp_count) { |
495 log_dumper->LogAudioPlayout(playout_ssrcs[playout_index - 1]); | 496 log_dumper->LogAudioPlayout(playout_ssrcs[playout_index - 1]); |
496 playout_index++; | 497 playout_index++; |
497 } | 498 } |
498 if (i * bwe_loss_count >= bwe_loss_index * rtp_count) { | 499 if (i * bwe_loss_count >= bwe_loss_index * rtp_count) { |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
636 const std::string temp_filename = | 637 const std::string temp_filename = |
637 test::OutputPath() + test_info->test_case_name() + test_info->name(); | 638 test::OutputPath() + test_info->test_case_name() + test_info->name(); |
638 | 639 |
639 // The log file will be flushed to disk when the log_dumper goes out of scope. | 640 // The log file will be flushed to disk when the log_dumper goes out of scope. |
640 { | 641 { |
641 rtc::scoped_ptr<RtcEventLog> log_dumper(RtcEventLog::Create()); | 642 rtc::scoped_ptr<RtcEventLog> log_dumper(RtcEventLog::Create()); |
642 // Reduce the time old events are stored to 50 ms. | 643 // Reduce the time old events are stored to 50 ms. |
643 log_dumper->SetBufferDuration(50000); | 644 log_dumper->SetBufferDuration(50000); |
644 log_dumper->LogVideoReceiveStreamConfig(receiver_config); | 645 log_dumper->LogVideoReceiveStreamConfig(receiver_config); |
645 log_dumper->LogVideoSendStreamConfig(sender_config); | 646 log_dumper->LogVideoSendStreamConfig(sender_config); |
646 log_dumper->LogRtpHeader(false, MediaType::AUDIO, old_rtp_packet.data(), | 647 log_dumper->LogRtpHeader(kOutgoingPacket, MediaType::AUDIO, |
647 old_rtp_packet.size()); | 648 old_rtp_packet.data(), old_rtp_packet.size()); |
648 log_dumper->LogRtcpPacket(true, MediaType::AUDIO, old_rtcp_packet->Buffer(), | 649 log_dumper->LogRtcpPacket(kIncomingPacket, MediaType::AUDIO, |
| 650 old_rtcp_packet->Buffer(), |
649 old_rtcp_packet->Length()); | 651 old_rtcp_packet->Length()); |
650 // Sleep 55 ms to let old events be removed from the queue. | 652 // Sleep 55 ms to let old events be removed from the queue. |
651 rtc::Thread::SleepMs(55); | 653 rtc::Thread::SleepMs(55); |
652 log_dumper->StartLogging(temp_filename, 10000000); | 654 log_dumper->StartLogging(temp_filename, 10000000); |
653 log_dumper->LogRtpHeader(true, MediaType::VIDEO, recent_rtp_packet.data(), | 655 log_dumper->LogRtpHeader(kIncomingPacket, MediaType::VIDEO, |
| 656 recent_rtp_packet.data(), |
654 recent_rtp_packet.size()); | 657 recent_rtp_packet.size()); |
655 log_dumper->LogRtcpPacket(false, MediaType::VIDEO, | 658 log_dumper->LogRtcpPacket(kOutgoingPacket, MediaType::VIDEO, |
656 recent_rtcp_packet->Buffer(), | 659 recent_rtcp_packet->Buffer(), |
657 recent_rtcp_packet->Length()); | 660 recent_rtcp_packet->Length()); |
658 } | 661 } |
659 | 662 |
660 // Read the generated file from disk. | 663 // Read the generated file from disk. |
661 rtclog::EventStream parsed_stream; | 664 rtclog::EventStream parsed_stream; |
662 ASSERT_TRUE(RtcEventLog::ParseRtcEventLog(temp_filename, &parsed_stream)); | 665 ASSERT_TRUE(RtcEventLog::ParseRtcEventLog(temp_filename, &parsed_stream)); |
663 | 666 |
664 // Verify that what we read back from the event log is the same as | 667 // Verify that what we read back from the event log is the same as |
665 // what we wrote. Old RTP and RTCP events should have been discarded, | 668 // what we wrote. Old RTP and RTCP events should have been discarded, |
(...skipping 16 matching lines...) Expand all Loading... |
682 // Enable all header extensions | 685 // Enable all header extensions |
683 uint32_t extensions = (1u << kNumExtensions) - 1; | 686 uint32_t extensions = (1u << kNumExtensions) - 1; |
684 uint32_t csrcs_count = 2; | 687 uint32_t csrcs_count = 2; |
685 DropOldEvents(extensions, csrcs_count, 141421356); | 688 DropOldEvents(extensions, csrcs_count, 141421356); |
686 DropOldEvents(extensions, csrcs_count, 173205080); | 689 DropOldEvents(extensions, csrcs_count, 173205080); |
687 } | 690 } |
688 | 691 |
689 } // namespace webrtc | 692 } // namespace webrtc |
690 | 693 |
691 #endif // ENABLE_RTC_EVENT_LOG | 694 #endif // ENABLE_RTC_EVENT_LOG |
OLD | NEW |