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/media/capture/desktop_capture_device.h" | 5 #include "content/browser/media/capture/desktop_capture_device.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <string.h> | 9 #include <string.h> |
10 #include <utility> | 10 #include <utility> |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 switch (source.type) { | 373 switch (source.type) { |
374 case DesktopMediaID::TYPE_SCREEN: { | 374 case DesktopMediaID::TYPE_SCREEN: { |
375 std::unique_ptr<webrtc::ScreenCapturer> screen_capturer( | 375 std::unique_ptr<webrtc::ScreenCapturer> screen_capturer( |
376 webrtc::ScreenCapturer::Create(options)); | 376 webrtc::ScreenCapturer::Create(options)); |
377 if (screen_capturer && screen_capturer->SelectScreen(source.id)) { | 377 if (screen_capturer && screen_capturer->SelectScreen(source.id)) { |
378 capturer.reset(new webrtc::DesktopAndCursorComposer( | 378 capturer.reset(new webrtc::DesktopAndCursorComposer( |
379 screen_capturer.release(), | 379 screen_capturer.release(), |
380 webrtc::MouseCursorMonitor::CreateForScreen(options, | 380 webrtc::MouseCursorMonitor::CreateForScreen(options, |
381 source.id))); | 381 source.id))); |
382 IncrementDesktopCaptureCounter(SCREEN_CAPTURER_CREATED); | 382 IncrementDesktopCaptureCounter(SCREEN_CAPTURER_CREATED); |
| 383 if (source.audio_share) { |
| 384 IncrementDesktopCaptureCounter( |
| 385 SCREEN_CAPTURER_CREATED_WITH_AUDIO); |
| 386 } else { |
| 387 IncrementDesktopCaptureCounter( |
| 388 SCREEN_CAPTURER_CREATED_WITHOUT_AUDIO); |
| 389 } |
383 } | 390 } |
384 break; | 391 break; |
385 } | 392 } |
386 | 393 |
387 case DesktopMediaID::TYPE_WINDOW: { | 394 case DesktopMediaID::TYPE_WINDOW: { |
388 std::unique_ptr<webrtc::WindowCapturer> window_capturer( | 395 std::unique_ptr<webrtc::WindowCapturer> window_capturer( |
389 webrtc::CroppingWindowCapturer::Create(options)); | 396 webrtc::CroppingWindowCapturer::Create(options)); |
390 if (window_capturer && window_capturer->SelectWindow(source.id)) { | 397 if (window_capturer && window_capturer->SelectWindow(source.id)) { |
391 window_capturer->BringSelectedWindowToFront(); | 398 window_capturer->BringSelectedWindowToFront(); |
392 capturer.reset(new webrtc::DesktopAndCursorComposer( | 399 capturer.reset(new webrtc::DesktopAndCursorComposer( |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
450 #else | 457 #else |
451 base::MessageLoop::Type thread_type = base::MessageLoop::TYPE_DEFAULT; | 458 base::MessageLoop::Type thread_type = base::MessageLoop::TYPE_DEFAULT; |
452 #endif | 459 #endif |
453 | 460 |
454 thread_.StartWithOptions(base::Thread::Options(thread_type, 0)); | 461 thread_.StartWithOptions(base::Thread::Options(thread_type, 0)); |
455 | 462 |
456 core_.reset(new Core(thread_.task_runner(), std::move(capturer), type)); | 463 core_.reset(new Core(thread_.task_runner(), std::move(capturer), type)); |
457 } | 464 } |
458 | 465 |
459 } // namespace content | 466 } // namespace content |
OLD | NEW |