| 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> // max | 10 #include <algorithm> // max |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 void PerformTest() override { | 330 void PerformTest() override { |
| 331 EXPECT_TRUE(Wait()) << "Timed out while waiting for single RTP packet."; | 331 EXPECT_TRUE(Wait()) << "Timed out while waiting for single RTP packet."; |
| 332 } | 332 } |
| 333 } test; | 333 } test; |
| 334 | 334 |
| 335 test::ScopedFieldTrials override_field_trials( | 335 test::ScopedFieldTrials override_field_trials( |
| 336 "WebRTC-VideoContentTypeExtension/Enabled/"); | 336 "WebRTC-VideoContentTypeExtension/Enabled/"); |
| 337 RunBaseTest(&test); | 337 RunBaseTest(&test); |
| 338 } | 338 } |
| 339 | 339 |
| 340 TEST_F(VideoSendStreamTest, SupportsVideoTimingFrames) { |
| 341 class VideoRotationObserver : public test::SendTest { |
| 342 public: |
| 343 VideoRotationObserver() : SendTest(kDefaultTimeoutMs) { |
| 344 EXPECT_TRUE(parser_->RegisterRtpHeaderExtension( |
| 345 kRtpExtensionVideoTiming, test::kVideoTimingExtensionId)); |
| 346 } |
| 347 |
| 348 Action OnSendRtp(const uint8_t* packet, size_t length) override { |
| 349 RTPHeader header; |
| 350 EXPECT_TRUE(parser_->Parse(packet, length, &header)); |
| 351 if (header.extension.has_video_timing) { |
| 352 observation_complete_.Set(); |
| 353 } |
| 354 return SEND_PACKET; |
| 355 } |
| 356 |
| 357 void ModifyVideoConfigs( |
| 358 VideoSendStream::Config* send_config, |
| 359 std::vector<VideoReceiveStream::Config>* receive_configs, |
| 360 VideoEncoderConfig* encoder_config) override { |
| 361 send_config->rtp.extensions.clear(); |
| 362 send_config->rtp.extensions.push_back(RtpExtension( |
| 363 RtpExtension::kVideoTimingUri, test::kVideoTimingExtensionId)); |
| 364 } |
| 365 |
| 366 void PerformTest() override { |
| 367 EXPECT_TRUE(Wait()) << "Timed out while waiting for timing frames."; |
| 368 } |
| 369 } test; |
| 370 |
| 371 RunBaseTest(&test); |
| 372 } |
| 373 |
| 340 class FakeReceiveStatistics : public NullReceiveStatistics { | 374 class FakeReceiveStatistics : public NullReceiveStatistics { |
| 341 public: | 375 public: |
| 342 FakeReceiveStatistics(uint32_t send_ssrc, | 376 FakeReceiveStatistics(uint32_t send_ssrc, |
| 343 uint32_t last_sequence_number, | 377 uint32_t last_sequence_number, |
| 344 uint32_t cumulative_lost, | 378 uint32_t cumulative_lost, |
| 345 uint8_t fraction_lost) | 379 uint8_t fraction_lost) |
| 346 : lossy_stats_(new LossyStatistician(last_sequence_number, | 380 : lossy_stats_(new LossyStatistician(last_sequence_number, |
| 347 cumulative_lost, | 381 cumulative_lost, |
| 348 fraction_lost)) { | 382 fraction_lost)) { |
| 349 stats_map_[send_ssrc] = lossy_stats_.get(); | 383 stats_map_[send_ssrc] = lossy_stats_.get(); |
| (...skipping 2984 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3334 rtc::CriticalSection crit_; | 3368 rtc::CriticalSection crit_; |
| 3335 uint32_t max_bitrate_bps_ GUARDED_BY(&crit_); | 3369 uint32_t max_bitrate_bps_ GUARDED_BY(&crit_); |
| 3336 bool first_packet_sent_ GUARDED_BY(&crit_); | 3370 bool first_packet_sent_ GUARDED_BY(&crit_); |
| 3337 rtc::Event bitrate_changed_event_; | 3371 rtc::Event bitrate_changed_event_; |
| 3338 } test; | 3372 } test; |
| 3339 | 3373 |
| 3340 RunBaseTest(&test); | 3374 RunBaseTest(&test); |
| 3341 } | 3375 } |
| 3342 | 3376 |
| 3343 } // namespace webrtc | 3377 } // namespace webrtc |
| OLD | NEW |