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

Side by Side Diff: content/browser/renderer_host/media/desktop_capture_device.cc

Issue 100743003: Extend content::DesktopMediaID to allow Aura windows as capture sources. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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
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 "content/browser/renderer_host/media/desktop_capture_device.h" 5 #include "content/browser/renderer_host/media/desktop_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"
11 #include "base/strings/string_number_conversions.h" 11 #include "base/strings/string_number_conversions.h"
12 #include "base/synchronization/lock.h" 12 #include "base/synchronization/lock.h"
13 #include "base/threading/sequenced_worker_pool.h" 13 #include "base/threading/sequenced_worker_pool.h"
14 #include "content/public/browser/browser_thread.h" 14 #include "content/public/browser/browser_thread.h"
15 #include "content/public/common/desktop_media_id.h" 15 #include "content/public/browser/desktop_media_id.h"
16 #include "media/base/video_util.h" 16 #include "media/base/video_util.h"
17 #include "third_party/libyuv/include/libyuv/scale_argb.h" 17 #include "third_party/libyuv/include/libyuv/scale_argb.h"
18 #include "third_party/webrtc/modules/desktop_capture/desktop_and_cursor_composer .h" 18 #include "third_party/webrtc/modules/desktop_capture/desktop_and_cursor_composer .h"
19 #include "third_party/webrtc/modules/desktop_capture/desktop_capture_options.h" 19 #include "third_party/webrtc/modules/desktop_capture/desktop_capture_options.h"
20 #include "third_party/webrtc/modules/desktop_capture/desktop_capturer.h" 20 #include "third_party/webrtc/modules/desktop_capture/desktop_capturer.h"
21 #include "third_party/webrtc/modules/desktop_capture/desktop_frame.h" 21 #include "third_party/webrtc/modules/desktop_capture/desktop_frame.h"
22 #include "third_party/webrtc/modules/desktop_capture/mouse_cursor_monitor.h" 22 #include "third_party/webrtc/modules/desktop_capture/mouse_cursor_monitor.h"
23 #include "third_party/webrtc/modules/desktop_capture/screen_capturer.h" 23 #include "third_party/webrtc/modules/desktop_capture/screen_capturer.h"
24 #include "third_party/webrtc/modules/desktop_capture/window_capturer.h" 24 #include "third_party/webrtc/modules/desktop_capture/window_capturer.h"
25 25
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 scoped_ptr<media::VideoCaptureDevice> DesktopCaptureDevice::Create( 341 scoped_ptr<media::VideoCaptureDevice> DesktopCaptureDevice::Create(
342 const DesktopMediaID& source) { 342 const DesktopMediaID& source) {
343 scoped_refptr<base::SequencedWorkerPool> blocking_pool = 343 scoped_refptr<base::SequencedWorkerPool> blocking_pool =
344 BrowserThread::GetBlockingPool(); 344 BrowserThread::GetBlockingPool();
345 scoped_refptr<base::SequencedTaskRunner> task_runner = 345 scoped_refptr<base::SequencedTaskRunner> task_runner =
346 blocking_pool->GetSequencedTaskRunner( 346 blocking_pool->GetSequencedTaskRunner(
347 blocking_pool->GetSequenceToken()); 347 blocking_pool->GetSequenceToken());
348 348
349 webrtc::DesktopCaptureOptions options = 349 webrtc::DesktopCaptureOptions options =
350 webrtc::DesktopCaptureOptions::CreateDefault(); 350 webrtc::DesktopCaptureOptions::CreateDefault();
351
352 #if defined(OS_CHROMEOS)
353 // Xdamage is not enabled by default because it's often broken. ChromeOS'
354 // drivers [can be patched to] support DAMAGE properly, so use it.
355 options.set_use_update_notifications(true);
356 #endif
357
358 // Leave desktop effects enabled during WebRTC captures. 351 // Leave desktop effects enabled during WebRTC captures.
359 options.set_disable_effects(false); 352 options.set_disable_effects(false);
360 353
361 scoped_ptr<webrtc::DesktopCapturer> capturer; 354 scoped_ptr<webrtc::DesktopCapturer> capturer;
362 355
363 switch (source.type) { 356 switch (source.type) {
364 case DesktopMediaID::TYPE_SCREEN: { 357 case DesktopMediaID::TYPE_SCREEN: {
365 scoped_ptr<webrtc::DesktopCapturer> screen_capturer; 358 scoped_ptr<webrtc::DesktopCapturer> screen_capturer;
366 screen_capturer.reset(webrtc::ScreenCapturer::Create(options)); 359 screen_capturer.reset(webrtc::ScreenCapturer::Create(options));
367 if (screen_capturer) { 360 if (screen_capturer) {
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 const media::VideoCaptureParams& params, 401 const media::VideoCaptureParams& params,
409 scoped_ptr<Client> client) { 402 scoped_ptr<Client> client) {
410 core_->AllocateAndStart(params, client.Pass()); 403 core_->AllocateAndStart(params, client.Pass());
411 } 404 }
412 405
413 void DesktopCaptureDevice::StopAndDeAllocate() { 406 void DesktopCaptureDevice::StopAndDeAllocate() {
414 core_->StopAndDeAllocate(); 407 core_->StopAndDeAllocate();
415 } 408 }
416 409
417 } // namespace content 410 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698