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

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

Issue 1323093006: Change the media::PowerLineFrequency from an enum class to a proper class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Pass around PowerLineFrequency objects in VideoCaptureDevice instead of integers Created 5 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 #if defined(OS_OPENBSD) 7 #if defined(OS_OPENBSD)
8 #include <sys/videoio.h> 8 #include <sys/videoio.h>
9 #else 9 #else
10 #include <linux/videodev2.h> 10 #include <linux/videodev2.h>
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 125
126 void VideoCaptureDeviceLinux::SetRotation(int rotation) { 126 void VideoCaptureDeviceLinux::SetRotation(int rotation) {
127 if (v4l2_thread_.IsRunning()) { 127 if (v4l2_thread_.IsRunning()) {
128 v4l2_thread_.message_loop()->PostTask( 128 v4l2_thread_.message_loop()->PostTask(
129 FROM_HERE, 129 FROM_HERE,
130 base::Bind(&V4L2CaptureDelegate::SetRotation, capture_impl_, rotation)); 130 base::Bind(&V4L2CaptureDelegate::SetRotation, capture_impl_, rotation));
131 } 131 }
132 } 132 }
133 133
134 // static 134 // static
135 int VideoCaptureDeviceLinux::TranslatePowerLineFrequencyToV4L2(int frequency) { 135 int VideoCaptureDeviceLinux::TranslatePowerLineFrequencyToV4L2(
136 switch (frequency) { 136 media::PowerLineFrequency frequency) {
137 case static_cast<int>(media::PowerLineFrequency::FREQUENCY_50HZ): 137 switch (frequency.get()) {
138 case media::PowerLineFrequency::FREQUENCY_50HZ:
138 return V4L2_CID_POWER_LINE_FREQUENCY_50HZ; 139 return V4L2_CID_POWER_LINE_FREQUENCY_50HZ;
139 case static_cast<int>(media::PowerLineFrequency::FREQUENCY_60HZ): 140 case media::PowerLineFrequency::FREQUENCY_60HZ:
140 return V4L2_CID_POWER_LINE_FREQUENCY_60HZ; 141 return V4L2_CID_POWER_LINE_FREQUENCY_60HZ;
141 default: 142 default:
142 // If we have no idea of the frequency, at least try and set it to AUTO. 143 // If we have no idea of the frequency, at least try and set it to AUTO.
143 return V4L2_CID_POWER_LINE_FREQUENCY_AUTO; 144 return V4L2_CID_POWER_LINE_FREQUENCY_AUTO;
144 } 145 }
145 } 146 }
146 147
147 } // namespace media 148 } // namespace media
OLDNEW
« no previous file with comments | « media/capture/video/linux/video_capture_device_linux.h ('k') | media/capture/video/mac/video_capture_device_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698