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(ENABLE_SCREEN_CAPTURE) | |
664 #if defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_WIN) | 665 #if defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_WIN) |
boliu
2017/01/10 17:31:51
don't need the inner define anymore
byungchul
2017/01/10 17:40:38
Done.
| |
665 video_capture_device = WebContentsVideoCaptureDevice::Create(id); | 666 video_capture_device = WebContentsVideoCaptureDevice::Create(id); |
666 #endif | 667 #endif |
668 #endif | |
667 | 669 |
668 if (!video_capture_device) { | 670 if (!video_capture_device) { |
669 device_client->OnError(FROM_HERE, "Could not create capture device"); | 671 device_client->OnError(FROM_HERE, "Could not create capture device"); |
670 return nullptr; | 672 return nullptr; |
671 } | 673 } |
672 | 674 |
673 video_capture_device->AllocateAndStart(params, std::move(device_client)); | 675 video_capture_device->AllocateAndStart(params, std::move(device_client)); |
674 return video_capture_device; | 676 return video_capture_device; |
675 } | 677 } |
676 | 678 |
(...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1321 if (!device_in_queue) { | 1323 if (!device_in_queue) { |
1322 // Session ID is only valid for Screen capture. So we can fake it to | 1324 // Session ID is only valid for Screen capture. So we can fake it to |
1323 // resume video capture devices here. | 1325 // resume video capture devices here. |
1324 QueueStartDevice(kFakeSessionId, entry.get(), entry->parameters); | 1326 QueueStartDevice(kFakeSessionId, entry.get(), entry->parameters); |
1325 } | 1327 } |
1326 } | 1328 } |
1327 } | 1329 } |
1328 #endif // defined(OS_ANDROID) | 1330 #endif // defined(OS_ANDROID) |
1329 | 1331 |
1330 } // namespace content | 1332 } // namespace content |
OLD | NEW |