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_CAPTURE_VIDEO_LINUX_VIDEO_CAPTURE_DEVICE_LINUX_H_ | 10 #ifndef MEDIA_CAPTURE_VIDEO_LINUX_VIDEO_CAPTURE_DEVICE_LINUX_H_ |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 43 void GetPhotoCapabilities(GetPhotoCapabilitiesCallback callback) override; | 43 void GetPhotoCapabilities(GetPhotoCapabilitiesCallback callback) override; |
| 44 void SetPhotoOptions(mojom::PhotoSettingsPtr settings, | 44 void SetPhotoOptions(mojom::PhotoSettingsPtr settings, |
| 45 SetPhotoOptionsCallback callback) override; | 45 SetPhotoOptionsCallback callback) override; |
| 46 | 46 |
| 47 protected: | 47 protected: |
| 48 void SetRotation(int rotation); | 48 void SetRotation(int rotation); |
| 49 | 49 |
| 50 private: | 50 private: |
| 51 static int TranslatePowerLineFrequencyToV4L2(PowerLineFrequency frequency); | 51 static int TranslatePowerLineFrequencyToV4L2(PowerLineFrequency frequency); |
| 52 | 52 |
| 53 // Return true if the camera is back-facing. | |
| 54 bool GetCameraFacing(const VideoCaptureDeviceDescriptor& device_descriptor); | |
|
wuchengli
2016/11/17 09:26:04
s/GetCameraFacing/IsCameraBackFacing/
shenghao
2016/11/17 10:15:55
deleted
| |
| 55 | |
| 53 // Internal delegate doing the actual capture setting, buffer allocation and | 56 // Internal delegate doing the actual capture setting, buffer allocation and |
| 54 // circulation with the V4L2 API. Created and deleted in the thread where | 57 // circulation with the V4L2 API. Created and deleted in the thread where |
| 55 // VideoCaptureDeviceLinux lives but otherwise operating on |v4l2_thread_|. | 58 // VideoCaptureDeviceLinux lives but otherwise operating on |v4l2_thread_|. |
| 56 scoped_refptr<V4L2CaptureDelegate> capture_impl_; | 59 scoped_refptr<V4L2CaptureDelegate> capture_impl_; |
| 57 | 60 |
| 58 base::Thread v4l2_thread_; // Thread used for reading data from the device. | 61 base::Thread v4l2_thread_; // Thread used for reading data from the device. |
| 59 | 62 |
| 60 const VideoCaptureDeviceDescriptor device_descriptor_; | 63 const VideoCaptureDeviceDescriptor device_descriptor_; |
| 61 | 64 |
| 65 bool is_back_camera_; | |
| 66 | |
| 62 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoCaptureDeviceLinux); | 67 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoCaptureDeviceLinux); |
| 63 }; | 68 }; |
| 64 | 69 |
| 65 } // namespace media | 70 } // namespace media |
| 66 | 71 |
| 67 #endif // MEDIA_CAPTURE_VIDEO_LINUX_VIDEO_CAPTURE_DEVICE_LINUX_H_ | 72 #endif // MEDIA_CAPTURE_VIDEO_LINUX_VIDEO_CAPTURE_DEVICE_LINUX_H_ |
| OLD | NEW |