| OLD | NEW |
| 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 "content/browser/renderer_host/media/screen_capture_device.h" | 5 #include "content/browser/renderer_host/media/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 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 capture_in_progress_ = true; | 340 capture_in_progress_ = true; |
| 341 screen_capturer_->Capture(webrtc::DesktopRegion()); | 341 screen_capturer_->Capture(webrtc::DesktopRegion()); |
| 342 | 342 |
| 343 // Currently only synchronous implementations of DesktopCapturer are | 343 // Currently only synchronous implementations of DesktopCapturer are |
| 344 // supported. | 344 // supported. |
| 345 DCHECK(!capture_in_progress_); | 345 DCHECK(!capture_in_progress_); |
| 346 } | 346 } |
| 347 | 347 |
| 348 ScreenCaptureDevice::ScreenCaptureDevice( | 348 ScreenCaptureDevice::ScreenCaptureDevice( |
| 349 scoped_refptr<base::SequencedTaskRunner> task_runner) | 349 scoped_refptr<base::SequencedTaskRunner> task_runner) |
| 350 : core_(new Core(task_runner)) { | 350 : core_(new Core(task_runner)), name_("Screen", "Screen") { |
| 351 name_.device_name = "Screen"; | |
| 352 } | 351 } |
| 353 | 352 |
| 354 ScreenCaptureDevice::~ScreenCaptureDevice() { | 353 ScreenCaptureDevice::~ScreenCaptureDevice() { |
| 355 DeAllocate(); | 354 DeAllocate(); |
| 356 } | 355 } |
| 357 | 356 |
| 358 void ScreenCaptureDevice::SetScreenCapturerForTest( | 357 void ScreenCaptureDevice::SetScreenCapturerForTest( |
| 359 scoped_ptr<webrtc::ScreenCapturer> capturer) { | 358 scoped_ptr<webrtc::ScreenCapturer> capturer) { |
| 360 core_->SetScreenCapturerForTest(capturer.Pass()); | 359 core_->SetScreenCapturerForTest(capturer.Pass()); |
| 361 } | 360 } |
| 362 | 361 |
| 363 void ScreenCaptureDevice::Allocate(int width, int height, | 362 void ScreenCaptureDevice::Allocate(int width, int height, |
| 364 int frame_rate, | 363 int frame_rate, |
| 365 EventHandler* event_handler) { | 364 EventHandler* event_handler) { |
| 366 core_->Allocate(width, height, frame_rate, event_handler); | 365 core_->Allocate(width, height, frame_rate, event_handler); |
| 367 } | 366 } |
| 368 | 367 |
| 369 void ScreenCaptureDevice::Start() { | 368 void ScreenCaptureDevice::Start() { |
| 370 core_->Start(); | 369 core_->Start(); |
| 371 } | 370 } |
| 372 | 371 |
| 373 void ScreenCaptureDevice::Stop() { | 372 void ScreenCaptureDevice::Stop() { |
| 374 core_->Stop(); | 373 core_->Stop(); |
| 375 } | 374 } |
| 376 | 375 |
| 377 void ScreenCaptureDevice::DeAllocate() { | 376 void ScreenCaptureDevice::DeAllocate() { |
| 378 core_->DeAllocate(); | 377 core_->DeAllocate(); |
| 379 } | 378 } |
| 380 | 379 |
| 381 const media::VideoCaptureDevice::Name& ScreenCaptureDevice::device_name() { | 380 const media::VideoCaptureDevice::Name& ScreenCaptureDevice::device_name() { |
| 382 return name_; | 381 return name_; |
| 383 } | 382 } |
| 384 | 383 |
| 385 } // namespace content | 384 } // namespace content |
| OLD | NEW |