diff --git a/pc/peer_connection_rampup_tests.cc b/pc/peer_connection_rampup_tests.cc index 93a2724d95..dd769e684c 100644 --- a/pc/peer_connection_rampup_tests.cc +++ b/pc/peer_connection_rampup_tests.cc @@ -122,7 +122,7 @@ class PeerConnectionWrapperForRampUpTest : public PeerConnectionWrapper { Clock* clock) { video_track_sources_.emplace_back( new rtc::RefCountedObject( - config, clock)); + config, clock, /*is_screencast=*/false)); video_track_sources_.back()->Start(); return rtc::scoped_refptr( pc_factory()->CreateVideoTrack(rtc::CreateRandomUuid(), diff --git a/pc/test/frame_generator_capturer_video_track_source.h b/pc/test/frame_generator_capturer_video_track_source.h index 06b4193bc7..229a66a233 100644 --- a/pc/test/frame_generator_capturer_video_track_source.h +++ b/pc/test/frame_generator_capturer_video_track_source.h @@ -40,12 +40,12 @@ class FrameGeneratorCapturerVideoTrackSource : public VideoTrackSource { int num_squares_generated = 50; }; - explicit FrameGeneratorCapturerVideoTrackSource(Clock* clock) - : FrameGeneratorCapturerVideoTrackSource(Config(), clock) {} - - FrameGeneratorCapturerVideoTrackSource(Config config, Clock* clock) + FrameGeneratorCapturerVideoTrackSource(Config config, + Clock* clock, + bool is_screencast) : VideoTrackSource(false /* remote */), - task_queue_factory_(CreateDefaultTaskQueueFactory()) { + task_queue_factory_(CreateDefaultTaskQueueFactory()), + is_screencast_(is_screencast) { video_capturer_ = absl::make_unique( clock, test::FrameGenerator::CreateSquareGenerator( @@ -55,10 +55,12 @@ class FrameGeneratorCapturerVideoTrackSource : public VideoTrackSource { video_capturer_->Init(); } - explicit FrameGeneratorCapturerVideoTrackSource( - std::unique_ptr video_capturer) + FrameGeneratorCapturerVideoTrackSource( + std::unique_ptr video_capturer, + bool is_screencast) : VideoTrackSource(false /* remote */), - video_capturer_(std::move(video_capturer)) {} + video_capturer_(std::move(video_capturer)), + is_screencast_(is_screencast) {} ~FrameGeneratorCapturerVideoTrackSource() = default; @@ -70,6 +72,8 @@ class FrameGeneratorCapturerVideoTrackSource : public VideoTrackSource { SetState(kMuted); } + bool is_screencast() const override { return is_screencast_; } + protected: rtc::VideoSourceInterface* source() override { return video_capturer_.get(); @@ -78,6 +82,7 @@ class FrameGeneratorCapturerVideoTrackSource : public VideoTrackSource { private: const std::unique_ptr task_queue_factory_; std::unique_ptr video_capturer_; + const bool is_screencast_; }; } // namespace webrtc diff --git a/test/pc/e2e/peer_connection_quality_test.cc b/test/pc/e2e/peer_connection_quality_test.cc index 7e7a47c59b..d3ddb2ad9d 100644 --- a/test/pc/e2e/peer_connection_quality_test.cc +++ b/test/pc/e2e/peer_connection_quality_test.cc @@ -646,13 +646,17 @@ PeerConnectionE2EQualityTest::MaybeAddVideo(TestPeer* peer) { capturer->Init(); rtc::scoped_refptr source = new rtc::RefCountedObject( - std::move(capturer)); + std::move(capturer), + /*is_screencast=*/video_config.screen_share_config.has_value()); out.push_back(source); RTC_LOG(INFO) << "Adding video with video_config.stream_label=" << video_config.stream_label.value(); rtc::scoped_refptr track = peer->pc_factory()->CreateVideoTrack(video_config.stream_label.value(), source); + if (video_config.screen_share_config) { + track->set_content_hint(VideoTrackInterface::ContentHint::kText); + } peer->AddTrack(track, {video_config.stream_label.value()}); } return out;