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

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

Issue 615043006: Release the camera when WebRTC is not visible in Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 77
78 // Called by VideoCaptureHost to remove |client_handler|. If this is the last 78 // Called by VideoCaptureHost to remove |client_handler|. If this is the last
79 // client of the device, the |controller| and its VideoCaptureDevice may be 79 // client of the device, the |controller| and its VideoCaptureDevice may be
80 // destroyed. The client must not access |controller| after calling this 80 // destroyed. The client must not access |controller| after calling this
81 // function. 81 // function.
82 void StopCaptureForClient(VideoCaptureController* controller, 82 void StopCaptureForClient(VideoCaptureController* controller,
83 VideoCaptureControllerID client_id, 83 VideoCaptureControllerID client_id,
84 VideoCaptureControllerEventHandler* client_handler, 84 VideoCaptureControllerEventHandler* client_handler,
85 bool aborted_due_to_error); 85 bool aborted_due_to_error);
86 86
87 // Called by VideoCaptureHost to pause to update video buffer specifyed by
88 // |client_id| and |client_handler|. If all clients of |controller| are
89 // paused, the corresponding device will be closed.
90 void PauseCaptureForClient(
91 VideoCaptureController* controller,
92 VideoCaptureControllerID client_id,
93 VideoCaptureControllerEventHandler* client_handler);
94
95 // Called by VideoCaptureHost to resume to update video buffer specifyed by
96 // |client_id| and |client_handler|. If this is first active client of
97 // |controller|, device will be allocated. The |session_id| and |params|
98 // should be same as those used in StartCaptureForClient().
99 void ResumeCaptureForClient(
100 media::VideoCaptureSessionId session_id,
101 const media::VideoCaptureParams& params,
102 VideoCaptureController* controller,
103 VideoCaptureControllerID client_id,
104 VideoCaptureControllerEventHandler* client_handler);
105
87 // Retrieves all capture supported formats for a particular device. Returns 106 // Retrieves all capture supported formats for a particular device. Returns
88 // false if the |capture_session_id| is not found. The supported formats are 107 // false if the |capture_session_id| is not found. The supported formats are
89 // cached during device(s) enumeration, and depending on the underlying 108 // cached during device(s) enumeration, and depending on the underlying
90 // implementation, could be an empty list. 109 // implementation, could be an empty list.
91 bool GetDeviceSupportedFormats( 110 bool GetDeviceSupportedFormats(
92 media::VideoCaptureSessionId capture_session_id, 111 media::VideoCaptureSessionId capture_session_id,
93 media::VideoCaptureFormats* supported_formats); 112 media::VideoCaptureFormats* supported_formats);
94 113
95 // Retrieves the format(s) currently in use. Returns false if the 114 // Retrieves the format(s) currently in use. Returns false if the
96 // |capture_session_id| is not found. Returns true and |formats_in_use| 115 // |capture_session_id| is not found. Returns true and |formats_in_use|
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 // Accessed on the device thread only. 262 // Accessed on the device thread only.
244 std::map<media::VideoCaptureSessionId, gfx::NativeViewId> 263 std::map<media::VideoCaptureSessionId, gfx::NativeViewId>
245 notification_window_ids_; 264 notification_window_ids_;
246 265
247 DISALLOW_COPY_AND_ASSIGN(VideoCaptureManager); 266 DISALLOW_COPY_AND_ASSIGN(VideoCaptureManager);
248 }; 267 };
249 268
250 } // namespace content 269 } // namespace content
251 270
252 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_MANAGER_H_ 271 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698