| 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 // capture device. | 115 // capture device. |
| 116 void RequestRefreshFrameForClient(VideoCaptureController* controller); | 116 void RequestRefreshFrameForClient(VideoCaptureController* controller); |
| 117 | 117 |
| 118 // Retrieves all capture supported formats for a particular device. Returns | 118 // Retrieves all capture supported formats for a particular device. Returns |
| 119 // false if the |capture_session_id| is not found. The supported formats are | 119 // false if the |capture_session_id| is not found. The supported formats are |
| 120 // cached during device(s) enumeration, and depending on the underlying | 120 // cached during device(s) enumeration, and depending on the underlying |
| 121 // implementation, could be an empty list. | 121 // implementation, could be an empty list. |
| 122 bool GetDeviceSupportedFormats( | 122 bool GetDeviceSupportedFormats( |
| 123 media::VideoCaptureSessionId capture_session_id, | 123 media::VideoCaptureSessionId capture_session_id, |
| 124 media::VideoCaptureFormats* supported_formats); | 124 media::VideoCaptureFormats* supported_formats); |
| 125 // Retrieves all capture supported formats for a particular device. Returns |
| 126 // false if the |device_id| is not found. The supported formats are cached |
| 127 // during device(s) enumeration, and depending on the underlying |
| 128 // implementation, could be an empty list. |
| 129 bool GetDeviceSupportedFormats(const std::string& device_id, |
| 130 media::VideoCaptureFormats* supported_formats); |
| 125 | 131 |
| 126 // Retrieves the format(s) currently in use. Returns false if the | 132 // Retrieves the format(s) currently in use. Returns false if the |
| 127 // |capture_session_id| is not found. Returns true and |formats_in_use| | 133 // |capture_session_id| is not found. Returns true and |formats_in_use| |
| 128 // otherwise. |formats_in_use| is empty if the device is not in use. | 134 // otherwise. |formats_in_use| is empty if the device is not in use. |
| 129 bool GetDeviceFormatsInUse(media::VideoCaptureSessionId capture_session_id, | 135 bool GetDeviceFormatsInUse(media::VideoCaptureSessionId capture_session_id, |
| 130 media::VideoCaptureFormats* formats_in_use); | 136 media::VideoCaptureFormats* formats_in_use); |
| 137 // Retrieves the format(s) currently in use. Returns false if the |
| 138 // |stream_type|, |device_id| pair is not found. Returns true and |
| 139 // |formats_in_use| otherwise. |formats_in_use| is empty if the device is not |
| 140 // in use. |
| 141 bool GetDeviceFormatsInUse(MediaStreamType stream_type, |
| 142 const std::string& device_id, |
| 143 media::VideoCaptureFormats* supported_formats); |
| 131 | 144 |
| 132 // Sets the platform-dependent window ID for the desktop capture notification | 145 // Sets the platform-dependent window ID for the desktop capture notification |
| 133 // UI for the given session. | 146 // UI for the given session. |
| 134 void SetDesktopCaptureWindowId(media::VideoCaptureSessionId session_id, | 147 void SetDesktopCaptureWindowId(media::VideoCaptureSessionId session_id, |
| 135 gfx::NativeViewId window_id); | 148 gfx::NativeViewId window_id); |
| 136 | 149 |
| 137 // Gets a weak reference to the device factory, used for tests. | 150 // Gets a weak reference to the device factory, used for tests. |
| 138 media::VideoCaptureDeviceFactory* video_capture_device_factory() const { | 151 media::VideoCaptureDeviceFactory* video_capture_device_factory() const { |
| 139 return video_capture_device_factory_.get(); | 152 return video_capture_device_factory_.get(); |
| 140 } | 153 } |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 // Map used by DesktopCapture. | 348 // Map used by DesktopCapture. |
| 336 std::map<media::VideoCaptureSessionId, gfx::NativeViewId> | 349 std::map<media::VideoCaptureSessionId, gfx::NativeViewId> |
| 337 notification_window_ids_; | 350 notification_window_ids_; |
| 338 | 351 |
| 339 DISALLOW_COPY_AND_ASSIGN(VideoCaptureManager); | 352 DISALLOW_COPY_AND_ASSIGN(VideoCaptureManager); |
| 340 }; | 353 }; |
| 341 | 354 |
| 342 } // namespace content | 355 } // namespace content |
| 343 | 356 |
| 344 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_MANAGER_H_ | 357 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_MANAGER_H_ |
| OLD | NEW |