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

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

Issue 2873143002: Image Capture: wire setPhotoOptions() for Win (Closed)
Patch Set: Created 3 years, 7 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
11 // Avoid including strsafe.h via dshow as it will cause build warnings. 11 // Avoid including strsafe.h via dshow as it will cause build warnings.
12 #define NO_DSHOW_STRSAFE 12 #define NO_DSHOW_STRSAFE
13 #include <dshow.h> 13 #include <dshow.h>
14 #include <stdint.h> 14 #include <stdint.h>
15 #include <vidcap.h>
15 16
16 #include <map> 17 #include <map>
17 #include <string> 18 #include <string>
18 19
19 #include "base/macros.h" 20 #include "base/macros.h"
20 #include "base/threading/thread_checker.h" 21 #include "base/threading/thread_checker.h"
21 #include "base/win/scoped_comptr.h" 22 #include "base/win/scoped_comptr.h"
22 #include "media/capture/video/video_capture_device.h" 23 #include "media/capture/video/video_capture_device.h"
23 #include "media/capture/video/win/capability_list_win.h" 24 #include "media/capture/video/win/capability_list_win.h"
24 #include "media/capture/video/win/sink_filter_win.h" 25 #include "media/capture/video/win/sink_filter_win.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 // Opens the device driver for this device. 71 // Opens the device driver for this device.
71 bool Init(); 72 bool Init();
72 73
73 // VideoCaptureDevice implementation. 74 // VideoCaptureDevice implementation.
74 void AllocateAndStart( 75 void AllocateAndStart(
75 const VideoCaptureParams& params, 76 const VideoCaptureParams& params,
76 std::unique_ptr<VideoCaptureDevice::Client> client) override; 77 std::unique_ptr<VideoCaptureDevice::Client> client) override;
77 void StopAndDeAllocate() override; 78 void StopAndDeAllocate() override;
78 void TakePhoto(TakePhotoCallback callback) override; 79 void TakePhoto(TakePhotoCallback callback) override;
79 void GetPhotoCapabilities(GetPhotoCapabilitiesCallback callback) override; 80 void GetPhotoCapabilities(GetPhotoCapabilitiesCallback callback) override;
81 void SetPhotoOptions(mojom::PhotoSettingsPtr settings,
82 SetPhotoOptionsCallback callback) override;
80 83
81 private: 84 private:
82 enum InternalState { 85 enum InternalState {
83 kIdle, // The device driver is opened but camera is not in use. 86 kIdle, // The device driver is opened but camera is not in use.
84 kCapturing, // Video is being captured. 87 kCapturing, // Video is being captured.
85 kError // Error accessing HW functions. 88 kError // Error accessing HW functions.
86 // User needs to recover by destroying the object. 89 // User needs to recover by destroying the object.
87 }; 90 };
88 91
89 // Implements SinkFilterObserver. 92 // Implements SinkFilterObserver.
(...skipping 19 matching lines...) Expand all
109 112
110 base::win::ScopedComPtr<IMediaControl> media_control_; 113 base::win::ScopedComPtr<IMediaControl> media_control_;
111 base::win::ScopedComPtr<IPin> input_sink_pin_; 114 base::win::ScopedComPtr<IPin> input_sink_pin_;
112 base::win::ScopedComPtr<IPin> output_capture_pin_; 115 base::win::ScopedComPtr<IPin> output_capture_pin_;
113 116
114 scoped_refptr<SinkFilter> sink_filter_; 117 scoped_refptr<SinkFilter> sink_filter_;
115 118
116 // Map of all capabilities this device support. 119 // Map of all capabilities this device support.
117 CapabilityList capabilities_; 120 CapabilityList capabilities_;
118 121
122 base::win::ScopedComPtr<ICameraControl> camera_control_;
123 base::win::ScopedComPtr<IVideoProcAmp> video_control_;
124 // These flags keep the manual/auto mode between cycles of SetPhotoOptions().
125 bool white_balance_mode_manual_;
126 bool exposure_mode_manual_;
127
119 base::TimeTicks first_ref_time_; 128 base::TimeTicks first_ref_time_;
120 129
121 std::queue<TakePhotoCallback> take_photo_callbacks_; 130 std::queue<TakePhotoCallback> take_photo_callbacks_;
122 131
123 base::ThreadChecker thread_checker_; 132 base::ThreadChecker thread_checker_;
124 133
125 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoCaptureDeviceWin); 134 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoCaptureDeviceWin);
126 }; 135 };
127 136
128 } // namespace media 137 } // namespace media
129 138
130 #endif // MEDIA_CAPTURE_VIDEO_WIN_VIDEO_CAPTURE_DEVICE_WIN_H_ 139 #endif // MEDIA_CAPTURE_VIDEO_WIN_VIDEO_CAPTURE_DEVICE_WIN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698