OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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. | 7 // All functions are expected to be called from Browser::IO thread. |
8 // VideoCaptureManager will open OS dependent instances of VideoCaptureDevice. | 8 // VideoCaptureManager will open OS dependent instances of VideoCaptureDevice. |
9 // A device can only be opened once. | 9 // A device can only be opened once. |
10 | 10 |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 void PostOnError(int capture_session_id, MediaStreamProviderError error); | 116 void PostOnError(int capture_session_id, MediaStreamProviderError error); |
117 | 117 |
118 // Helpers | 118 // Helpers |
119 void GetAvailableDevices(media::VideoCaptureDevice::Names* device_names); | 119 void GetAvailableDevices(media::VideoCaptureDevice::Names* device_names); |
120 bool DeviceOpened(const media::VideoCaptureDevice::Name& device_name); | 120 bool DeviceOpened(const media::VideoCaptureDevice::Name& device_name); |
121 bool DeviceInUse(const media::VideoCaptureDevice* video_capture_device); | 121 bool DeviceInUse(const media::VideoCaptureDevice* video_capture_device); |
122 media::VideoCaptureDevice* GetOpenedDevice( | 122 media::VideoCaptureDevice* GetOpenedDevice( |
123 const StreamDeviceInfo& device_info); | 123 const StreamDeviceInfo& device_info); |
124 bool IsOnCaptureDeviceThread() const; | 124 bool IsOnCaptureDeviceThread() const; |
125 media::VideoCaptureDevice* GetDeviceInternal(int capture_session_id); | 125 media::VideoCaptureDevice* GetDeviceInternal(int capture_session_id); |
| 126 void TerminateOnDeviceThread(); |
126 | 127 |
127 // Thread for all calls to VideoCaptureDevice. | 128 // Thread for all calls to VideoCaptureDevice. |
128 base::Thread vc_device_thread_; | 129 base::Thread vc_device_thread_; |
129 | 130 |
130 // Only accessed on Browser::IO thread. | 131 // Only accessed on Browser::IO thread. |
131 MediaStreamProviderListener* listener_; | 132 MediaStreamProviderListener* listener_; |
132 int new_capture_session_id_; | 133 int new_capture_session_id_; |
133 | 134 |
134 // Only accessed from vc_device_thread_. | 135 // Only accessed from vc_device_thread_. |
135 // VideoCaptureManager owns all VideoCaptureDevices and is responsible for | 136 // VideoCaptureManager owns all VideoCaptureDevices and is responsible for |
(...skipping 12 matching lines...) Expand all Loading... |
148 Controllers controllers_; | 149 Controllers controllers_; |
149 | 150 |
150 DISALLOW_COPY_AND_ASSIGN(VideoCaptureManager); | 151 DISALLOW_COPY_AND_ASSIGN(VideoCaptureManager); |
151 }; | 152 }; |
152 | 153 |
153 } // namespace media_stream | 154 } // namespace media_stream |
154 | 155 |
155 DISABLE_RUNNABLE_METHOD_REFCOUNT(media_stream::VideoCaptureManager); | 156 DISABLE_RUNNABLE_METHOD_REFCOUNT(media_stream::VideoCaptureManager); |
156 | 157 |
157 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_MANAGER_H_ | 158 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_MANAGER_H_ |
OLD | NEW |