Remove restart method from VideoTrackSourceInterface.
This method is no longer needed.
Review-Url: https://codereview.webrtc.org/2306013002
Cr-Original-Commit-Position: refs/heads/master@{#14060}
Cr-Mirrored-From: https://chromium.googlesource.com/external/webrtc
Cr-Mirrored-Commit: a973f953863608dab7ac82b35df08cac499a2b0f
diff --git a/api/androidvideotracksource.h b/api/androidvideotracksource.h
index a615b26..79d0df2 100644
--- a/api/androidvideotracksource.h
+++ b/api/androidvideotracksource.h
@@ -37,9 +37,6 @@
// Not used on Android.
// TODO(sakal/magjed): Try to remove this from the interface.
void Stop() override { RTC_NOTREACHED(); };
- // Not used on Android.
- // TODO(sakal/magjed): Try to remove this from the interface.
- void Restart() override { RTC_NOTREACHED(); }
bool is_screencast() const override { return is_screencast_; }
diff --git a/api/mediastreaminterface.h b/api/mediastreaminterface.h
index f64d000..33d5e5f 100644
--- a/api/mediastreaminterface.h
+++ b/api/mediastreaminterface.h
@@ -107,7 +107,6 @@
};
virtual void Stop() = 0;
- virtual void Restart() = 0;
// Indicates that parameters suitable for screencasts should be automatically
// applied to RtpSenders.
diff --git a/api/videocapturertracksource.cc b/api/videocapturertracksource.cc
index 2bef143..1bf4bea 100644
--- a/api/videocapturertracksource.cc
+++ b/api/videocapturertracksource.cc
@@ -376,19 +376,6 @@
rtc::Bind(&cricket::VideoCapturer::Stop, video_capturer_.get()));
}
-void VideoCapturerTrackSource::Restart() {
- if (started_) {
- return;
- }
- if (!worker_thread_->Invoke<bool>(
- RTC_FROM_HERE, rtc::Bind(&cricket::VideoCapturer::StartCapturing,
- video_capturer_.get(), format_))) {
- SetState(kEnded);
- return;
- }
- started_ = true;
-}
-
// OnStateChange listens to the cricket::VideoCapturer::SignalStateChange.
void VideoCapturerTrackSource::OnStateChange(
cricket::VideoCapturer* capturer,
diff --git a/api/videocapturertracksource.h b/api/videocapturertracksource.h
index 92f00dc..e7bbfd2 100644
--- a/api/videocapturertracksource.h
+++ b/api/videocapturertracksource.h
@@ -58,7 +58,6 @@
bool GetStats(Stats* stats) override;
void Stop() override;
- void Restart() override;
protected:
VideoCapturerTrackSource(rtc::Thread* worker_thread,
diff --git a/api/videocapturertracksource_unittest.cc b/api/videocapturertracksource_unittest.cc
index 90d2cd2..607188c 100644
--- a/api/videocapturertracksource_unittest.cc
+++ b/api/videocapturertracksource_unittest.cc
@@ -157,30 +157,6 @@
kMaxWaitMs);
}
-// Test that a VideoSource can be stopped and restarted.
-TEST_F(VideoCapturerTrackSourceTest, StopRestart) {
- // Initialize without constraints.
- CreateVideoCapturerSource();
- EXPECT_EQ_WAIT(MediaSourceInterface::kLive, state_observer_->state(),
- kMaxWaitMs);
-
- ASSERT_TRUE(capturer_->CaptureFrame());
- EXPECT_EQ(1, renderer_.num_rendered_frames());
-
- source_->Stop();
- EXPECT_EQ_WAIT(MediaSourceInterface::kEnded, state_observer_->state(),
- kMaxWaitMs);
-
- source_->Restart();
- EXPECT_EQ_WAIT(MediaSourceInterface::kLive, state_observer_->state(),
- kMaxWaitMs);
-
- ASSERT_TRUE(capturer_->CaptureFrame());
- EXPECT_EQ(2, renderer_.num_rendered_frames());
-
- source_->Stop();
-}
-
// Test that a VideoSource transition to kEnded if the capture device
// fails.
TEST_F(VideoCapturerTrackSourceTest, CameraFailed) {
diff --git a/api/videosourceproxy.h b/api/videosourceproxy.h
index 6d4dfcb..40f81dc 100644
--- a/api/videosourceproxy.h
+++ b/api/videosourceproxy.h
@@ -24,7 +24,6 @@
PROXY_CONSTMETHOD0(SourceState, state)
PROXY_CONSTMETHOD0(bool, remote)
PROXY_METHOD0(void, Stop)
- PROXY_METHOD0(void, Restart)
PROXY_CONSTMETHOD0(bool, is_screencast)
PROXY_CONSTMETHOD0(rtc::Optional<bool>, needs_denoising)
PROXY_METHOD1(bool, GetStats, Stats*)
diff --git a/api/videotracksource.h b/api/videotracksource.h
index 10e24ab..1d1d579 100644
--- a/api/videotracksource.h
+++ b/api/videotracksource.h
@@ -34,7 +34,6 @@
bool remote() const override { return remote_; }
void Stop() override{};
- void Restart() override{};
bool is_screencast() const override { return false; }
rtc::Optional<bool> needs_denoising() const override {