Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(276)

Side by Side Diff: media/capture/video/linux/video_capture_device_linux.h

Issue 2815643002: Make V4L2CaptureDelegate non-ref-counted (Closed)
Patch Set: mcasas@ comment Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 46
47 protected: 47 protected:
48 virtual void SetRotation(int rotation); 48 virtual void SetRotation(int rotation);
49 49
50 const VideoCaptureDeviceDescriptor device_descriptor_; 50 const VideoCaptureDeviceDescriptor device_descriptor_;
51 51
52 private: 52 private:
53 static int TranslatePowerLineFrequencyToV4L2(PowerLineFrequency frequency); 53 static int TranslatePowerLineFrequencyToV4L2(PowerLineFrequency frequency);
54 54
55 // Internal delegate doing the actual capture setting, buffer allocation and 55 // Internal delegate doing the actual capture setting, buffer allocation and
56 // circulation with the V4L2 API. Created and deleted in the thread where 56 // circulation with the V4L2 API. Created in the thread where
57 // VideoCaptureDeviceLinux lives but otherwise operating on |v4l2_thread_|. 57 // VideoCaptureDeviceLinux lives but otherwise operating and deleted on
58 scoped_refptr<V4L2CaptureDelegate> capture_impl_; 58 // |v4l2_thread_|.
59 std::unique_ptr<V4L2CaptureDelegate> capture_impl_;
59 60
60 // Photo-related requests waiting for |v4l2_thread_| to be active. 61 // Photo-related requests waiting for |v4l2_thread_| to be active.
61 std::list<base::Closure> photo_requests_queue_; 62 std::list<base::Closure> photo_requests_queue_;
62 63
63 base::Thread v4l2_thread_; // Thread used for reading data from the device. 64 base::Thread v4l2_thread_; // Thread used for reading data from the device.
64 65
65 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoCaptureDeviceLinux); 66 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoCaptureDeviceLinux);
66 }; 67 };
67 68
68 } // namespace media 69 } // namespace media
69 70
70 #endif // MEDIA_CAPTURE_VIDEO_LINUX_VIDEO_CAPTURE_DEVICE_LINUX_H_ 71 #endif // MEDIA_CAPTURE_VIDEO_LINUX_VIDEO_CAPTURE_DEVICE_LINUX_H_
OLDNEW
« no previous file with comments | « media/capture/video/linux/v4l2_capture_delegate_unittest.cc ('k') | media/capture/video/linux/video_capture_device_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698