Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(378)

Side by Side Diff: media/video/capture/screen/screen_capture_device.cc

Issue 14305004: Simplify ScreenCapturer interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | media/video/capture/screen/screen_capture_device_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/video/capture/screen/screen_capture_device.h" 5 #include "media/video/capture/screen/screen_capture_device.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/sequenced_task_runner.h" 10 #include "base/sequenced_task_runner.h"
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 301
302 void ScreenCaptureDevice::Core::DoStop() { 302 void ScreenCaptureDevice::Core::DoStop() {
303 DCHECK(task_runner_->RunsTasksOnCurrentThread()); 303 DCHECK(task_runner_->RunsTasksOnCurrentThread());
304 started_ = false; 304 started_ = false;
305 resized_bitmap_.reset(); 305 resized_bitmap_.reset();
306 } 306 }
307 307
308 void ScreenCaptureDevice::Core::DoDeAllocate() { 308 void ScreenCaptureDevice::Core::DoDeAllocate() {
309 DCHECK(task_runner_->RunsTasksOnCurrentThread()); 309 DCHECK(task_runner_->RunsTasksOnCurrentThread());
310 DoStop(); 310 DoStop();
311 if (screen_capturer_) { 311 screen_capturer_.reset();
312 screen_capturer_->Stop();
313 screen_capturer_.reset();
314 }
315 waiting_for_frame_size_ = false; 312 waiting_for_frame_size_ = false;
316 } 313 }
317 314
318 void ScreenCaptureDevice::Core::ScheduleCaptureTimer() { 315 void ScreenCaptureDevice::Core::ScheduleCaptureTimer() {
319 DCHECK(!capture_task_posted_); 316 DCHECK(!capture_task_posted_);
320 capture_task_posted_ = true; 317 capture_task_posted_ = true;
321 task_runner_->PostDelayedTask( 318 task_runner_->PostDelayedTask(
322 FROM_HERE, base::Bind(&Core::OnCaptureTimer, this), 319 FROM_HERE, base::Bind(&Core::OnCaptureTimer, this),
323 base::TimeDelta::FromSeconds(1) / frame_rate_); 320 base::TimeDelta::FromSeconds(1) / frame_rate_);
324 } 321 }
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 377
381 void ScreenCaptureDevice::DeAllocate() { 378 void ScreenCaptureDevice::DeAllocate() {
382 core_->DeAllocate(); 379 core_->DeAllocate();
383 } 380 }
384 381
385 const VideoCaptureDevice::Name& ScreenCaptureDevice::device_name() { 382 const VideoCaptureDevice::Name& ScreenCaptureDevice::device_name() {
386 return name_; 383 return name_;
387 } 384 }
388 385
389 } // namespace media 386 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | media/video/capture/screen/screen_capture_device_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698