Chromium Code Reviews| Index: content/browser/renderer_host/media/video_capture_manager.h |
| diff --git a/content/browser/renderer_host/media/video_capture_manager.h b/content/browser/renderer_host/media/video_capture_manager.h |
| index 935f1f4c70426976be61eaa36baccb402bf3ac06..c8072041cffa5649b4323cdc93cdb680c6ae359c 100644 |
| --- a/content/browser/renderer_host/media/video_capture_manager.h |
| +++ b/content/browser/renderer_host/media/video_capture_manager.h |
| @@ -87,20 +87,20 @@ class CONTENT_EXPORT VideoCaptureManager : public MediaStreamProvider, |
| // that the client was successfully added. A NULL controller is passed to |
| // the callback on failure. |done_cb| is not allowed to synchronously call |
| // StopCaptureForClient(). |
| - void StartCaptureForClient(media::VideoCaptureSessionId session_id, |
| - const media::VideoCaptureParams& capture_params, |
| - VideoCaptureControllerID client_id, |
| - VideoCaptureControllerEventHandler* client_handler, |
| - const DoneCB& done_cb); |
| + void ConnectClient(media::VideoCaptureSessionId session_id, |
| + const media::VideoCaptureParams& capture_params, |
| + VideoCaptureControllerID client_id, |
| + VideoCaptureControllerEventHandler* client_handler, |
| + const DoneCB& done_cb); |
| // Called by VideoCaptureHost to remove |client_handler|. If this is the last |
| // client of the device, the |controller| and its VideoCaptureDevice may be |
| // destroyed. The client must not access |controller| after calling this |
| // function. |
| - void StopCaptureForClient(VideoCaptureController* controller, |
| - VideoCaptureControllerID client_id, |
| - VideoCaptureControllerEventHandler* client_handler, |
| - bool aborted_due_to_error); |
| + void DisconnectClient(VideoCaptureController* controller, |
| + VideoCaptureControllerID client_id, |
| + VideoCaptureControllerEventHandler* client_handler, |
| + bool aborted_due_to_error); |
| // Called by VideoCaptureHost to pause to update video buffer specified by |
| // |client_id| and |client_handler|. If all clients of |controller| are |
| @@ -112,7 +112,7 @@ class CONTENT_EXPORT VideoCaptureManager : public MediaStreamProvider, |
| // Called by VideoCaptureHost to resume to update video buffer specified by |
| // |client_id| and |client_handler|. The |session_id| and |params| should be |
| - // same as those used in StartCaptureForClient(). |
| + // same as those used in ConnectClient(). |
| // If this is first active client of |controller|, device will be allocated |
| // and it will take a little time to resume. |
| // Allocating device could failed if other app holds the camera, the error |
| @@ -204,6 +204,7 @@ class CONTENT_EXPORT VideoCaptureManager : public MediaStreamProvider, |
| void WillStartDevice(media::VideoFacingMode facing_mode) override; |
| void DidStartDevice(VideoCaptureController* controller) override; |
| void OnDeviceStartFailed(VideoCaptureController* controller) override; |
| + void OnDeviceStartAborted() override; |
| // Retrieves camera calibration information for a particular device. Returns |
| // nullopt_t if the |device_id| is not found or camera calibration information |
| @@ -250,13 +251,12 @@ class CONTENT_EXPORT VideoCaptureManager : public MediaStreamProvider, |
| // |device_id| and |type| (if it is already opened), by its |controller| or by |
| // its |serial_id|. In all cases, if not found, nullptr is returned. |
| VideoCaptureController* LookupControllerBySessionId(int session_id); |
| - VideoCaptureController* LookupControllerByTypeAndId( |
| + VideoCaptureController* LookupControllerByMediaTypeAndDeviceId( |
| MediaStreamType type, |
| const std::string& device_id) const; |
| bool IsControllerPointerValid(const VideoCaptureController* controller) const; |
| - VideoCaptureController* LookupControllerBySerialId(int serial_id) const; |
| - scoped_refptr<VideoCaptureController> GetControllerSharedRefFromSerialId( |
| - int serial_id) const; |
| + scoped_refptr<VideoCaptureController> GetControllerSharedRef( |
| + VideoCaptureController* controller) const; |
| // Finds the device info by |id| in |devices_info_cache_|, or nullptr. |
| DeviceInfo* GetDeviceInfoById(const std::string& id); |
| @@ -270,15 +270,16 @@ class CONTENT_EXPORT VideoCaptureManager : public MediaStreamProvider, |
| // Starting a capture device can take 1-2 seconds. |
| // To avoid multiple unnecessary start/stop commands to the OS, each start |
| - // request is queued in |device_start_queue_|. |
| - // QueueStartDevice creates a new entry in |device_start_queue_| and posts a |
| + // request is queued in |device_start_request_queue_|. |
| + // QueueStartDevice creates a new entry in |device_start_request_queue_| and |
| + // posts a |
| // request to start the device on the device thread unless there is |
| // another request pending start. |
| void QueueStartDevice(media::VideoCaptureSessionId session_id, |
| VideoCaptureController* controller, |
| const media::VideoCaptureParams& params); |
| void DoStopDevice(VideoCaptureController* controller); |
| - void HandleQueuedStartRequest(); |
| + void ProcessDeviceStartRequestQueue(); |
| void MaybePostDesktopCaptureWindowId(media::VideoCaptureSessionId session_id); |
| @@ -300,7 +301,7 @@ class CONTENT_EXPORT VideoCaptureManager : public MediaStreamProvider, |
| // An entry is kept in this map for every session that has been created via |
| // the Open() entry point. The keys are session_id's. This map is used to |
| - // determine which device to use when StartCaptureForClient() occurs. Used |
| + // determine which device to use when ConnectClient() occurs. Used |
| // only on the IO thread. |
| SessionMap sessions_; |
| @@ -308,7 +309,7 @@ class CONTENT_EXPORT VideoCaptureManager : public MediaStreamProvider, |
| // not be started. This member is only accessed on IO thread. |
| std::vector<scoped_refptr<VideoCaptureController>> controllers_; |
| - DeviceStartQueue device_start_queue_; |
| + DeviceStartQueue device_start_request_queue_; |
|
mcasas
2017/03/24 21:54:36
DeviceStartQueue is just a list of CaptureDeviceSt
chfremer
2017/03/31 17:25:37
Done.
|
| // Queue to keep photo-associated requests waiting for a device to initialize, |
| // bundles a session id integer and an associated photo-related request. |