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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 97 // API called directly by VideoCaptureManager in case the device is | 97 // API called directly by VideoCaptureManager in case the device is |
| 98 // prematurely closed. | 98 // prematurely closed. |
| 99 void StopSession(int session_id); | 99 void StopSession(int session_id); |
| 100 | 100 |
| 101 // Return a buffer previously given in | 101 // Return a buffer previously given in |
| 102 // VideoCaptureControllerEventHandler::OnBufferReady. | 102 // VideoCaptureControllerEventHandler::OnBufferReady. |
| 103 void ReturnBuffer(const VideoCaptureControllerID& id, | 103 void ReturnBuffer(const VideoCaptureControllerID& id, |
| 104 VideoCaptureControllerEventHandler* event_handler, | 104 VideoCaptureControllerEventHandler* event_handler, |
| 105 int buffer_id); | 105 int buffer_id); |
| 106 | 106 |
| 107 const media::VideoCaptureParams& getVideoCaptureParams() const { | |
|
perkj_chrome
2013/11/12 11:10:58
GetVideoCaptureParams()
mcasas
2013/11/12 12:21:53
Done.
| |
| 108 return video_capture_params_; | |
| 109 } | |
| 110 | |
| 107 private: | 111 private: |
| 108 class VideoCaptureDeviceClient; | 112 class VideoCaptureDeviceClient; |
| 109 | 113 |
| 110 struct ControllerClient; | 114 struct ControllerClient; |
| 111 typedef std::list<ControllerClient*> ControllerClients; | 115 typedef std::list<ControllerClient*> ControllerClients; |
| 112 | 116 |
| 113 // Worker functions on IO thread. Called by the VideoCaptureDeviceClient. | 117 // Worker functions on IO thread. Called by the VideoCaptureDeviceClient. |
| 114 void DoIncomingCapturedFrameOnIOThread( | 118 void DoIncomingCapturedFrameOnIOThread( |
| 115 const scoped_refptr<media::VideoFrame>& captured_frame, | 119 const scoped_refptr<media::VideoFrame>& captured_frame, |
| 116 int frame_rate, | 120 int frame_rate, |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 133 // The pool of shared-memory buffers used for capturing. | 137 // The pool of shared-memory buffers used for capturing. |
| 134 const scoped_refptr<VideoCaptureBufferPool> buffer_pool_; | 138 const scoped_refptr<VideoCaptureBufferPool> buffer_pool_; |
| 135 | 139 |
| 136 // All clients served by this controller. | 140 // All clients served by this controller. |
| 137 ControllerClients controller_clients_; | 141 ControllerClients controller_clients_; |
| 138 | 142 |
| 139 // Takes on only the states 'STARTED' and 'ERROR'. 'ERROR' is an absorbing | 143 // Takes on only the states 'STARTED' and 'ERROR'. 'ERROR' is an absorbing |
| 140 // state which stops the flow of data to clients. | 144 // state which stops the flow of data to clients. |
| 141 VideoCaptureState state_; | 145 VideoCaptureState state_; |
| 142 | 146 |
| 147 media::VideoCaptureParams video_capture_params_; | |
| 148 | |
| 143 base::WeakPtrFactory<VideoCaptureController> weak_ptr_factory_; | 149 base::WeakPtrFactory<VideoCaptureController> weak_ptr_factory_; |
| 144 | 150 |
| 145 DISALLOW_COPY_AND_ASSIGN(VideoCaptureController); | 151 DISALLOW_COPY_AND_ASSIGN(VideoCaptureController); |
| 146 }; | 152 }; |
| 147 | 153 |
| 148 } // namespace content | 154 } // namespace content |
| 149 | 155 |
| 150 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_CONTROLLER_H_ | 156 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_CONTROLLER_H_ |
| OLD | NEW |