| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/video_capture_manager.h" | 5 #include "content/browser/renderer_host/media/video_capture_manager.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 613 #if defined(ENABLE_SCREEN_CAPTURE) | 613 #if defined(ENABLE_SCREEN_CAPTURE) |
| 614 DesktopMediaID desktop_id = DesktopMediaID::Parse(id); | 614 DesktopMediaID desktop_id = DesktopMediaID::Parse(id); |
| 615 if (desktop_id.is_null()) { | 615 if (desktop_id.is_null()) { |
| 616 device_client->OnError(FROM_HERE, "Desktop media ID is null"); | 616 device_client->OnError(FROM_HERE, "Desktop media ID is null"); |
| 617 return nullptr; | 617 return nullptr; |
| 618 } | 618 } |
| 619 | 619 |
| 620 if (desktop_id.type == DesktopMediaID::TYPE_WEB_CONTENTS) { | 620 if (desktop_id.type == DesktopMediaID::TYPE_WEB_CONTENTS) { |
| 621 video_capture_device.reset(WebContentsVideoCaptureDevice::Create(id)); | 621 video_capture_device.reset(WebContentsVideoCaptureDevice::Create(id)); |
| 622 IncrementDesktopCaptureCounter(TAB_VIDEO_CAPTURER_CREATED); | 622 IncrementDesktopCaptureCounter(TAB_VIDEO_CAPTURER_CREATED); |
| 623 if (desktop_id.audio_share) { |
| 624 IncrementDesktopCaptureCounter(TAB_VIDEO_CAPTURER_CREATED_WITH_AUDIO); |
| 625 } else { |
| 626 IncrementDesktopCaptureCounter(TAB_VIDEO_CAPTURER_CREATED_WITHOUT_AUDIO); |
| 627 } |
| 623 } else { | 628 } else { |
| 624 #if defined(USE_AURA) | 629 #if defined(USE_AURA) |
| 625 video_capture_device = DesktopCaptureDeviceAura::Create(desktop_id); | 630 video_capture_device = DesktopCaptureDeviceAura::Create(desktop_id); |
| 626 #endif | 631 #endif |
| 627 if (!video_capture_device) | 632 if (!video_capture_device) |
| 628 video_capture_device = DesktopCaptureDevice::Create(desktop_id); | 633 video_capture_device = DesktopCaptureDevice::Create(desktop_id); |
| 629 } | 634 } |
| 630 #endif // defined(ENABLE_SCREEN_CAPTURE) | 635 #endif // defined(ENABLE_SCREEN_CAPTURE) |
| 631 | 636 |
| 632 if (!video_capture_device) { | 637 if (!video_capture_device) { |
| (...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1262 if (!device_in_queue) { | 1267 if (!device_in_queue) { |
| 1263 // Session ID is only valid for Screen capture. So we can fake it to | 1268 // Session ID is only valid for Screen capture. So we can fake it to |
| 1264 // resume video capture devices here. | 1269 // resume video capture devices here. |
| 1265 QueueStartDevice(kFakeSessionId, entry.get(), entry->parameters); | 1270 QueueStartDevice(kFakeSessionId, entry.get(), entry->parameters); |
| 1266 } | 1271 } |
| 1267 } | 1272 } |
| 1268 } | 1273 } |
| 1269 #endif // defined(OS_ANDROID) | 1274 #endif // defined(OS_ANDROID) |
| 1270 | 1275 |
| 1271 } // namespace content | 1276 } // namespace content |
| OLD | NEW |