| 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. | 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(); | |
| 127 | 126 |
| 128 // Thread for all calls to VideoCaptureDevice. | 127 // Thread for all calls to VideoCaptureDevice. |
| 129 base::Thread vc_device_thread_; | 128 base::Thread vc_device_thread_; |
| 130 | 129 |
| 131 // Only accessed on Browser::IO thread. | 130 // Only accessed on Browser::IO thread. |
| 132 MediaStreamProviderListener* listener_; | 131 MediaStreamProviderListener* listener_; |
| 133 int new_capture_session_id_; | 132 int new_capture_session_id_; |
| 134 | 133 |
| 135 // Only accessed from vc_device_thread_. | 134 // Only accessed from vc_device_thread_. |
| 136 // VideoCaptureManager owns all VideoCaptureDevices and is responsible for | 135 // VideoCaptureManager owns all VideoCaptureDevices and is responsible for |
| (...skipping 10 matching lines...) Expand all Loading... |
| 147 // VideoCaptureDevice is one-to-one mapped to VideoCaptureController. | 146 // VideoCaptureDevice is one-to-one mapped to VideoCaptureController. |
| 148 typedef std::map<media::VideoCaptureDevice*, Controller*> Controllers; | 147 typedef std::map<media::VideoCaptureDevice*, Controller*> Controllers; |
| 149 Controllers controllers_; | 148 Controllers controllers_; |
| 150 | 149 |
| 151 DISALLOW_COPY_AND_ASSIGN(VideoCaptureManager); | 150 DISALLOW_COPY_AND_ASSIGN(VideoCaptureManager); |
| 152 }; | 151 }; |
| 153 | 152 |
| 154 } // namespace media_stream | 153 } // namespace media_stream |
| 155 | 154 |
| 156 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_MANAGER_H_ | 155 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_MANAGER_H_ |
| OLD | NEW |