More cleanup of cricket::VideoCapturer

Remove unused state CS_PAUSED and dummy implementation of Pause()
Remove unused SignalVideoFrame

This should now be possible since https://codereview.chromium.org/1745923002/ has landed.

BUG=webrtc:5426

Review URL: https://codereview.webrtc.org/1832793002

Cr-Commit-Position: refs/heads/master@{#12116}
This commit is contained in:
perkj 2016-03-24 04:39:49 -07:00 committed by Commit bot
parent d61bf803d2
commit 4a3a135e68
3 changed files with 4 additions and 24 deletions

View File

@ -49,8 +49,6 @@ MediaSourceInterface::SourceState GetReadyState(cricket::CaptureState state) {
case cricket::CS_FAILED:
case cricket::CS_STOPPED:
return MediaSourceInterface::kEnded;
case cricket::CS_PAUSED:
return MediaSourceInterface::kMuted;
default:
ASSERT(false && "GetReadyState unknown state");
}

View File

@ -72,10 +72,6 @@ void VideoCapturer::Construct() {
square_pixel_aspect_ratio_ = false;
capture_state_ = CS_STOPPED;
SignalFrameCaptured.connect(this, &VideoCapturer::OnFrameCaptured);
// TODO(perkj) SignalVideoFrame is used directly by Chrome remoting.
// Before that is refactored, SignalVideoFrame must forward frames to the
// |VideoBroadcaster|;
SignalVideoFrame.connect(this, &VideoCapturer::OnFrame);
scaled_width_ = 0;
scaled_height_ = 0;
enable_video_adapter_ = true;
@ -394,7 +390,7 @@ void VideoCapturer::OnFrameCaptured(VideoCapturer*,
return;
}
SignalVideoFrame(this, adapted_frame.get());
OnFrame(this, adapted_frame.get());
UpdateStats(captured_frame);
}

View File

@ -38,7 +38,6 @@ enum CaptureState {
// still fail to start.
CS_RUNNING, // The capturer has been started successfully and is now
// capturing.
CS_PAUSED, // The capturer has been paused.
CS_FAILED, // The capturer failed to start.
};
@ -148,7 +147,6 @@ class VideoCapturer : public sigslot::has_slots<>,
// CS_STARTING: The capturer is trying to start. Success or failure will
// be notified via the |SignalStateChange| callback.
// CS_RUNNING: if the capturer is started and capturing.
// CS_PAUSED: Will never be returned.
// CS_FAILED: if the capturer failes to start..
// CS_NO_DEVICE: if the capturer has no device and fails to start.
virtual CaptureState Start(const VideoFormat& capture_format) = 0;
@ -161,13 +159,6 @@ class VideoCapturer : public sigslot::has_slots<>,
return capture_format_.get();
}
// Pause the video capturer.
// DEPRECATED
// TODO(perkj): Remove once Chrome remoting doesn't override this method.
virtual bool Pause(bool paused) {
RTC_NOTREACHED();
return false;
}
// Stop the video capturer.
virtual void Stop() = 0;
// Check if the video capturer is running.
@ -228,12 +219,6 @@ class VideoCapturer : public sigslot::has_slots<>,
void RemoveSink(rtc::VideoSinkInterface<cricket::VideoFrame>* sink) override;
protected:
// Signal the captured and possibly adapted frame to downstream consumers
// such as the encoder.
// TODO(perkj): Remove once it is not used by remoting in Chrome.
sigslot::signal2<VideoCapturer*, const VideoFrame*,
sigslot::multi_threaded_local> SignalVideoFrame;
// OnSinkWantsChanged can be overridden to change the default behavior
// when a sink changes its VideoSinkWants by calling AddOrUpdateSink.
virtual void OnSinkWantsChanged(const rtc::VideoSinkWants& wants);
@ -242,8 +227,9 @@ class VideoCapturer : public sigslot::has_slots<>,
void OnFrameCaptured(VideoCapturer* video_capturer,
const CapturedFrame* captured_frame);
// Callback attached to SignalVideoFrame.
// TODO(perkj): Remove once SignalVideoFrame is removed.
// Called when a frame has been captured and converted to a VideoFrame.
// OnFrame can be called directly by an implementation that does not use
// SignalFrameCaptured or OnFrameCaptured.
void OnFrame(VideoCapturer* capturer, const VideoFrame* frame);
CoordinatedVideoAdapter* video_adapter() { return &video_adapter_; }