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

Side by Side Diff: media/capture/video/linux/video_capture_device_linux.cc

Issue 2349693003: Image Capture Linux/CrOs: wire some capabilities set/get (Closed)
Patch Set: rebase Created 4 years, 3 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 (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 "media/capture/video/linux/video_capture_device_linux.h" 5 #include "media/capture/video/linux/video_capture_device_linux.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <list> 9 #include <list>
10 10
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 84
85 void VideoCaptureDeviceLinux::TakePhoto(TakePhotoCallback callback) { 85 void VideoCaptureDeviceLinux::TakePhoto(TakePhotoCallback callback) {
86 DCHECK(capture_impl_); 86 DCHECK(capture_impl_);
87 if (!v4l2_thread_.IsRunning()) 87 if (!v4l2_thread_.IsRunning())
88 return; 88 return;
89 v4l2_thread_.task_runner()->PostTask( 89 v4l2_thread_.task_runner()->PostTask(
90 FROM_HERE, base::Bind(&V4L2CaptureDelegate::TakePhoto, capture_impl_, 90 FROM_HERE, base::Bind(&V4L2CaptureDelegate::TakePhoto, capture_impl_,
91 base::Passed(&callback))); 91 base::Passed(&callback)));
92 } 92 }
93 93
94 void VideoCaptureDeviceLinux::GetPhotoCapabilities(
95 GetPhotoCapabilitiesCallback callback) {
96 if (!v4l2_thread_.IsRunning())
97 return; // Wrong state.
98 v4l2_thread_.task_runner()->PostTask(
99 FROM_HERE, base::Bind(&V4L2CaptureDelegate::GetPhotoCapabilities,
100 capture_impl_, base::Passed(&callback)));
101 }
102
103 void VideoCaptureDeviceLinux::SetPhotoOptions(
104 mojom::PhotoSettingsPtr settings,
105 SetPhotoOptionsCallback callback) {
106 if (!v4l2_thread_.IsRunning())
107 return; // Wrong state.
108 v4l2_thread_.task_runner()->PostTask(
109 FROM_HERE,
110 base::Bind(&V4L2CaptureDelegate::SetPhotoOptions, capture_impl_,
111 base::Passed(&settings), base::Passed(&callback)));
112 }
113
94 void VideoCaptureDeviceLinux::SetRotation(int rotation) { 114 void VideoCaptureDeviceLinux::SetRotation(int rotation) {
95 if (v4l2_thread_.IsRunning()) { 115 if (v4l2_thread_.IsRunning()) {
96 v4l2_thread_.task_runner()->PostTask( 116 v4l2_thread_.task_runner()->PostTask(
97 FROM_HERE, 117 FROM_HERE,
98 base::Bind(&V4L2CaptureDelegate::SetRotation, capture_impl_, rotation)); 118 base::Bind(&V4L2CaptureDelegate::SetRotation, capture_impl_, rotation));
99 } 119 }
100 } 120 }
101 121
102 // static 122 // static
103 int VideoCaptureDeviceLinux::TranslatePowerLineFrequencyToV4L2( 123 int VideoCaptureDeviceLinux::TranslatePowerLineFrequencyToV4L2(
104 PowerLineFrequency frequency) { 124 PowerLineFrequency frequency) {
105 switch (frequency) { 125 switch (frequency) {
106 case media::PowerLineFrequency::FREQUENCY_50HZ: 126 case media::PowerLineFrequency::FREQUENCY_50HZ:
107 return V4L2_CID_POWER_LINE_FREQUENCY_50HZ; 127 return V4L2_CID_POWER_LINE_FREQUENCY_50HZ;
108 case media::PowerLineFrequency::FREQUENCY_60HZ: 128 case media::PowerLineFrequency::FREQUENCY_60HZ:
109 return V4L2_CID_POWER_LINE_FREQUENCY_60HZ; 129 return V4L2_CID_POWER_LINE_FREQUENCY_60HZ;
110 default: 130 default:
111 // If we have no idea of the frequency, at least try and set it to AUTO. 131 // If we have no idea of the frequency, at least try and set it to AUTO.
112 return V4L2_CID_POWER_LINE_FREQUENCY_AUTO; 132 return V4L2_CID_POWER_LINE_FREQUENCY_AUTO;
113 } 133 }
114 } 134 }
115 135
116 } // namespace media 136 } // namespace media
OLDNEW
« no previous file with comments | « media/capture/video/linux/video_capture_device_linux.h ('k') | media/capture/video/video_capture_device_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698