Removed unused async_invoker_ in WebRtcVideoCapturer

BUG=None

Review-Url: https://codereview.webrtc.org/3001443002
Cr-Commit-Position: refs/heads/master@{#19333}
This commit is contained in:
srte 2017-08-14 02:51:17 -07:00 committed by Commit Bot
parent 7731bc829c
commit f3238e43ce
2 changed files with 2 additions and 15 deletions

View File

@ -110,15 +110,13 @@ WebRtcVideoCapturer::WebRtcVideoCapturer()
: factory_(new WebRtcVcmFactory),
module_(nullptr),
captured_frames_(0),
start_thread_(nullptr),
async_invoker_(nullptr) {}
start_thread_(nullptr) {}
WebRtcVideoCapturer::WebRtcVideoCapturer(WebRtcVcmFactoryInterface* factory)
: factory_(factory),
module_(nullptr),
captured_frames_(0),
start_thread_(nullptr),
async_invoker_(nullptr) {}
start_thread_(nullptr) {}
WebRtcVideoCapturer::~WebRtcVideoCapturer() {}
@ -256,8 +254,6 @@ CaptureState WebRtcVideoCapturer::Start(const VideoFormat& capture_format) {
}
start_thread_ = rtc::Thread::Current();
RTC_DCHECK(!async_invoker_);
async_invoker_.reset(new rtc::AsyncInvoker());
captured_frames_ = 0;
SetCaptureFormat(&capture_format);
@ -273,7 +269,6 @@ CaptureState WebRtcVideoCapturer::Start(const VideoFormat& capture_format) {
if (module_->StartCapture(cap) != 0) {
LOG(LS_ERROR) << "Camera '" << GetId() << "' failed to start";
module_->DeRegisterCaptureDataCallback();
async_invoker_.reset();
SetCaptureFormat(nullptr);
start_thread_ = nullptr;
return CS_FAILED;
@ -294,7 +289,6 @@ void WebRtcVideoCapturer::Stop() {
}
RTC_DCHECK(start_thread_);
RTC_DCHECK(start_thread_->IsCurrent());
RTC_DCHECK(async_invoker_);
if (IsRunning()) {
// The module is responsible for OnIncomingCapturedFrame being called, if
// we stop it we will get no further callbacks.
@ -308,10 +302,6 @@ void WebRtcVideoCapturer::Stop() {
<< captured_frames_ << " frames and dropping "
<< drop_ratio << "%";
// Clear any pending async invokes (that OnIncomingCapturedFrame may have
// caused).
async_invoker_.reset();
SetCaptureFormat(NULL);
start_thread_ = nullptr;
SetCaptureState(CS_STOPPED);
@ -337,7 +327,6 @@ void WebRtcVideoCapturer::OnFrame(
const webrtc::VideoFrame& sample) {
// This can only happen between Start() and Stop().
RTC_DCHECK(start_thread_);
RTC_DCHECK(async_invoker_);
++captured_frames_;
// Log the size and pixel aspect ratio of the first captured frame.

View File

@ -78,8 +78,6 @@ class WebRtcVideoCapturer : public VideoCapturer,
int captured_frames_;
std::vector<uint8_t> capture_buffer_;
rtc::Thread* start_thread_; // Set in Start(), unset in Stop();
std::unique_ptr<rtc::AsyncInvoker> async_invoker_;
};
} // namespace cricket