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