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 // VideoCaptureManager is used to open/close, start/stop, enumerate available | 5 // VideoCaptureManager is used to open/close, start/stop, enumerate available |
6 // video capture devices, and manage VideoCaptureController's. | 6 // video capture devices, and manage VideoCaptureController's. |
7 // All functions are expected to be called from Browser::IO thread. Some helper | 7 // All functions are expected to be called from Browser::IO thread. Some helper |
8 // functions (*OnDeviceThread) will dispatch operations to the device thread. | 8 // functions (*OnDeviceThread) will dispatch operations to the device thread. |
9 // VideoCaptureManager will open OS dependent instances of VideoCaptureDevice. | 9 // VideoCaptureManager will open OS dependent instances of VideoCaptureDevice. |
10 // A device can only be opened once. | 10 // A device can only be opened once. |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 // Some devices had troubles when stopped and restarted quickly, so the device | 165 // Some devices had troubles when stopped and restarted quickly, so the device |
166 // is only stopped when Chrome is sent to background and not when, e.g., a tab | 166 // is only stopped when Chrome is sent to background and not when, e.g., a tab |
167 // is hidden, see http://crbug.com/582295. | 167 // is hidden, see http://crbug.com/582295. |
168 void OnApplicationStateChange(base::android::ApplicationState state); | 168 void OnApplicationStateChange(base::android::ApplicationState state); |
169 #endif | 169 #endif |
170 | 170 |
171 using EnumerationCallback = | 171 using EnumerationCallback = |
172 base::Callback<void(const media::VideoCaptureDeviceDescriptors&)>; | 172 base::Callback<void(const media::VideoCaptureDeviceDescriptors&)>; |
173 void EnumerateDevices(const EnumerationCallback& client_callback); | 173 void EnumerateDevices(const EnumerationCallback& client_callback); |
174 | 174 |
| 175 // Retrieves camera calibration information for a particular device. Returns |
| 176 // nullopt_t if the |device_id| is not found or camera calibration information |
| 177 // is not available for the device. Camera calibration is cached during |
| 178 // device(s) enumeration. |
| 179 base::Optional<CameraCalibration> GetCameraCalibration( |
| 180 const std::string& device_id); |
| 181 |
175 private: | 182 private: |
176 class CaptureDeviceStartRequest; | 183 class CaptureDeviceStartRequest; |
177 struct DeviceEntry; | 184 struct DeviceEntry; |
178 struct DeviceInfo; | 185 struct DeviceInfo; |
179 | 186 |
180 using SessionMap = std::map<media::VideoCaptureSessionId, MediaStreamDevice>; | 187 using SessionMap = std::map<media::VideoCaptureSessionId, MediaStreamDevice>; |
181 using DeviceEntries = std::vector<std::unique_ptr<DeviceEntry>>; | 188 using DeviceEntries = std::vector<std::unique_ptr<DeviceEntry>>; |
182 using DeviceInfos = std::vector<DeviceInfo>; | 189 using DeviceInfos = std::vector<DeviceInfo>; |
183 using DeviceStartQueue = std::list<CaptureDeviceStartRequest>; | 190 using DeviceStartQueue = std::list<CaptureDeviceStartRequest>; |
184 using VideoCaptureDeviceDescriptor = media::VideoCaptureDeviceDescriptor; | 191 using VideoCaptureDeviceDescriptor = media::VideoCaptureDeviceDescriptor; |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 // Map used by DesktopCapture. | 342 // Map used by DesktopCapture. |
336 std::map<media::VideoCaptureSessionId, gfx::NativeViewId> | 343 std::map<media::VideoCaptureSessionId, gfx::NativeViewId> |
337 notification_window_ids_; | 344 notification_window_ids_; |
338 | 345 |
339 DISALLOW_COPY_AND_ASSIGN(VideoCaptureManager); | 346 DISALLOW_COPY_AND_ASSIGN(VideoCaptureManager); |
340 }; | 347 }; |
341 | 348 |
342 } // namespace content | 349 } // namespace content |
343 | 350 |
344 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_MANAGER_H_ | 351 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_MANAGER_H_ |
OLD | NEW |