| 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_ |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 public: | 24 public: |
| 25 static VideoPixelFormat V4l2ColorToVideoCaptureColorFormat(int32 v4l2_fourcc); | 25 static VideoPixelFormat V4l2ColorToVideoCaptureColorFormat(int32 v4l2_fourcc); |
| 26 static void GetListOfUsableFourCCs(bool favour_mjpeg, | 26 static void GetListOfUsableFourCCs(bool favour_mjpeg, |
| 27 std::list<int>* fourccs); | 27 std::list<int>* fourccs); |
| 28 | 28 |
| 29 explicit VideoCaptureDeviceLinux(const Name& device_name); | 29 explicit VideoCaptureDeviceLinux(const Name& device_name); |
| 30 virtual ~VideoCaptureDeviceLinux(); | 30 virtual ~VideoCaptureDeviceLinux(); |
| 31 | 31 |
| 32 // VideoCaptureDevice implementation. | 32 // VideoCaptureDevice implementation. |
| 33 virtual void AllocateAndStart(const VideoCaptureParams& params, | 33 virtual void AllocateAndStart(const VideoCaptureParams& params, |
| 34 scoped_ptr<Client> client) OVERRIDE; | 34 scoped_ptr<Client> client) override; |
| 35 | 35 |
| 36 virtual void StopAndDeAllocate() OVERRIDE; | 36 virtual void StopAndDeAllocate() override; |
| 37 | 37 |
| 38 protected: | 38 protected: |
| 39 void SetRotation(int rotation); | 39 void SetRotation(int rotation); |
| 40 | 40 |
| 41 // Once |v4l2_thread_| is started, only called on that thread. | 41 // Once |v4l2_thread_| is started, only called on that thread. |
| 42 void SetRotationOnV4L2Thread(int rotation); | 42 void SetRotationOnV4L2Thread(int rotation); |
| 43 | 43 |
| 44 private: | 44 private: |
| 45 enum InternalState { | 45 enum InternalState { |
| 46 kIdle, // The device driver is opened but camera is not in use. | 46 kIdle, // The device driver is opened but camera is not in use. |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 // This is only used on |v4l2_thread_| when it is running, or the constructor | 82 // This is only used on |v4l2_thread_| when it is running, or the constructor |
| 83 // thread otherwise. | 83 // thread otherwise. |
| 84 int rotation_; | 84 int rotation_; |
| 85 | 85 |
| 86 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoCaptureDeviceLinux); | 86 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoCaptureDeviceLinux); |
| 87 }; | 87 }; |
| 88 | 88 |
| 89 } // namespace media | 89 } // namespace media |
| 90 | 90 |
| 91 #endif // MEDIA_VIDEO_CAPTURE_LINUX_VIDEO_CAPTURE_DEVICE_LINUX_H_ | 91 #endif // MEDIA_VIDEO_CAPTURE_LINUX_VIDEO_CAPTURE_DEVICE_LINUX_H_ |
| OLD | NEW |