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 30 matching lines...) Expand all Loading... | |
41 | 41 |
42 protected: | 42 protected: |
43 void SetRotation(int rotation); | 43 void SetRotation(int rotation); |
44 | 44 |
45 private: | 45 private: |
46 static int TranslatePowerLineFrequencyToV4L2(PowerLineFrequency frequency); | 46 static int TranslatePowerLineFrequencyToV4L2(PowerLineFrequency frequency); |
47 | 47 |
48 // Internal delegate doing the actual capture setting, buffer allocation and | 48 // Internal delegate doing the actual capture setting, buffer allocation and |
49 // circulation with the V4L2 API. Created and deleted in the thread where | 49 // circulation with the V4L2 API. Created and deleted in the thread where |
50 // VideoCaptureDeviceLinux lives but otherwise operating on |v4l2_thread_|. | 50 // VideoCaptureDeviceLinux lives but otherwise operating on |v4l2_thread_|. |
51 scoped_refptr<V4L2CaptureDelegate> capture_impl_; | 51 // Weak. |
52 V4L2CaptureDelegate* capture_impl_; | |
perkj_chrome
2016/02/12 11:01:40
this looks like a memory leak. Should be scoped_pt
mcasas
2016/02/12 21:32:43
Acknowledged.
| |
52 | 53 |
53 base::Thread v4l2_thread_; // Thread used for reading data from the device. | 54 base::Thread v4l2_thread_; // Thread used for reading data from the device. |
54 | 55 |
55 const Name device_name_; | 56 const Name device_name_; |
56 | 57 |
57 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoCaptureDeviceLinux); | 58 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoCaptureDeviceLinux); |
58 }; | 59 }; |
59 | 60 |
60 } // namespace media | 61 } // namespace media |
61 | 62 |
62 #endif // MEDIA_VIDEO_CAPTURE_LINUX_VIDEO_CAPTURE_DEVICE_LINUX_H_ | 63 #endif // MEDIA_VIDEO_CAPTURE_LINUX_VIDEO_CAPTURE_DEVICE_LINUX_H_ |
OLD | NEW |