Chromium Code Reviews| 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 // VideoCaptureController is the glue between a VideoCaptureDevice and all | 5 // VideoCaptureController is the glue between a VideoCaptureDevice and all |
| 6 // VideoCaptureHosts that have connected to it. A controller exists on behalf of | 6 // VideoCaptureHosts that have connected to it. A controller exists on behalf of |
| 7 // one (and only one) VideoCaptureDevice; both are owned by the | 7 // one (and only one) VideoCaptureDevice; both are owned by the |
| 8 // VideoCaptureManager. | 8 // VideoCaptureManager. |
| 9 // | 9 // |
| 10 // The VideoCaptureController is responsible for: | 10 // The VideoCaptureController is responsible for: |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 89 media::VideoCaptureSessionId session_id, | 89 media::VideoCaptureSessionId session_id, |
| 90 const media::VideoCaptureParams& params); | 90 const media::VideoCaptureParams& params); |
| 91 | 91 |
| 92 // Stop video capture. This will take back all buffers held by by | 92 // Stop video capture. This will take back all buffers held by by |
| 93 // |event_handler|, and |event_handler| shouldn't use those buffers any more. | 93 // |event_handler|, and |event_handler| shouldn't use those buffers any more. |
| 94 // Returns the session_id of the stopped client, or | 94 // Returns the session_id of the stopped client, or |
| 95 // kInvalidMediaCaptureSessionId if the indicated client was not registered. | 95 // kInvalidMediaCaptureSessionId if the indicated client was not registered. |
| 96 int RemoveClient(const VideoCaptureControllerID& id, | 96 int RemoveClient(const VideoCaptureControllerID& id, |
| 97 VideoCaptureControllerEventHandler* event_handler); | 97 VideoCaptureControllerEventHandler* event_handler); |
| 98 | 98 |
| 99 // Pause or resume the video capture for specified client. | |
|
tommi (sloooow) - chröme
2014/10/01 07:17:03
Can you document the side effects of this?
(assumi
michaelbai
2014/10/01 22:09:33
Thanks, I added the side effect in VideoCaptureMan
| |
| 100 void PauseOrResumeClient(const VideoCaptureControllerID& id, | |
| 101 VideoCaptureControllerEventHandler* event_handler, | |
| 102 bool pause); | |
| 103 | |
| 99 int GetClientCount(); | 104 int GetClientCount(); |
| 100 | 105 |
| 106 // Return the number of client that isn't paused. | |
| 107 int GetActiveClientCount(); | |
|
tommi (sloooow) - chröme
2014/10/01 07:17:03
const?
michaelbai
2014/10/01 22:09:33
Done.
| |
| 108 | |
| 101 // API called directly by VideoCaptureManager in case the device is | 109 // API called directly by VideoCaptureManager in case the device is |
| 102 // prematurely closed. | 110 // prematurely closed. |
| 103 void StopSession(int session_id); | 111 void StopSession(int session_id); |
| 104 | 112 |
| 105 // Return a buffer with id |buffer_id| previously given in | 113 // Return a buffer with id |buffer_id| previously given in |
| 106 // VideoCaptureControllerEventHandler::OnBufferReady. In the case that the | 114 // VideoCaptureControllerEventHandler::OnBufferReady. In the case that the |
| 107 // buffer was backed by a texture, |sync_point| will be waited on before | 115 // buffer was backed by a texture, |sync_point| will be waited on before |
| 108 // destroying or recycling the texture, to synchronize with texture users in | 116 // destroying or recycling the texture, to synchronize with texture users in |
| 109 // the renderer process. | 117 // the renderer process. |
| 110 void ReturnBuffer(const VideoCaptureControllerID& id, | 118 void ReturnBuffer(const VideoCaptureControllerID& id, |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 157 media::VideoCaptureFormat video_capture_format_; | 165 media::VideoCaptureFormat video_capture_format_; |
| 158 | 166 |
| 159 base::WeakPtrFactory<VideoCaptureController> weak_ptr_factory_; | 167 base::WeakPtrFactory<VideoCaptureController> weak_ptr_factory_; |
| 160 | 168 |
| 161 DISALLOW_COPY_AND_ASSIGN(VideoCaptureController); | 169 DISALLOW_COPY_AND_ASSIGN(VideoCaptureController); |
| 162 }; | 170 }; |
| 163 | 171 |
| 164 } // namespace content | 172 } // namespace content |
| 165 | 173 |
| 166 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_CONTROLLER_H_ | 174 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_CONTROLLER_H_ |
| OLD | NEW |