Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "content/browser/renderer_host/media/in_process_video_capture_provider. h" | |
| 6 | |
| 7 #include "content/browser/renderer_host/media/in_process_buildable_video_capture _device.h" | |
| 8 | |
| 9 namespace content { | |
| 10 | |
| 11 InProcessVideoCaptureProvider::InProcessVideoCaptureProvider( | |
| 12 std::unique_ptr<media::VideoCaptureSystem> video_capture_system, | |
| 13 scoped_refptr<base::SingleThreadTaskRunner> device_task_runner) | |
| 14 : video_capture_system_(std::move(video_capture_system)), | |
| 15 device_task_runner_(std::move(device_task_runner)) {} | |
| 16 | |
| 17 InProcessVideoCaptureProvider::~InProcessVideoCaptureProvider() = default; | |
|
emircan
2017/04/10 20:48:12
This class is owned by VideoCaptureManager. Since
chfremer
2017/04/10 22:24:43
The threading model of this class has 3 aspects:
1
| |
| 18 | |
| 19 void InProcessVideoCaptureProvider::GetDeviceInfosAsync( | |
| 20 const base::Callback<void( | |
| 21 const std::vector<media::VideoCaptureDeviceInfo>&)>& result_callback) { | |
| 22 device_task_runner_->PostTask( | |
| 23 FROM_HERE, base::Bind(&media::VideoCaptureSystem::GetDeviceInfosAsync, | |
| 24 base::Unretained(video_capture_system_.get()), | |
|
emircan
2017/04/10 20:48:12
Add a comment why it is safe to use Unretained. AF
chfremer
2017/04/10 22:24:43
Done.
| |
| 25 result_callback)); | |
| 26 } | |
| 27 | |
| 28 std::unique_ptr<BuildableVideoCaptureDevice> | |
| 29 InProcessVideoCaptureProvider::CreateBuildableDevice( | |
| 30 const std::string& device_id, | |
| 31 MediaStreamType stream_type) { | |
| 32 return base::MakeUnique<InProcessBuildableVideoCaptureDevice>( | |
| 33 device_task_runner_, video_capture_system_.get()); | |
| 34 } | |
| 35 | |
| 36 } // namespace content | |
| OLD | NEW |