| 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 // VideoCaptureHost serves video capture related messages from | 5 // VideoCaptureHost serves video capture related messages from |
| 6 // VideoCaptureMessageFilter which lives inside the render process. | 6 // VideoCaptureMessageFilter which lives inside the render process. |
| 7 // | 7 // |
| 8 // This class is owned by RenderProcessHostImpl, and instantiated on UI | 8 // This class is owned by RenderProcessHostImpl, and instantiated on UI |
| 9 // thread, but all other operations and method calls happen on IO thread. | 9 // thread, but all other operations and method calls happen on IO thread. |
| 10 // | 10 // |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 void DoError(VideoCaptureControllerID id); | 107 void DoError(VideoCaptureControllerID id); |
| 108 void DoEnded(VideoCaptureControllerID id); | 108 void DoEnded(VideoCaptureControllerID id); |
| 109 | 109 |
| 110 ~VideoCaptureHost() override; | 110 ~VideoCaptureHost() override; |
| 111 | 111 |
| 112 // IPC message handlers. | 112 // IPC message handlers. |
| 113 void OnRendererFinishedWithBuffer(int device_id, | 113 void OnRendererFinishedWithBuffer(int device_id, |
| 114 int buffer_id, | 114 int buffer_id, |
| 115 const gpu::SyncToken& sync_token, | 115 const gpu::SyncToken& sync_token, |
| 116 double consumer_resource_utilization); | 116 double consumer_resource_utilization); |
| 117 void OnGetDeviceSupportedFormats( | |
| 118 int device_id, | |
| 119 media::VideoCaptureSessionId capture_session_id); | |
| 120 void OnGetDeviceFormatsInUse(int device_id, | |
| 121 media::VideoCaptureSessionId capture_session_id); | |
| 122 | 117 |
| 123 // mojom::VideoCaptureHost implementation | 118 // mojom::VideoCaptureHost implementation |
| 124 void Start(int32_t device_id, | 119 void Start(int32_t device_id, |
| 125 int32_t session_id, | 120 int32_t session_id, |
| 126 const media::VideoCaptureParams& params) override; | 121 const media::VideoCaptureParams& params) override; |
| 127 void Stop(int32_t device_id) override; | 122 void Stop(int32_t device_id) override; |
| 128 void Pause(int32_t device_id) override; | 123 void Pause(int32_t device_id) override; |
| 129 void Resume(int32_t device_id, | 124 void Resume(int32_t device_id, |
| 130 int32_t session_id, | 125 int32_t session_id, |
| 131 const media::VideoCaptureParams& params) override; | 126 const media::VideoCaptureParams& params) override; |
| 132 void RequestRefreshFrame(int32_t device_id) override; | 127 void RequestRefreshFrame(int32_t device_id) override; |
| 128 void GetDeviceSupportedFormats( |
| 129 int32_t device_id, |
| 130 int32_t session_id, |
| 131 const GetDeviceSupportedFormatsCallback& callback) override; |
| 132 void GetDeviceFormatsInUse( |
| 133 int32_t device_id, |
| 134 int32_t session_id, |
| 135 const GetDeviceFormatsInUseCallback& callback) override; |
| 133 | 136 |
| 134 void OnControllerAdded( | 137 void OnControllerAdded( |
| 135 int device_id, | 138 int device_id, |
| 136 const base::WeakPtr<VideoCaptureController>& controller); | 139 const base::WeakPtr<VideoCaptureController>& controller); |
| 137 | 140 |
| 138 // Deletes the controller and notifies the VideoCaptureManager. |on_error| is | 141 // Deletes the controller and notifies the VideoCaptureManager. |on_error| is |
| 139 // true if this is triggered by VideoCaptureControllerEventHandler::OnError. | 142 // true if this is triggered by VideoCaptureControllerEventHandler::OnError. |
| 140 void DeleteVideoCaptureController(VideoCaptureControllerID controller_id, | 143 void DeleteVideoCaptureController(VideoCaptureControllerID controller_id, |
| 141 bool on_error); | 144 bool on_error); |
| 142 | 145 |
| 143 MediaStreamManager* const media_stream_manager_; | 146 MediaStreamManager* const media_stream_manager_; |
| 144 | 147 |
| 145 // A map of VideoCaptureControllerID to the VideoCaptureController to which it | 148 // A map of VideoCaptureControllerID to the VideoCaptureController to which it |
| 146 // is connected. An entry in this map holds a null controller while it is in | 149 // is connected. An entry in this map holds a null controller while it is in |
| 147 // the process of starting. | 150 // the process of starting. |
| 148 std::map<VideoCaptureControllerID, base::WeakPtr<VideoCaptureController>> | 151 std::map<VideoCaptureControllerID, base::WeakPtr<VideoCaptureController>> |
| 149 controllers_; | 152 controllers_; |
| 150 | 153 |
| 151 DISALLOW_COPY_AND_ASSIGN(VideoCaptureHost); | 154 DISALLOW_COPY_AND_ASSIGN(VideoCaptureHost); |
| 152 }; | 155 }; |
| 153 | 156 |
| 154 } // namespace content | 157 } // namespace content |
| 155 | 158 |
| 156 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_HOST_H_ | 159 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_HOST_H_ |
| OLD | NEW |