diff --git a/call/bitrate_estimator_tests.cc b/call/bitrate_estimator_tests.cc index 0862827d3a..66c68c362e 100644 --- a/call/bitrate_estimator_tests.cc +++ b/call/bitrate_estimator_tests.cc @@ -183,7 +183,6 @@ class BitrateEstimatorTest : public test::CallTest { send_stream_->SetSource(frame_generator_capturer_.get(), DegradationPreference::MAINTAIN_FRAMERATE); send_stream_->Start(); - frame_generator_capturer_->Start(); VideoReceiveStream::Decoder decoder; decoder.decoder_factory = &decoder_factory_; @@ -215,7 +214,6 @@ class BitrateEstimatorTest : public test::CallTest { void StopSending() { if (is_sending_receiving_) { - frame_generator_capturer_->Stop(); send_stream_->Stop(); if (video_receive_stream_) { video_receive_stream_->Stop(); diff --git a/pc/test/framegeneratorcapturervideotracksource.h b/pc/test/framegeneratorcapturervideotracksource.h index 77e78e0c98..d076162ae5 100644 --- a/pc/test/framegeneratorcapturervideotracksource.h +++ b/pc/test/framegeneratorcapturervideotracksource.h @@ -49,12 +49,10 @@ class FrameGeneratorCapturerVideoTrackSource : public VideoTrackSource { ~FrameGeneratorCapturerVideoTrackSource() = default; void Start() { - video_capturer_->Start(); SetState(kLive); } void Stop() { - video_capturer_->Stop(); SetState(kMuted); } diff --git a/test/call_test.cc b/test/call_test.cc index 5d2bbcadb2..7a010790d8 100644 --- a/test/call_test.cc +++ b/test/call_test.cc @@ -588,7 +588,6 @@ void CallTest::Start() { } for (AudioReceiveStream* audio_recv_stream : audio_receive_streams_) audio_recv_stream->Start(); - StartVideoCapture(); } void CallTest::StartVideoStreams() { @@ -598,13 +597,7 @@ void CallTest::StartVideoStreams() { video_recv_stream->Start(); } -void CallTest::StartVideoCapture() { - for (auto& capturer : video_capturers_) - capturer->Start(); -} - void CallTest::Stop() { - StopVideoCapture(); for (AudioReceiveStream* audio_recv_stream : audio_receive_streams_) audio_recv_stream->Stop(); if (audio_send_stream_) { @@ -613,11 +606,6 @@ void CallTest::Stop() { StopVideoStreams(); } -void CallTest::StopVideoCapture() { - for (auto& capturer : video_capturers_) - capturer->Stop(); -} - void CallTest::StopVideoStreams() { for (VideoSendStream* video_send_stream : video_send_streams_) video_send_stream->Stop(); diff --git a/test/call_test.h b/test/call_test.h index 8961b7fccb..edd7712b7c 100644 --- a/test/call_test.h +++ b/test/call_test.h @@ -154,9 +154,7 @@ class CallTest : public ::testing::Test { void Start(); void StartVideoStreams(); - void StartVideoCapture(); void Stop(); - void StopVideoCapture(); void StopVideoStreams(); void DestroyStreams(); void DestroyVideoSendStreams(); diff --git a/test/frame_generator_capturer.cc b/test/frame_generator_capturer.cc index 6ca1ddb8bd..858f895f64 100644 --- a/test/frame_generator_capturer.cc +++ b/test/frame_generator_capturer.cc @@ -126,7 +126,7 @@ FrameGeneratorCapturer::FrameGeneratorCapturer( std::unique_ptr frame_generator, int target_fps) : clock_(clock), - sending_(false), + sending_(true), sink_(nullptr), sink_wants_observer_(nullptr), frame_generator_(std::move(frame_generator)), diff --git a/test/frame_generator_capturer.h b/test/frame_generator_capturer.h index a5e60a5eb5..cc938b03d1 100644 --- a/test/frame_generator_capturer.h +++ b/test/frame_generator_capturer.h @@ -61,8 +61,8 @@ class FrameGeneratorCapturer : public TestVideoCapturer { Clock* clock); virtual ~FrameGeneratorCapturer(); - void Start() override; - void Stop() override; + void Start(); + void Stop(); void ChangeResolution(size_t width, size_t height); void ChangeFramerate(int target_framerate); diff --git a/test/scenario/scenario.cc b/test/scenario/scenario.cc index 7589878d5b..6b0990d29c 100644 --- a/test/scenario/scenario.cc +++ b/test/scenario/scenario.cc @@ -375,7 +375,6 @@ void Scenario::Start() { void Scenario::Stop() { RTC_DCHECK(start_time_.IsFinite()); for (auto& stream_pair : video_streams_) { - stream_pair->send()->video_capturer_->Stop(); stream_pair->send()->send_stream_->Stop(); } for (auto& stream_pair : audio_streams_) diff --git a/test/scenario/video_stream.cc b/test/scenario/video_stream.cc index 36399234ad..11c5ef1165 100644 --- a/test/scenario/video_stream.cc +++ b/test/scenario/video_stream.cc @@ -255,7 +255,6 @@ SendVideoStream::~SendVideoStream() { void SendVideoStream::Start() { send_stream_->Start(); - video_capturer_->Start(); sender_->call_->SignalChannelNetworkState(MediaType::VIDEO, kNetworkUp); } diff --git a/test/test_video_capturer.h b/test/test_video_capturer.h index 4611429ee3..93b3e8f2d8 100644 --- a/test/test_video_capturer.h +++ b/test/test_video_capturer.h @@ -34,9 +34,6 @@ class TestVideoCapturer : public rtc::VideoSourceInterface { TestVideoCapturer(); virtual ~TestVideoCapturer(); - virtual void Start() = 0; - virtual void Stop() = 0; - void AddOrUpdateSink(rtc::VideoSinkInterface* sink, const rtc::VideoSinkWants& wants) override; diff --git a/test/vcm_capturer.cc b/test/vcm_capturer.cc index 67e8272e53..40402f88cb 100644 --- a/test/vcm_capturer.cc +++ b/test/vcm_capturer.cc @@ -22,7 +22,7 @@ namespace webrtc { namespace test { -VcmCapturer::VcmCapturer() : started_(false), sink_(nullptr), vcm_(nullptr) {} +VcmCapturer::VcmCapturer() : sink_(nullptr), vcm_(nullptr) {} bool VcmCapturer::Init(size_t width, size_t height, @@ -74,16 +74,6 @@ VcmCapturer* VcmCapturer::Create(size_t width, return vcm_capturer.release(); } -void VcmCapturer::Start() { - rtc::CritScope lock(&crit_); - started_ = true; -} - -void VcmCapturer::Stop() { - rtc::CritScope lock(&crit_); - started_ = false; -} - void VcmCapturer::AddOrUpdateSink(rtc::VideoSinkInterface* sink, const rtc::VideoSinkWants& wants) { rtc::CritScope lock(&crit_); @@ -114,7 +104,7 @@ VcmCapturer::~VcmCapturer() { void VcmCapturer::OnFrame(const VideoFrame& frame) { rtc::CritScope lock(&crit_); - if (started_ && sink_) { + if (sink_) { absl::optional out_frame = AdaptFrame(frame); if (out_frame) sink_->OnFrame(*out_frame); diff --git a/test/vcm_capturer.h b/test/vcm_capturer.h index 5f4707f911..208a77158a 100644 --- a/test/vcm_capturer.h +++ b/test/vcm_capturer.h @@ -30,8 +30,6 @@ class VcmCapturer : public TestVideoCapturer, size_t capture_device_index); virtual ~VcmCapturer(); - void Start() override; - void Stop() override; void AddOrUpdateSink(rtc::VideoSinkInterface* sink, const rtc::VideoSinkWants& wants) override; void RemoveSink(rtc::VideoSinkInterface* sink) override; @@ -47,7 +45,6 @@ class VcmCapturer : public TestVideoCapturer, void Destroy(); rtc::CriticalSection crit_; - bool started_ RTC_GUARDED_BY(crit_); rtc::VideoSinkInterface* sink_ RTC_GUARDED_BY(crit_); rtc::scoped_refptr vcm_; VideoCaptureCapability capability_; diff --git a/video/end_to_end_tests/multi_codec_receive_tests.cc b/video/end_to_end_tests/multi_codec_receive_tests.cc index c58f0fe16a..4e070e7951 100644 --- a/video/end_to_end_tests/multi_codec_receive_tests.cc +++ b/video/end_to_end_tests/multi_codec_receive_tests.cc @@ -219,7 +219,6 @@ void MultiCodecReceiveTest::RunTestWithCodecs( for (size_t i = 1; i < configs.size(); ++i) { // Recreate VideoSendStream with new config (codec, temporal layers). task_queue_.SendTask([this, i, &configs]() { - frame_generator_capturer_->Stop(); DestroyVideoSendStreams(); observer_.Reset(); @@ -228,7 +227,6 @@ void MultiCodecReceiveTest::RunTestWithCodecs( GetVideoSendStream()->Start(); CreateFrameGeneratorCapturer(kFps, kWidth / 2, kHeight / 2); ConnectVideoSourcesToStreams(); - frame_generator_capturer_->Start(); }); EXPECT_TRUE(observer_.Wait()) << "Timed out waiting for frames."; } diff --git a/video/end_to_end_tests/rtp_rtcp_tests.cc b/video/end_to_end_tests/rtp_rtcp_tests.cc index f19c6ad3fa..6c510f187e 100644 --- a/video/end_to_end_tests/rtp_rtcp_tests.cc +++ b/video/end_to_end_tests/rtp_rtcp_tests.cc @@ -323,7 +323,6 @@ void RtpRtcpEndToEndTest::TestRtpStatePreservation( // get set once (this could be due to using std::map::insert for instance). for (size_t i = 0; i < 3; ++i) { task_queue_.SendTask([&]() { - frame_generator_capturer_->Stop(); DestroyVideoSendStreams(); // Re-create VideoSendStream with only one stream. @@ -339,7 +338,6 @@ void RtpRtcpEndToEndTest::TestRtpStatePreservation( ->SendRtcp(packet.data(), packet.size()); } CreateFrameGeneratorCapturer(30, 1280, 720); - frame_generator_capturer_->Start(); }); observer.ResetExpectedSsrcs(1); @@ -560,13 +558,11 @@ TEST_F(RtpRtcpEndToEndTest, DISABLED_TestFlexfecRtpStatePreservation) { task_queue_.SendTask([this, &observer]() { // Ensure monotonicity when the VideoSendStream is recreated. - frame_generator_capturer_->Stop(); DestroyVideoSendStreams(); observer.ResetPacketCount(); CreateVideoSendStreams(); GetVideoSendStream()->Start(); CreateFrameGeneratorCapturer(kFrameRate, kFrameMaxWidth, kFrameMaxHeight); - frame_generator_capturer_->Start(); }); EXPECT_TRUE(observer.Wait()) << "Timed out waiting for packets."; diff --git a/video/picture_id_tests.cc b/video/picture_id_tests.cc index 6ce0c99ffe..4d08373da1 100644 --- a/video/picture_id_tests.cc +++ b/video/picture_id_tests.cc @@ -363,7 +363,6 @@ void PictureIdTest::TestPictureIdIncreaseAfterRecreateStreams( observer_->SetMaxExpectedPictureIdGap(kMaxFramesLost); for (int ssrc_count : ssrc_counts) { task_queue_.SendTask([this, &ssrc_count]() { - frame_generator_capturer_->Stop(); DestroyVideoSendStreams(); GetVideoEncoderConfig()->number_of_streams = ssrc_count; @@ -373,7 +372,6 @@ void PictureIdTest::TestPictureIdIncreaseAfterRecreateStreams( CreateVideoSendStreams(); GetVideoSendStream()->Start(); CreateFrameGeneratorCapturer(kFrameRate, kFrameMaxWidth, kFrameMaxHeight); - frame_generator_capturer_->Start(); }); EXPECT_TRUE(observer_->Wait()) << "Timed out waiting for packets."; diff --git a/video/video_quality_test.cc b/video/video_quality_test.cc index b5290d8463..0f0fa95b62 100644 --- a/video/video_quality_test.cc +++ b/video/video_quality_test.cc @@ -953,18 +953,6 @@ void VideoQualityTest::StartAudioStreams() { audio_recv_stream->Start(); } -void VideoQualityTest::StartThumbnailCapture() { - for (std::unique_ptr& capturer : - thumbnail_capturers_) - capturer->Start(); -} - -void VideoQualityTest::StopThumbnailCapture() { - for (std::unique_ptr& capturer : - thumbnail_capturers_) - capturer->Stop(); -} - void VideoQualityTest::StartThumbnails() { for (VideoSendStream* send_stream : thumbnail_send_streams_) send_stream->Start(); @@ -1130,14 +1118,11 @@ void VideoQualityTest::RunWithAnalyzer(const Params& params) { StartVideoStreams(); StartThumbnails(); analyzer_->StartMeasuringCpuProcessTime(); - StartVideoCapture(); - StartThumbnailCapture(); }); analyzer_->Wait(); task_queue_.SendTask([&]() { - StopThumbnailCapture(); StopThumbnails(); Stop(); diff --git a/video/video_quality_test.h b/video/video_quality_test.h index f67e65bc13..ab6ef2d477 100644 --- a/video/video_quality_test.h +++ b/video/video_quality_test.h @@ -82,8 +82,6 @@ class VideoQualityTest : void SetupVideo(Transport* send_transport, Transport* recv_transport); void SetupThumbnails(Transport* send_transport, Transport* recv_transport); void StartAudioStreams(); - void StartThumbnailCapture(); - void StopThumbnailCapture(); void StartThumbnails(); void StopThumbnails(); void DestroyThumbnailStreams();