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::VideoCaptureFormat& GetVideoCaptureFormat() const; |
| 108 |
107 private: | 109 private: |
108 class VideoCaptureDeviceClient; | 110 class VideoCaptureDeviceClient; |
109 | 111 |
110 struct ControllerClient; | 112 struct ControllerClient; |
111 typedef std::list<ControllerClient*> ControllerClients; | 113 typedef std::list<ControllerClient*> ControllerClients; |
112 | 114 |
113 // Worker functions on IO thread. Called by the VideoCaptureDeviceClient. | 115 // Worker functions on IO thread. Called by the VideoCaptureDeviceClient. |
114 void DoIncomingCapturedI420BufferOnIOThread( | 116 void DoIncomingCapturedI420BufferOnIOThread( |
115 scoped_refptr<media::VideoCaptureDevice::Client::Buffer> buffer, | 117 scoped_refptr<media::VideoCaptureDevice::Client::Buffer> buffer, |
116 const gfx::Size& dimensions, | 118 const gfx::Size& dimensions, |
(...skipping 17 matching lines...) Expand all Loading... |
134 // The pool of shared-memory buffers used for capturing. | 136 // The pool of shared-memory buffers used for capturing. |
135 const scoped_refptr<VideoCaptureBufferPool> buffer_pool_; | 137 const scoped_refptr<VideoCaptureBufferPool> buffer_pool_; |
136 | 138 |
137 // All clients served by this controller. | 139 // All clients served by this controller. |
138 ControllerClients controller_clients_; | 140 ControllerClients controller_clients_; |
139 | 141 |
140 // Takes on only the states 'STARTED' and 'ERROR'. 'ERROR' is an absorbing | 142 // Takes on only the states 'STARTED' and 'ERROR'. 'ERROR' is an absorbing |
141 // state which stops the flow of data to clients. | 143 // state which stops the flow of data to clients. |
142 VideoCaptureState state_; | 144 VideoCaptureState state_; |
143 | 145 |
| 146 media::VideoCaptureFormat video_capture_format_; |
| 147 |
144 base::WeakPtrFactory<VideoCaptureController> weak_ptr_factory_; | 148 base::WeakPtrFactory<VideoCaptureController> weak_ptr_factory_; |
145 | 149 |
146 DISALLOW_COPY_AND_ASSIGN(VideoCaptureController); | 150 DISALLOW_COPY_AND_ASSIGN(VideoCaptureController); |
147 }; | 151 }; |
148 | 152 |
149 } // namespace content | 153 } // namespace content |
150 | 154 |
151 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_CONTROLLER_H_ | 155 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_CONTROLLER_H_ |
OLD | NEW |