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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 | 126 |
127 private: | 127 private: |
128 class VideoCaptureDeviceClient; | 128 class VideoCaptureDeviceClient; |
129 | 129 |
130 struct ControllerClient; | 130 struct ControllerClient; |
131 typedef std::list<ControllerClient*> ControllerClients; | 131 typedef std::list<ControllerClient*> ControllerClients; |
132 | 132 |
133 // Worker functions on IO thread. Called by the VideoCaptureDeviceClient. | 133 // Worker functions on IO thread. Called by the VideoCaptureDeviceClient. |
134 void DoIncomingCapturedVideoFrameOnIOThread( | 134 void DoIncomingCapturedVideoFrameOnIOThread( |
135 const scoped_refptr<media::VideoCaptureDevice::Client::Buffer>& buffer, | 135 const scoped_refptr<media::VideoCaptureDevice::Client::Buffer>& buffer, |
136 const media::VideoCaptureFormat& format, | |
137 const scoped_refptr<media::VideoFrame>& frame, | 136 const scoped_refptr<media::VideoFrame>& frame, |
138 const base::TimeTicks& timestamp); | 137 const base::TimeTicks& timestamp); |
139 void DoErrorOnIOThread(); | 138 void DoErrorOnIOThread(); |
140 void DoDeviceStoppedOnIOThread(); | 139 void DoDeviceStoppedOnIOThread(); |
141 void DoBufferDestroyedOnIOThread(int buffer_id_to_drop); | 140 void DoBufferDestroyedOnIOThread(int buffer_id_to_drop); |
142 | 141 |
143 // Find a client of |id| and |handler| in |clients|. | 142 // Find a client of |id| and |handler| in |clients|. |
144 ControllerClient* FindClient(const VideoCaptureControllerID& id, | 143 ControllerClient* FindClient(const VideoCaptureControllerID& id, |
145 VideoCaptureControllerEventHandler* handler, | 144 VideoCaptureControllerEventHandler* handler, |
146 const ControllerClients& clients); | 145 const ControllerClients& clients); |
(...skipping 18 matching lines...) Expand all Loading... |
165 media::VideoCaptureFormat video_capture_format_; | 164 media::VideoCaptureFormat video_capture_format_; |
166 | 165 |
167 base::WeakPtrFactory<VideoCaptureController> weak_ptr_factory_; | 166 base::WeakPtrFactory<VideoCaptureController> weak_ptr_factory_; |
168 | 167 |
169 DISALLOW_COPY_AND_ASSIGN(VideoCaptureController); | 168 DISALLOW_COPY_AND_ASSIGN(VideoCaptureController); |
170 }; | 169 }; |
171 | 170 |
172 } // namespace content | 171 } // namespace content |
173 | 172 |
174 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_CONTROLLER_H_ | 173 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_CONTROLLER_H_ |
OLD | NEW |