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

Side by Side Diff: media/capture/video/chromeos/video_capture_device_factory_chromeos.cc

Issue 2878233002: media: add ArcCamera3Service Mojo service (Closed)
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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 "media/capture/video/chromeos/video_capture_device_factory_chromeos.h" 5 #include "media/capture/video/chromeos/video_capture_device_factory_chromeos.h"
6 6
7 #include "base/files/file_util.h" 7 #include "base/files/file_util.h"
8 #include "media/capture/video/linux/video_capture_device_factory_linux.h" 8 #include "media/capture/video/linux/video_capture_device_factory_linux.h"
9 9
10 namespace media { 10 namespace media {
11 11
12 VideoCaptureDeviceFactoryChromeOS::VideoCaptureDeviceFactoryChromeOS( 12 VideoCaptureDeviceFactoryChromeOS::VideoCaptureDeviceFactoryChromeOS(
13 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) 13 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner)
14 : ui_task_runner_(ui_task_runner), module_thread_("CameraModuleThread") {} 14 : ui_task_runner_(ui_task_runner), module_thread_("CameraModuleThread") {}
15 15
16 VideoCaptureDeviceFactoryChromeOS::~VideoCaptureDeviceFactoryChromeOS() {} 16 VideoCaptureDeviceFactoryChromeOS::~VideoCaptureDeviceFactoryChromeOS() {}
17 17
18 bool VideoCaptureDeviceFactoryChromeOS::Init() { 18 bool VideoCaptureDeviceFactoryChromeOS::Init() {
19 if (!module_thread_.Start()) { 19 if (!module_thread_.Start()) {
20 LOG(ERROR) << "Module thread failed to start"; 20 LOG(ERROR) << "Module thread failed to start";
21 return false; 21 return false;
22 } 22 }
23
24 if (!ArcCamera3Service::GetInstance()->is_started() &&
25 !ArcCamera3Service::GetInstance()->Start()) {
26 LOG(ERROR) << "Failed to start ArcCamera3Service";
27 return false;
28 }
29
23 camera_hal_delegate_ = new CameraHalDelegate(module_thread_.task_runner()); 30 camera_hal_delegate_ = new CameraHalDelegate(module_thread_.task_runner());
24 return camera_hal_delegate_->StartCameraModuleIpc(); 31 camera_hal_delegate_->Start();
32 return true;
25 } 33 }
26 34
27 std::unique_ptr<VideoCaptureDevice> 35 std::unique_ptr<VideoCaptureDevice>
28 VideoCaptureDeviceFactoryChromeOS::CreateDevice( 36 VideoCaptureDeviceFactoryChromeOS::CreateDevice(
29 const VideoCaptureDeviceDescriptor& device_descriptor) { 37 const VideoCaptureDeviceDescriptor& device_descriptor) {
30 DCHECK(thread_checker_.CalledOnValidThread()); 38 DCHECK(thread_checker_.CalledOnValidThread());
31 return camera_hal_delegate_->CreateDevice(ui_task_runner_, device_descriptor); 39 return camera_hal_delegate_->CreateDevice(ui_task_runner_, device_descriptor);
32 } 40 }
33 41
34 void VideoCaptureDeviceFactoryChromeOS::GetSupportedFormats( 42 void VideoCaptureDeviceFactoryChromeOS::GetSupportedFormats(
(...skipping 24 matching lines...) Expand all
59 return nullptr; 67 return nullptr;
60 } 68 }
61 return factory.release(); 69 return factory.release();
62 } else { 70 } else {
63 return new VideoCaptureDeviceFactoryLinux(ui_task_runner); 71 return new VideoCaptureDeviceFactoryLinux(ui_task_runner);
64 } 72 }
65 } 73 }
66 #endif 74 #endif
67 75
68 } // namespace media 76 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698