| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_factory_linux.h" | 5 #include "device/capture/video/linux/video_capture_device_factory_linux.h" |
| 6 | 6 |
| 7 #include <errno.h> | 7 #include <errno.h> |
| 8 #include <fcntl.h> | 8 #include <fcntl.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 #include <sys/ioctl.h> | 10 #include <sys/ioctl.h> |
| 11 | 11 |
| 12 #include "base/files/file_enumerator.h" | 12 #include "base/files/file_enumerator.h" |
| 13 #include "base/files/scoped_file.h" | 13 #include "base/files/scoped_file.h" |
| 14 #include "base/posix/eintr_wrapper.h" | 14 #include "base/posix/eintr_wrapper.h" |
| 15 #include "build/build_config.h" | 15 #include "build/build_config.h" |
| 16 | 16 |
| 17 #if defined(OS_OPENBSD) | 17 #if defined(OS_OPENBSD) |
| 18 #include <sys/videoio.h> | 18 #include <sys/videoio.h> |
| 19 #else | 19 #else |
| 20 #include <linux/videodev2.h> | 20 #include <linux/videodev2.h> |
| 21 #endif | 21 #endif |
| 22 | 22 |
| 23 #if defined(OS_CHROMEOS) | 23 #if defined(OS_CHROMEOS) |
| 24 #include "media/capture/video/linux/video_capture_device_chromeos.h" | 24 #include "device/capture/video/linux/video_capture_device_chromeos.h" |
| 25 #endif | 25 #endif |
| 26 #include "media/capture/video/linux/video_capture_device_linux.h" | 26 #include "device/capture/video/linux/video_capture_device_linux.h" |
| 27 | 27 |
| 28 namespace media { | 28 namespace media { |
| 29 | 29 |
| 30 static bool HasUsableFormats(int fd, uint32_t capabilities) { | 30 static bool HasUsableFormats(int fd, uint32_t capabilities) { |
| 31 if (!(capabilities & V4L2_CAP_VIDEO_CAPTURE)) | 31 if (!(capabilities & V4L2_CAP_VIDEO_CAPTURE)) |
| 32 return false; | 32 return false; |
| 33 | 33 |
| 34 const std::list<uint32_t>& usable_fourccs = | 34 const std::list<uint32_t>& usable_fourccs = |
| 35 VideoCaptureDeviceLinux::GetListOfUsableFourCCs(false); | 35 VideoCaptureDeviceLinux::GetListOfUsableFourCCs(false); |
| 36 v4l2_fmtdesc fmtdesc = {}; | 36 v4l2_fmtdesc fmtdesc = {}; |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 } | 201 } |
| 202 | 202 |
| 203 // static | 203 // static |
| 204 VideoCaptureDeviceFactory* | 204 VideoCaptureDeviceFactory* |
| 205 VideoCaptureDeviceFactory::CreateVideoCaptureDeviceFactory( | 205 VideoCaptureDeviceFactory::CreateVideoCaptureDeviceFactory( |
| 206 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) { | 206 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) { |
| 207 return new VideoCaptureDeviceFactoryLinux(ui_task_runner); | 207 return new VideoCaptureDeviceFactoryLinux(ui_task_runner); |
| 208 } | 208 } |
| 209 | 209 |
| 210 } // namespace media | 210 } // namespace media |
| OLD | NEW |