| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 3611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3622 std::set<uint32_t> expected_send_ssrcs_; | 3622 std::set<uint32_t> expected_send_ssrcs_; |
| 3623 std::string expected_cname_; | 3623 std::string expected_cname_; |
| 3624 | 3624 |
| 3625 rtc::Event check_stats_event_; | 3625 rtc::Event check_stats_event_; |
| 3626 ReceiveStreamRenderer receive_stream_renderer_; | 3626 ReceiveStreamRenderer receive_stream_renderer_; |
| 3627 } test; | 3627 } test; |
| 3628 | 3628 |
| 3629 RunBaseTest(&test); | 3629 RunBaseTest(&test); |
| 3630 } | 3630 } |
| 3631 | 3631 |
| 3632 TEST_F(EndToEndTest, GetTimingFrameInfoReportsTimingFrames) { | 3632 TEST_F(EndToEndTest, TimingFramesAreReported) { |
| 3633 static const int kExtensionId = 5; | 3633 static const int kExtensionId = 5; |
| 3634 | 3634 |
| 3635 class StatsObserver : public test::EndToEndTest { | 3635 class StatsObserver : public test::EndToEndTest { |
| 3636 public: | 3636 public: |
| 3637 StatsObserver() : EndToEndTest(kLongTimeoutMs) {} | 3637 StatsObserver() : EndToEndTest(kLongTimeoutMs) {} |
| 3638 | 3638 |
| 3639 private: | 3639 private: |
| 3640 std::string CompoundKey(const char* name, uint32_t ssrc) { | |
| 3641 std::ostringstream oss; | |
| 3642 oss << name << "_" << ssrc; | |
| 3643 return oss.str(); | |
| 3644 } | |
| 3645 | |
| 3646 void ModifyVideoConfigs( | 3640 void ModifyVideoConfigs( |
| 3647 VideoSendStream::Config* send_config, | 3641 VideoSendStream::Config* send_config, |
| 3648 std::vector<VideoReceiveStream::Config>* receive_configs, | 3642 std::vector<VideoReceiveStream::Config>* receive_configs, |
| 3649 VideoEncoderConfig* encoder_config) override { | 3643 VideoEncoderConfig* encoder_config) override { |
| 3650 send_config->rtp.extensions.clear(); | 3644 send_config->rtp.extensions.clear(); |
| 3651 send_config->rtp.extensions.push_back( | 3645 send_config->rtp.extensions.push_back( |
| 3652 RtpExtension(RtpExtension::kVideoTimingUri, kExtensionId)); | 3646 RtpExtension(RtpExtension::kVideoTimingUri, kExtensionId)); |
| 3653 for (size_t i = 0; i < receive_configs->size(); ++i) { | 3647 for (size_t i = 0; i < receive_configs->size(); ++i) { |
| 3654 (*receive_configs)[i].rtp.extensions.clear(); | 3648 (*receive_configs)[i].rtp.extensions.clear(); |
| 3655 (*receive_configs)[i].rtp.extensions.push_back( | 3649 (*receive_configs)[i].rtp.extensions.push_back( |
| 3656 RtpExtension(RtpExtension::kVideoTimingUri, kExtensionId)); | 3650 RtpExtension(RtpExtension::kVideoTimingUri, kExtensionId)); |
| 3657 } | 3651 } |
| 3658 } | 3652 } |
| 3659 | 3653 |
| 3660 void OnVideoStreamsCreated( | 3654 void OnVideoStreamsCreated( |
| 3661 VideoSendStream* send_stream, | 3655 VideoSendStream* send_stream, |
| 3662 const std::vector<VideoReceiveStream*>& receive_streams) override { | 3656 const std::vector<VideoReceiveStream*>& receive_streams) override { |
| 3663 receive_streams_ = receive_streams; | 3657 receive_streams_ = receive_streams; |
| 3664 } | 3658 } |
| 3665 | 3659 |
| 3666 void PerformTest() override { | 3660 void PerformTest() override { |
| 3667 // No frames reported initially. | 3661 // No frames reported initially. |
| 3668 for (size_t i = 0; i < receive_streams_.size(); ++i) { | 3662 for (size_t i = 0; i < receive_streams_.size(); ++i) { |
| 3669 EXPECT_FALSE(receive_streams_[i]->GetAndResetTimingFrameInfo()); | 3663 EXPECT_FALSE(receive_streams_[i]->GetStats().timing_frame_info); |
| 3670 } | 3664 } |
| 3671 // Wait for at least one timing frame to be sent with 100ms grace period. | 3665 // Wait for at least one timing frame to be sent with 100ms grace period. |
| 3672 SleepMs(kDefaultTimingFramesDelayMs + 100); | 3666 SleepMs(kDefaultTimingFramesDelayMs + 100); |
| 3673 // Check that timing frames are reported for each stream. | 3667 // Check that timing frames are reported for each stream. |
| 3674 for (size_t i = 0; i < receive_streams_.size(); ++i) { | 3668 for (size_t i = 0; i < receive_streams_.size(); ++i) { |
| 3675 EXPECT_TRUE(receive_streams_[i]->GetAndResetTimingFrameInfo()); | 3669 EXPECT_TRUE(receive_streams_[i]->GetStats().timing_frame_info); |
| 3676 } | 3670 } |
| 3677 } | 3671 } |
| 3678 | 3672 |
| 3679 std::vector<VideoReceiveStream*> receive_streams_; | 3673 std::vector<VideoReceiveStream*> receive_streams_; |
| 3680 } test; | 3674 } test; |
| 3681 | 3675 |
| 3682 RunBaseTest(&test); | 3676 RunBaseTest(&test); |
| 3683 } | 3677 } |
| 3684 | 3678 |
| 3685 class RtcpXrObserver : public test::EndToEndTest { | 3679 class RtcpXrObserver : public test::EndToEndTest { |
| (...skipping 1336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5022 std::unique_ptr<VideoEncoder> encoder_; | 5016 std::unique_ptr<VideoEncoder> encoder_; |
| 5023 std::unique_ptr<VideoDecoder> decoder_; | 5017 std::unique_ptr<VideoDecoder> decoder_; |
| 5024 rtc::CriticalSection crit_; | 5018 rtc::CriticalSection crit_; |
| 5025 int recorded_frames_ GUARDED_BY(crit_); | 5019 int recorded_frames_ GUARDED_BY(crit_); |
| 5026 } test(this); | 5020 } test(this); |
| 5027 | 5021 |
| 5028 RunBaseTest(&test); | 5022 RunBaseTest(&test); |
| 5029 } | 5023 } |
| 5030 | 5024 |
| 5031 } // namespace webrtc | 5025 } // namespace webrtc |
| OLD | NEW |