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 3424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3435 std::set<uint32_t> expected_send_ssrcs_; | 3435 std::set<uint32_t> expected_send_ssrcs_; |
3436 std::string expected_cname_; | 3436 std::string expected_cname_; |
3437 | 3437 |
3438 rtc::Event check_stats_event_; | 3438 rtc::Event check_stats_event_; |
3439 ReceiveStreamRenderer receive_stream_renderer_; | 3439 ReceiveStreamRenderer receive_stream_renderer_; |
3440 } test; | 3440 } test; |
3441 | 3441 |
3442 RunBaseTest(&test); | 3442 RunBaseTest(&test); |
3443 } | 3443 } |
3444 | 3444 |
| 3445 TEST_F(EndToEndTest, GetTimingFrameInfoReportsTimingFrames) { |
| 3446 static const int kExtensionId = 5; |
| 3447 |
| 3448 class StatsObserver : public test::EndToEndTest { |
| 3449 public: |
| 3450 StatsObserver() : EndToEndTest(kLongTimeoutMs) {} |
| 3451 |
| 3452 private: |
| 3453 std::string CompoundKey(const char* name, uint32_t ssrc) { |
| 3454 std::ostringstream oss; |
| 3455 oss << name << "_" << ssrc; |
| 3456 return oss.str(); |
| 3457 } |
| 3458 |
| 3459 void ModifyVideoConfigs( |
| 3460 VideoSendStream::Config* send_config, |
| 3461 std::vector<VideoReceiveStream::Config>* receive_configs, |
| 3462 VideoEncoderConfig* encoder_config) override { |
| 3463 send_config->rtp.extensions.clear(); |
| 3464 send_config->rtp.extensions.push_back( |
| 3465 RtpExtension(RtpExtension::kVideoTimingUri, kExtensionId)); |
| 3466 for (size_t i = 0; i < receive_configs->size(); ++i) { |
| 3467 (*receive_configs)[i].rtp.extensions.clear(); |
| 3468 (*receive_configs)[i].rtp.extensions.push_back( |
| 3469 RtpExtension(RtpExtension::kVideoTimingUri, kExtensionId)); |
| 3470 } |
| 3471 } |
| 3472 |
| 3473 void OnVideoStreamsCreated( |
| 3474 VideoSendStream* send_stream, |
| 3475 const std::vector<VideoReceiveStream*>& receive_streams) override { |
| 3476 receive_streams_ = receive_streams; |
| 3477 } |
| 3478 |
| 3479 void PerformTest() override { |
| 3480 // No frames reported initially. |
| 3481 for (size_t i = 0; i < receive_streams_.size(); ++i) { |
| 3482 EXPECT_FALSE(receive_streams_[i]->GetAndResetTimingFrameInfo()); |
| 3483 } |
| 3484 // Wait for at least one timing frame to be sent with 100ms grace period. |
| 3485 SleepMs(kDefaultTimingFramesDelayMs + 100); |
| 3486 // Check that timing frames are reported for each stream. |
| 3487 for (size_t i = 0; i < receive_streams_.size(); ++i) { |
| 3488 EXPECT_TRUE(receive_streams_[i]->GetAndResetTimingFrameInfo()); |
| 3489 } |
| 3490 } |
| 3491 |
| 3492 std::vector<VideoReceiveStream*> receive_streams_; |
| 3493 } test; |
| 3494 |
| 3495 RunBaseTest(&test); |
| 3496 } |
| 3497 |
3445 class RtcpXrObserver : public test::EndToEndTest { | 3498 class RtcpXrObserver : public test::EndToEndTest { |
3446 public: | 3499 public: |
3447 RtcpXrObserver(bool enable_rrtr, bool enable_target_bitrate) | 3500 RtcpXrObserver(bool enable_rrtr, bool enable_target_bitrate) |
3448 : EndToEndTest(test::CallTest::kDefaultTimeoutMs), | 3501 : EndToEndTest(test::CallTest::kDefaultTimeoutMs), |
3449 enable_rrtr_(enable_rrtr), | 3502 enable_rrtr_(enable_rrtr), |
3450 enable_target_bitrate_(enable_target_bitrate), | 3503 enable_target_bitrate_(enable_target_bitrate), |
3451 sent_rtcp_sr_(0), | 3504 sent_rtcp_sr_(0), |
3452 sent_rtcp_rr_(0), | 3505 sent_rtcp_rr_(0), |
3453 sent_rtcp_rrtr_(0), | 3506 sent_rtcp_rrtr_(0), |
3454 sent_rtcp_target_bitrate_(false), | 3507 sent_rtcp_target_bitrate_(false), |
(...skipping 1249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4704 std::unique_ptr<VideoEncoder> encoder_; | 4757 std::unique_ptr<VideoEncoder> encoder_; |
4705 std::unique_ptr<VideoDecoder> decoder_; | 4758 std::unique_ptr<VideoDecoder> decoder_; |
4706 rtc::CriticalSection crit_; | 4759 rtc::CriticalSection crit_; |
4707 int recorded_frames_ GUARDED_BY(crit_); | 4760 int recorded_frames_ GUARDED_BY(crit_); |
4708 } test(this); | 4761 } test(this); |
4709 | 4762 |
4710 RunBaseTest(&test); | 4763 RunBaseTest(&test); |
4711 } | 4764 } |
4712 | 4765 |
4713 } // namespace webrtc | 4766 } // namespace webrtc |
OLD | NEW |