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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 // Sets the platform-dependent window ID for the desktop capture notification | 124 // Sets the platform-dependent window ID for the desktop capture notification |
125 // UI for the given session. | 125 // UI for the given session. |
126 void SetDesktopCaptureWindowId(media::VideoCaptureSessionId session_id, | 126 void SetDesktopCaptureWindowId(media::VideoCaptureSessionId session_id, |
127 gfx::NativeViewId window_id); | 127 gfx::NativeViewId window_id); |
128 | 128 |
129 // Gets a weak reference to the device factory, used for tests. | 129 // Gets a weak reference to the device factory, used for tests. |
130 media::VideoCaptureDeviceFactory* video_capture_device_factory() const { | 130 media::VideoCaptureDeviceFactory* video_capture_device_factory() const { |
131 return video_capture_device_factory_.get(); | 131 return video_capture_device_factory_.get(); |
132 } | 132 } |
133 | 133 |
| 134 #if defined(OS_WIN) |
| 135 void set_device_task_runner( |
| 136 const scoped_refptr<base::SingleThreadTaskRunner>& device_task_runner) { |
| 137 device_task_runner_ = device_task_runner; |
| 138 } |
| 139 #endif |
| 140 |
134 private: | 141 private: |
135 ~VideoCaptureManager() override; | 142 ~VideoCaptureManager() override; |
136 struct DeviceEntry; | 143 struct DeviceEntry; |
137 | 144 |
138 // Checks to see if |entry| has no clients left on its controller. If so, | 145 // Checks to see if |entry| has no clients left on its controller. If so, |
139 // remove it from the list of devices, and delete it asynchronously. |entry| | 146 // remove it from the list of devices, and delete it asynchronously. |entry| |
140 // may be freed by this function. | 147 // may be freed by this function. |
141 void DestroyDeviceEntryIfNoClients(DeviceEntry* entry); | 148 void DestroyDeviceEntryIfNoClients(DeviceEntry* entry); |
142 | 149 |
143 // Helpers to report an event to our Listener. | 150 // Helpers to report an event to our Listener. |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 // Accessed on the device thread only. | 263 // Accessed on the device thread only. |
257 std::map<media::VideoCaptureSessionId, gfx::NativeViewId> | 264 std::map<media::VideoCaptureSessionId, gfx::NativeViewId> |
258 notification_window_ids_; | 265 notification_window_ids_; |
259 | 266 |
260 DISALLOW_COPY_AND_ASSIGN(VideoCaptureManager); | 267 DISALLOW_COPY_AND_ASSIGN(VideoCaptureManager); |
261 }; | 268 }; |
262 | 269 |
263 } // namespace content | 270 } // namespace content |
264 | 271 |
265 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_MANAGER_H_ | 272 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_MANAGER_H_ |
OLD | NEW |