Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(48)

Side by Side Diff: content/browser/renderer_host/media/in_process_video_capture_provider.cc

Issue 2854443002: [Mojo Video Capture] Implement a VideoCaptureProvider that uses the video capture service
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 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/in_process_video_capture_provider. h" 5 #include "content/browser/renderer_host/media/in_process_video_capture_provider. h"
6 6
7 #include "content/browser/renderer_host/media/in_process_video_capture_device_la uncher.h" 7 #include "content/browser/renderer_host/media/in_process_video_capture_device_la uncher.h"
8 8
9 namespace content { 9 namespace content {
10 10
11 InProcessVideoCaptureProvider::InProcessVideoCaptureProvider( 11 InProcessVideoCaptureProvider::InProcessVideoCaptureProvider(
12 std::unique_ptr<media::VideoCaptureSystem> video_capture_system, 12 std::unique_ptr<media::VideoCaptureSystem> video_capture_system,
13 scoped_refptr<base::SingleThreadTaskRunner> device_task_runner) 13 scoped_refptr<base::SingleThreadTaskRunner> device_task_runner)
14 : video_capture_system_(std::move(video_capture_system)), 14 : video_capture_system_(std::move(video_capture_system)),
15 device_task_runner_(std::move(device_task_runner)) {} 15 device_task_runner_(std::move(device_task_runner)) {}
16 16
17 InProcessVideoCaptureProvider::~InProcessVideoCaptureProvider() = default; 17 InProcessVideoCaptureProvider::~InProcessVideoCaptureProvider() = default;
18 18
19 void InProcessVideoCaptureProvider::Uninitialize() {}
20
19 void InProcessVideoCaptureProvider::GetDeviceInfosAsync( 21 void InProcessVideoCaptureProvider::GetDeviceInfosAsync(
20 const base::Callback<void( 22 const base::Callback<void(
21 const std::vector<media::VideoCaptureDeviceInfo>&)>& result_callback) { 23 const std::vector<media::VideoCaptureDeviceInfo>&)>& result_callback) {
22 // Using Unretained() is safe because |this| owns |video_capture_system_| and 24 // Using Unretained() is safe because |this| owns |video_capture_system_| and
23 // |result_callback| has ownership of |this|. 25 // |result_callback| has ownership of |this|.
24 device_task_runner_->PostTask( 26 device_task_runner_->PostTask(
25 FROM_HERE, base::Bind(&media::VideoCaptureSystem::GetDeviceInfosAsync, 27 FROM_HERE, base::Bind(&media::VideoCaptureSystem::GetDeviceInfosAsync,
26 base::Unretained(video_capture_system_.get()), 28 base::Unretained(video_capture_system_.get()),
27 result_callback)); 29 result_callback));
28 } 30 }
29 31
30 std::unique_ptr<VideoCaptureDeviceLauncher> 32 std::unique_ptr<VideoCaptureDeviceLauncher>
31 InProcessVideoCaptureProvider::CreateDeviceLauncher() { 33 InProcessVideoCaptureProvider::CreateDeviceLauncher() {
32 return base::MakeUnique<InProcessVideoCaptureDeviceLauncher>( 34 return base::MakeUnique<InProcessVideoCaptureDeviceLauncher>(
33 device_task_runner_, video_capture_system_.get()); 35 device_task_runner_, video_capture_system_.get());
34 } 36 }
35 37
36 } // namespace content 38 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698