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

Side by Side Diff: media/capture/video/win/video_capture_device_win.h

Issue 2354783002: ImageCapture: Implement takePhoto() for Windows (Closed)
Patch Set: xianglu@ comments Created 4 years, 3 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 // Windows specific implementation of VideoCaptureDevice. DirectShow is used for 5 // Windows specific implementation of VideoCaptureDevice. DirectShow is used for
6 // capturing. DirectShow provide its own threads for capturing. 6 // capturing. DirectShow provide its own threads for capturing.
7 7
8 #ifndef MEDIA_CAPTURE_VIDEO_WIN_VIDEO_CAPTURE_DEVICE_WIN_H_ 8 #ifndef MEDIA_CAPTURE_VIDEO_WIN_VIDEO_CAPTURE_DEVICE_WIN_H_
9 #define MEDIA_CAPTURE_VIDEO_WIN_VIDEO_CAPTURE_DEVICE_WIN_H_ 9 #define MEDIA_CAPTURE_VIDEO_WIN_VIDEO_CAPTURE_DEVICE_WIN_H_
10 10
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 const VideoCaptureDeviceDescriptor& device_descriptor); 68 const VideoCaptureDeviceDescriptor& device_descriptor);
69 ~VideoCaptureDeviceWin() override; 69 ~VideoCaptureDeviceWin() override;
70 // Opens the device driver for this device. 70 // Opens the device driver for this device.
71 bool Init(); 71 bool Init();
72 72
73 // VideoCaptureDevice implementation. 73 // VideoCaptureDevice implementation.
74 void AllocateAndStart( 74 void AllocateAndStart(
75 const VideoCaptureParams& params, 75 const VideoCaptureParams& params,
76 std::unique_ptr<VideoCaptureDevice::Client> client) override; 76 std::unique_ptr<VideoCaptureDevice::Client> client) override;
77 void StopAndDeAllocate() override; 77 void StopAndDeAllocate() override;
78 void TakePhoto(TakePhotoCallback callback) override;
78 79
79 private: 80 private:
80 enum InternalState { 81 enum InternalState {
81 kIdle, // The device driver is opened but camera is not in use. 82 kIdle, // The device driver is opened but camera is not in use.
82 kCapturing, // Video is being captured. 83 kCapturing, // Video is being captured.
83 kError // Error accessing HW functions. 84 kError // Error accessing HW functions.
84 // User needs to recover by destroying the object. 85 // User needs to recover by destroying the object.
85 }; 86 };
86 87
87 // Implements SinkFilterObserver. 88 // Implements SinkFilterObserver.
(...skipping 20 matching lines...) Expand all
108 base::win::ScopedComPtr<IPin> output_capture_pin_; 109 base::win::ScopedComPtr<IPin> output_capture_pin_;
109 110
110 scoped_refptr<SinkFilter> sink_filter_; 111 scoped_refptr<SinkFilter> sink_filter_;
111 112
112 // Map of all capabilities this device support. 113 // Map of all capabilities this device support.
113 CapabilityList capabilities_; 114 CapabilityList capabilities_;
114 VideoCaptureFormat capture_format_; 115 VideoCaptureFormat capture_format_;
115 116
116 base::TimeTicks first_ref_time_; 117 base::TimeTicks first_ref_time_;
117 118
119 std::queue<TakePhotoCallback> take_photo_callbacks_;
120
118 base::ThreadChecker thread_checker_; 121 base::ThreadChecker thread_checker_;
119 122
120 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoCaptureDeviceWin); 123 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoCaptureDeviceWin);
121 }; 124 };
122 125
123 } // namespace media 126 } // namespace media
124 127
125 #endif // MEDIA_CAPTURE_VIDEO_WIN_VIDEO_CAPTURE_DEVICE_WIN_H_ 128 #endif // MEDIA_CAPTURE_VIDEO_WIN_VIDEO_CAPTURE_DEVICE_WIN_H_
OLDNEW
« no previous file with comments | « media/capture/video/video_capture_device_unittest.cc ('k') | media/capture/video/win/video_capture_device_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698