| 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 643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 654 | 654 |
| 655 std::unique_ptr<media::VideoCaptureDevice> | 655 std::unique_ptr<media::VideoCaptureDevice> |
| 656 VideoCaptureManager::DoStartTabCaptureOnDeviceThread( | 656 VideoCaptureManager::DoStartTabCaptureOnDeviceThread( |
| 657 const std::string& id, | 657 const std::string& id, |
| 658 const media::VideoCaptureParams& params, | 658 const media::VideoCaptureParams& params, |
| 659 std::unique_ptr<VideoCaptureDevice::Client> device_client) { | 659 std::unique_ptr<VideoCaptureDevice::Client> device_client) { |
| 660 SCOPED_UMA_HISTOGRAM_TIMER("Media.VideoCaptureManager.StartDeviceTime"); | 660 SCOPED_UMA_HISTOGRAM_TIMER("Media.VideoCaptureManager.StartDeviceTime"); |
| 661 DCHECK(IsOnDeviceThread()); | 661 DCHECK(IsOnDeviceThread()); |
| 662 | 662 |
| 663 std::unique_ptr<VideoCaptureDevice> video_capture_device; | 663 std::unique_ptr<VideoCaptureDevice> video_capture_device; |
| 664 #if defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_WIN) | 664 #if defined(ENABLE_SCREEN_CAPTURE) |
| 665 video_capture_device = WebContentsVideoCaptureDevice::Create(id); | 665 video_capture_device = WebContentsVideoCaptureDevice::Create(id); |
| 666 #endif | 666 #endif |
| 667 | 667 |
| 668 if (!video_capture_device) { | 668 if (!video_capture_device) { |
| 669 device_client->OnError(FROM_HERE, "Could not create capture device"); | 669 device_client->OnError(FROM_HERE, "Could not create capture device"); |
| 670 return nullptr; | 670 return nullptr; |
| 671 } | 671 } |
| 672 | 672 |
| 673 video_capture_device->AllocateAndStart(params, std::move(device_client)); | 673 video_capture_device->AllocateAndStart(params, std::move(device_client)); |
| 674 return video_capture_device; | 674 return video_capture_device; |
| (...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1321 if (!device_in_queue) { | 1321 if (!device_in_queue) { |
| 1322 // Session ID is only valid for Screen capture. So we can fake it to | 1322 // Session ID is only valid for Screen capture. So we can fake it to |
| 1323 // resume video capture devices here. | 1323 // resume video capture devices here. |
| 1324 QueueStartDevice(kFakeSessionId, entry.get(), entry->parameters); | 1324 QueueStartDevice(kFakeSessionId, entry.get(), entry->parameters); |
| 1325 } | 1325 } |
| 1326 } | 1326 } |
| 1327 } | 1327 } |
| 1328 #endif // defined(OS_ANDROID) | 1328 #endif // defined(OS_ANDROID) |
| 1329 | 1329 |
| 1330 } // namespace content | 1330 } // namespace content |
| OLD | NEW |