Chromium Code Reviews| 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 // Linux specific implementation of VideoCaptureDevice. | 5 // Linux specific implementation of VideoCaptureDevice. |
| 6 // V4L2 is used for capturing. V4L2 does not provide its own thread for | 6 // V4L2 is used for capturing. V4L2 does not provide its own thread for |
| 7 // capturing so this implementation uses a Chromium thread for fetching frames | 7 // capturing so this implementation uses a Chromium thread for fetching frames |
| 8 // from V4L2. | 8 // from V4L2. |
| 9 | 9 |
| 10 #ifndef MEDIA_VIDEO_CAPTURE_LINUX_VIDEO_CAPTURE_DEVICE_LINUX_H_ | 10 #ifndef MEDIA_VIDEO_CAPTURE_LINUX_VIDEO_CAPTURE_DEVICE_LINUX_H_ |
| 11 #define MEDIA_VIDEO_CAPTURE_LINUX_VIDEO_CAPTURE_DEVICE_LINUX_H_ | 11 #define MEDIA_VIDEO_CAPTURE_LINUX_VIDEO_CAPTURE_DEVICE_LINUX_H_ |
| 12 | 12 |
| 13 #include <string> | 13 #include <string> |
| 14 | 14 |
| 15 #include "base/files/file_util.h" | 15 #include "base/files/file_util.h" |
| 16 #include "base/files/scoped_file.h" | 16 #include "base/files/scoped_file.h" |
| 17 #include "base/threading/thread.h" | 17 #include "base/threading/thread.h" |
| 18 #include "media/video/capture/video_capture_device.h" | 18 #include "media/video/capture/video_capture_device.h" |
| 19 #include "media/video/capture/video_capture_types.h" | 19 #include "media/video/capture/video_capture_types.h" |
| 20 | 20 |
| 21 namespace media { | 21 namespace media { |
| 22 | 22 |
| 23 class VideoCaptureDeviceLinux : public VideoCaptureDevice { | 23 class VideoCaptureDeviceLinux : public VideoCaptureDevice { |
| 24 public: | 24 public: |
| 25 static VideoPixelFormat V4l2ColorToVideoCaptureColorFormat(int32 v4l2_fourcc); | 25 static VideoPixelFormat V4l2FourCcToChromiumPixelFormat(uint32 v4l2_fourcc); |
| 26 static void GetListOfUsableFourCCs(bool favour_mjpeg, | 26 static std::list<int> GetListOfUsableFourCCs(bool favour_mjpeg); |
| 27 std::list<int>* fourccs); | 27 static int Ioctl(const base::ScopedFD& device_fd, int request, void* arg); |
|
perkj_chrome
2014/12/16 10:34:43
please remove Ioctl from public interface.
mcasas
2014/12/16 18:08:17
Done.
(FTR, it was there to be called from VCDFac
| |
| 28 | 28 |
| 29 explicit VideoCaptureDeviceLinux(const Name& device_name); | 29 explicit VideoCaptureDeviceLinux(const Name& device_name); |
| 30 ~VideoCaptureDeviceLinux() override; | 30 ~VideoCaptureDeviceLinux() override; |
| 31 | 31 |
| 32 // VideoCaptureDevice implementation. | 32 // VideoCaptureDevice implementation. |
| 33 void AllocateAndStart(const VideoCaptureParams& params, | 33 void AllocateAndStart(const VideoCaptureParams& params, |
| 34 scoped_ptr<Client> client) override; | 34 scoped_ptr<Client> client) override; |
| 35 | 35 |
| 36 void StopAndDeAllocate() override; | 36 void StopAndDeAllocate() override; |
| 37 | 37 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 75 // This is only used on |v4l2_thread_| when it is running, or the constructor | 75 // This is only used on |v4l2_thread_| when it is running, or the constructor |
| 76 // thread otherwise. | 76 // thread otherwise. |
| 77 int rotation_; | 77 int rotation_; |
| 78 | 78 |
| 79 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoCaptureDeviceLinux); | 79 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoCaptureDeviceLinux); |
| 80 }; | 80 }; |
| 81 | 81 |
| 82 } // namespace media | 82 } // namespace media |
| 83 | 83 |
| 84 #endif // MEDIA_VIDEO_CAPTURE_LINUX_VIDEO_CAPTURE_DEVICE_LINUX_H_ | 84 #endif // MEDIA_VIDEO_CAPTURE_LINUX_VIDEO_CAPTURE_DEVICE_LINUX_H_ |
| OLD | NEW |