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 DoIncomingCapturedFrameOnIOThread( | 116 void DoIncomingCapturedFrameOnIOThread( |
115 const scoped_refptr<media::VideoFrame>& captured_frame, | 117 const scoped_refptr<media::VideoFrame>& captured_frame, |
116 int frame_rate, | 118 int frame_rate, |
(...skipping 16 matching lines...) Expand all Loading... |
133 // The pool of shared-memory buffers used for capturing. | 135 // The pool of shared-memory buffers used for capturing. |
134 const scoped_refptr<VideoCaptureBufferPool> buffer_pool_; | 136 const scoped_refptr<VideoCaptureBufferPool> buffer_pool_; |
135 | 137 |
136 // All clients served by this controller. | 138 // All clients served by this controller. |
137 ControllerClients controller_clients_; | 139 ControllerClients controller_clients_; |
138 | 140 |
139 // Takes on only the states 'STARTED' and 'ERROR'. 'ERROR' is an absorbing | 141 // Takes on only the states 'STARTED' and 'ERROR'. 'ERROR' is an absorbing |
140 // state which stops the flow of data to clients. | 142 // state which stops the flow of data to clients. |
141 VideoCaptureState state_; | 143 VideoCaptureState state_; |
142 | 144 |
| 145 media::VideoCaptureFormat video_capture_format_; |
| 146 |
143 base::WeakPtrFactory<VideoCaptureController> weak_ptr_factory_; | 147 base::WeakPtrFactory<VideoCaptureController> weak_ptr_factory_; |
144 | 148 |
145 DISALLOW_COPY_AND_ASSIGN(VideoCaptureController); | 149 DISALLOW_COPY_AND_ASSIGN(VideoCaptureController); |
146 }; | 150 }; |
147 | 151 |
148 } // namespace content | 152 } // namespace content |
149 | 153 |
150 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_CONTROLLER_H_ | 154 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_CONTROLLER_H_ |
OLD | NEW |