| 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 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 send_config->rtp.extensions.push_back(RtpExtension( | 277 send_config->rtp.extensions.push_back(RtpExtension( |
| 278 RtpExtension::kVideoRotationUri, test::kVideoRotationExtensionId)); | 278 RtpExtension::kVideoRotationUri, test::kVideoRotationExtensionId)); |
| 279 } | 279 } |
| 280 | 280 |
| 281 void OnFrameGeneratorCapturerCreated( | 281 void OnFrameGeneratorCapturerCreated( |
| 282 test::FrameGeneratorCapturer* frame_generator_capturer) override { | 282 test::FrameGeneratorCapturer* frame_generator_capturer) override { |
| 283 frame_generator_capturer->SetFakeRotation(kVideoRotation_90); | 283 frame_generator_capturer->SetFakeRotation(kVideoRotation_90); |
| 284 } | 284 } |
| 285 | 285 |
| 286 void PerformTest() override { | 286 void PerformTest() override { |
| 287 EXPECT_TRUE(Wait()) << "Timed out while waiting for single RTP packet."; |
| 288 } |
| 289 } test; |
| 290 |
| 291 RunBaseTest(&test); |
| 292 } |
| 293 |
| 294 TEST_F(VideoSendStreamTest, SupportsVideoContentType) { |
| 295 class VideoRotationObserver : public test::SendTest { |
| 296 public: |
| 297 VideoRotationObserver() : SendTest(kDefaultTimeoutMs) { |
| 298 EXPECT_TRUE(parser_->RegisterRtpHeaderExtension( |
| 299 kRtpExtensionVideoContentType, test::kVideoContentTypeExtensionId)); |
| 300 } |
| 301 |
| 302 Action OnSendRtp(const uint8_t* packet, size_t length) override { |
| 303 RTPHeader header; |
| 304 EXPECT_TRUE(parser_->Parse(packet, length, &header)); |
| 305 EXPECT_TRUE(header.extension.hasVideoContentType); |
| 306 EXPECT_EQ(VideoContentType::SCREENSHARE, |
| 307 header.extension.videoContentType); |
| 308 observation_complete_.Set(); |
| 309 return SEND_PACKET; |
| 310 } |
| 311 |
| 312 void ModifyVideoConfigs( |
| 313 VideoSendStream::Config* send_config, |
| 314 std::vector<VideoReceiveStream::Config>* receive_configs, |
| 315 VideoEncoderConfig* encoder_config) override { |
| 316 send_config->rtp.extensions.clear(); |
| 317 send_config->rtp.extensions.push_back( |
| 318 RtpExtension(RtpExtension::kVideoContentTypeUri, |
| 319 test::kVideoContentTypeExtensionId)); |
| 320 encoder_config->content_type = VideoEncoderConfig::ContentType::kScreen; |
| 321 } |
| 322 |
| 323 void PerformTest() override { |
| 287 EXPECT_TRUE(Wait()) << "Timed out while waiting for single RTP packet."; | 324 EXPECT_TRUE(Wait()) << "Timed out while waiting for single RTP packet."; |
| 288 } | 325 } |
| 289 } test; | 326 } test; |
| 290 | 327 |
| 291 RunBaseTest(&test); | 328 RunBaseTest(&test); |
| 292 } | 329 } |
| 293 | 330 |
| 294 class FakeReceiveStatistics : public NullReceiveStatistics { | 331 class FakeReceiveStatistics : public NullReceiveStatistics { |
| 295 public: | 332 public: |
| 296 FakeReceiveStatistics(uint32_t send_ssrc, | 333 FakeReceiveStatistics(uint32_t send_ssrc, |
| (...skipping 2996 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3293 rtc::CriticalSection crit_; | 3330 rtc::CriticalSection crit_; |
| 3294 uint32_t max_bitrate_bps_ GUARDED_BY(&crit_); | 3331 uint32_t max_bitrate_bps_ GUARDED_BY(&crit_); |
| 3295 bool first_packet_sent_ GUARDED_BY(&crit_); | 3332 bool first_packet_sent_ GUARDED_BY(&crit_); |
| 3296 rtc::Event bitrate_changed_event_; | 3333 rtc::Event bitrate_changed_event_; |
| 3297 } test; | 3334 } test; |
| 3298 | 3335 |
| 3299 RunBaseTest(&test); | 3336 RunBaseTest(&test); |
| 3300 } | 3337 } |
| 3301 | 3338 |
| 3302 } // namespace webrtc | 3339 } // namespace webrtc |
| OLD | NEW |