Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(143)

Side by Side Diff: content/browser/renderer_host/media/video_capture_manager.h

Issue 2810723002: Refactor VideoCaptureManager::GetDeviceFormatsInUse() (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 // during device(s) enumeration, and depending on the underlying 142 // during device(s) enumeration, and depending on the underlying
143 // implementation, could be an empty list. 143 // implementation, could be an empty list.
144 bool GetDeviceSupportedFormats(const std::string& device_id, 144 bool GetDeviceSupportedFormats(const std::string& device_id,
145 media::VideoCaptureFormats* supported_formats); 145 media::VideoCaptureFormats* supported_formats);
146 146
147 // Retrieves the format(s) currently in use. Returns false if the 147 // Retrieves the format(s) currently in use. Returns false if the
148 // |capture_session_id| is not found. Returns true and |formats_in_use| 148 // |capture_session_id| is not found. Returns true and |formats_in_use|
149 // otherwise. |formats_in_use| is empty if the device is not in use. 149 // otherwise. |formats_in_use| is empty if the device is not in use.
150 bool GetDeviceFormatsInUse(media::VideoCaptureSessionId capture_session_id, 150 bool GetDeviceFormatsInUse(media::VideoCaptureSessionId capture_session_id,
151 media::VideoCaptureFormats* formats_in_use); 151 media::VideoCaptureFormats* formats_in_use);
152 // Retrieves the format(s) currently in use. Returns false if the 152 // Retrieves the format currently in use. Returns base::nullopt if the
153 // |stream_type|, |device_id| pair is not found. Returns true and 153 // |stream_type|, |device_id| pair is not found. Returns in-use format of the
154 // |formats_in_use| otherwise. |formats_in_use| is empty if the device is not 154 // device otherwise.
155 // in use. 155 base::Optional<media::VideoCaptureFormat> GetDeviceFormat(
chfremer 2017/04/10 17:24:03 Why did you decide to drop the ...InUse suffix fro
Chandan 2017/04/11 07:45:07 Done.
156 bool GetDeviceFormatsInUse(MediaStreamType stream_type, 156 MediaStreamType stream_type,
157 const std::string& device_id, 157 const std::string& device_id);
158 media::VideoCaptureFormats* supported_formats);
159 158
160 // Sets the platform-dependent window ID for the desktop capture notification 159 // Sets the platform-dependent window ID for the desktop capture notification
161 // UI for the given session. 160 // UI for the given session.
162 void SetDesktopCaptureWindowId(media::VideoCaptureSessionId session_id, 161 void SetDesktopCaptureWindowId(media::VideoCaptureSessionId session_id,
163 gfx::NativeViewId window_id); 162 gfx::NativeViewId window_id);
164 163
165 void GetPhotoCapabilities( 164 void GetPhotoCapabilities(
166 int session_id, 165 int session_id,
167 VideoCaptureDevice::GetPhotoCapabilitiesCallback callback); 166 VideoCaptureDevice::GetPhotoCapabilitiesCallback callback);
168 void SetPhotoOptions(int session_id, 167 void SetPhotoOptions(int session_id,
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 // Map used by DesktopCapture. 305 // Map used by DesktopCapture.
307 std::map<media::VideoCaptureSessionId, gfx::NativeViewId> 306 std::map<media::VideoCaptureSessionId, gfx::NativeViewId>
308 notification_window_ids_; 307 notification_window_ids_;
309 308
310 DISALLOW_COPY_AND_ASSIGN(VideoCaptureManager); 309 DISALLOW_COPY_AND_ASSIGN(VideoCaptureManager);
311 }; 310 };
312 311
313 } // namespace content 312 } // namespace content
314 313
315 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_MANAGER_H_ 314 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698