| OLD | NEW |
| 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 25 matching lines...) Expand all Loading... |
| 36 const bool success = fread(id_buf, kVidPidSize, 1, file) == 1; | 36 const bool success = fread(id_buf, kVidPidSize, 1, file) == 1; |
| 37 fclose(file); | 37 fclose(file); |
| 38 if (!success) | 38 if (!success) |
| 39 return false; | 39 return false; |
| 40 id->append(id_buf, kVidPidSize); | 40 id->append(id_buf, kVidPidSize); |
| 41 return true; | 41 return true; |
| 42 } | 42 } |
| 43 | 43 |
| 44 // Translates Video4Linux pixel formats to Chromium pixel formats. | 44 // Translates Video4Linux pixel formats to Chromium pixel formats. |
| 45 // static | 45 // static |
| 46 VideoPixelFormat | 46 VideoPixelFormat VideoCaptureDeviceLinux::V4l2FourCcToChromiumPixelFormat( |
| 47 VideoCaptureDeviceLinux::V4l2FourCcToChromiumPixelFormat(uint32 v4l2_fourcc) { | 47 uint32_t v4l2_fourcc) { |
| 48 return V4L2CaptureDelegate::V4l2FourCcToChromiumPixelFormat(v4l2_fourcc); | 48 return V4L2CaptureDelegate::V4l2FourCcToChromiumPixelFormat(v4l2_fourcc); |
| 49 } | 49 } |
| 50 | 50 |
| 51 // Gets a list of usable Four CC formats prioritized. | 51 // Gets a list of usable Four CC formats prioritized. |
| 52 // static | 52 // static |
| 53 std::list<uint32_t> VideoCaptureDeviceLinux::GetListOfUsableFourCCs( | 53 std::list<uint32_t> VideoCaptureDeviceLinux::GetListOfUsableFourCCs( |
| 54 bool favour_mjpeg) { | 54 bool favour_mjpeg) { |
| 55 return V4L2CaptureDelegate::GetListOfUsableFourCcs(favour_mjpeg); | 55 return V4L2CaptureDelegate::GetListOfUsableFourCcs(favour_mjpeg); |
| 56 } | 56 } |
| 57 | 57 |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 return V4L2_CID_POWER_LINE_FREQUENCY_50HZ; | 139 return V4L2_CID_POWER_LINE_FREQUENCY_50HZ; |
| 140 case media::PowerLineFrequency::FREQUENCY_60HZ: | 140 case media::PowerLineFrequency::FREQUENCY_60HZ: |
| 141 return V4L2_CID_POWER_LINE_FREQUENCY_60HZ; | 141 return V4L2_CID_POWER_LINE_FREQUENCY_60HZ; |
| 142 default: | 142 default: |
| 143 // 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. |
| 144 return V4L2_CID_POWER_LINE_FREQUENCY_AUTO; | 144 return V4L2_CID_POWER_LINE_FREQUENCY_AUTO; |
| 145 } | 145 } |
| 146 } | 146 } |
| 147 | 147 |
| 148 } // namespace media | 148 } // namespace media |
| OLD | NEW |