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

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

Issue 2214533002: move //media/capture to //device/capture (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
« no previous file with comments | « device/capture/video/linux/video_capture_device_linux.h ('k') | device/capture/video/mac/DEPS » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "device/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
11 #include "base/bind.h" 11 #include "base/bind.h"
12 #include "build/build_config.h" 12 #include "build/build_config.h"
13 #include "media/capture/video/linux/v4l2_capture_delegate.h" 13 #include "device/capture/video/linux/v4l2_capture_delegate.h"
14 14
15 #if defined(OS_OPENBSD) 15 #if defined(OS_OPENBSD)
16 #include <sys/videoio.h> 16 #include <sys/videoio.h>
17 #else 17 #else
18 #include <linux/videodev2.h> 18 #include <linux/videodev2.h>
19 #endif 19 #endif
20 20
21 namespace media { 21 namespace device {
22 22
23 // Translates Video4Linux pixel formats to Chromium pixel formats. 23 // Translates Video4Linux pixel formats to Chromium pixel formats.
24 // static 24 // static
25 VideoPixelFormat VideoCaptureDeviceLinux::V4l2FourCcToChromiumPixelFormat( 25 VideoPixelFormat VideoCaptureDeviceLinux::V4l2FourCcToChromiumPixelFormat(
26 uint32_t v4l2_fourcc) { 26 uint32_t v4l2_fourcc) {
27 return V4L2CaptureDelegate::V4l2FourCcToChromiumPixelFormat(v4l2_fourcc); 27 return V4L2CaptureDelegate::V4l2FourCcToChromiumPixelFormat(v4l2_fourcc);
28 } 28 }
29 29
30 // Gets a list of usable Four CC formats prioritized. 30 // Gets a list of usable Four CC formats prioritized.
31 // static 31 // static
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 void VideoCaptureDeviceLinux::SetRotation(int rotation) { 84 void VideoCaptureDeviceLinux::SetRotation(int rotation) {
85 if (v4l2_thread_.IsRunning()) { 85 if (v4l2_thread_.IsRunning()) {
86 v4l2_thread_.message_loop()->PostTask( 86 v4l2_thread_.message_loop()->PostTask(
87 FROM_HERE, 87 FROM_HERE,
88 base::Bind(&V4L2CaptureDelegate::SetRotation, capture_impl_, rotation)); 88 base::Bind(&V4L2CaptureDelegate::SetRotation, capture_impl_, rotation));
89 } 89 }
90 } 90 }
91 91
92 // static 92 // static
93 int VideoCaptureDeviceLinux::TranslatePowerLineFrequencyToV4L2( 93 int VideoCaptureDeviceLinux::TranslatePowerLineFrequencyToV4L2(
94 PowerLineFrequency frequency) { 94 media::PowerLineFrequency frequency) {
95 switch (frequency) { 95 switch (frequency) {
96 case media::PowerLineFrequency::FREQUENCY_50HZ: 96 case media::PowerLineFrequency::FREQUENCY_50HZ:
97 return V4L2_CID_POWER_LINE_FREQUENCY_50HZ; 97 return V4L2_CID_POWER_LINE_FREQUENCY_50HZ;
98 case media::PowerLineFrequency::FREQUENCY_60HZ: 98 case media::PowerLineFrequency::FREQUENCY_60HZ:
99 return V4L2_CID_POWER_LINE_FREQUENCY_60HZ; 99 return V4L2_CID_POWER_LINE_FREQUENCY_60HZ;
100 default: 100 default:
101 // If we have no idea of the frequency, at least try and set it to AUTO. 101 // If we have no idea of the frequency, at least try and set it to AUTO.
102 return V4L2_CID_POWER_LINE_FREQUENCY_AUTO; 102 return V4L2_CID_POWER_LINE_FREQUENCY_AUTO;
103 } 103 }
104 } 104 }
105 105
106 } // namespace media 106 } // namespace device
OLDNEW
« no previous file with comments | « device/capture/video/linux/video_capture_device_linux.h ('k') | device/capture/video/mac/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698