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 // VideoCaptureHost serves video capture related messages from | 5 // VideoCaptureHost serves video capture related messages from |
6 // VideoCaptureMessageFilter which lives inside the render process. | 6 // VideoCaptureMessageFilter which lives inside the render process. |
7 // | 7 // |
8 // This class is owned by RenderProcessHostImpl, and instantiated on UI | 8 // This class is owned by RenderProcessHostImpl, and instantiated on UI |
9 // thread, but all other operations and method calls happen on IO thread. | 9 // thread, but all other operations and method calls happen on IO thread. |
10 // | 10 // |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 int device_id, | 133 int device_id, |
134 media::VideoCaptureSessionId capture_session_id); | 134 media::VideoCaptureSessionId capture_session_id); |
135 | 135 |
136 // IPC message: Get a device's currently in use format(s), referenced by | 136 // IPC message: Get a device's currently in use format(s), referenced by |
137 // |capture_session_id|. |device_id| is needed for message back-routing | 137 // |capture_session_id|. |device_id| is needed for message back-routing |
138 // purposes. | 138 // purposes. |
139 void OnGetDeviceFormatsInUse( | 139 void OnGetDeviceFormatsInUse( |
140 int device_id, | 140 int device_id, |
141 media::VideoCaptureSessionId capture_session_id); | 141 media::VideoCaptureSessionId capture_session_id); |
142 | 142 |
143 // Send a newly created buffer to the VideoCaptureMessageFilter. | 143 // Sends a newly created buffer to the VideoCaptureMessageFilter. |
144 void DoSendNewBufferOnIOThread( | 144 void DoSendNewBufferOnIOThread( |
145 const VideoCaptureControllerID& controller_id, | 145 const VideoCaptureControllerID& controller_id, |
146 base::SharedMemoryHandle handle, | 146 base::SharedMemoryHandle handle, |
147 int length, | 147 int length, |
148 int buffer_id); | 148 int buffer_id); |
149 | 149 |
150 void DoSendFreeBufferOnIOThread( | 150 void DoSendFreeBufferOnIOThread( |
151 const VideoCaptureControllerID& controller_id, | 151 const VideoCaptureControllerID& controller_id, |
152 int buffer_id); | 152 int buffer_id); |
153 | 153 |
154 // Send a filled buffer to the VideoCaptureMessageFilter. | 154 // Sends a filled buffer to the VideoCaptureMessageFilter. |
155 void DoSendFilledBufferOnIOThread( | 155 void DoSendFilledBufferOnIOThread( |
156 const VideoCaptureControllerID& controller_id, | 156 const VideoCaptureControllerID& controller_id, |
157 int buffer_id, | 157 int buffer_id, |
158 const media::VideoCaptureFormat& format, | 158 const media::VideoCaptureFormat& format, |
159 base::TimeTicks timestamp); | 159 base::TimeTicks timestamp); |
160 | 160 |
161 // Send a filled texture mailbox buffer to the VideoCaptureMessageFilter. | 161 // Sends a filled texture mailbox buffer to the VideoCaptureMessageFilter. |
162 void DoSendFilledMailboxBufferOnIOThread( | 162 void DoSendFilledMailboxBufferOnIOThread( |
163 const VideoCaptureControllerID& controller_id, | 163 const VideoCaptureControllerID& controller_id, |
164 int buffer_id, | 164 int buffer_id, |
165 const gpu::MailboxHolder& mailbox_holder, | 165 const gpu::MailboxHolder& mailbox_holder, |
166 const media::VideoCaptureFormat& format, | 166 const media::VideoCaptureFormat& format, |
167 base::TimeTicks timestamp); | 167 base::TimeTicks timestamp); |
168 | 168 |
169 // Handle error coming from VideoCaptureDevice. | 169 // Handles error coming from VideoCaptureDevice. |
170 void DoHandleErrorOnIOThread(const VideoCaptureControllerID& controller_id); | 170 void DoHandleErrorOnIOThread(const VideoCaptureControllerID& controller_id); |
171 | 171 |
172 void DoEndedOnIOThread(const VideoCaptureControllerID& controller_id); | 172 void DoEndedOnIOThread(const VideoCaptureControllerID& controller_id); |
173 | 173 |
| 174 // Deletes the controller and notifies the VideoCaptureManager. |on_error| is |
| 175 // true if this is triggered by VideoCaptureControllerEventHandler::OnError. |
174 void DeleteVideoCaptureControllerOnIOThread( | 176 void DeleteVideoCaptureControllerOnIOThread( |
175 const VideoCaptureControllerID& controller_id); | 177 const VideoCaptureControllerID& controller_id, bool on_error); |
176 | 178 |
177 MediaStreamManager* media_stream_manager_; | 179 MediaStreamManager* media_stream_manager_; |
178 | 180 |
179 typedef std::map<VideoCaptureControllerID, | 181 typedef std::map<VideoCaptureControllerID, |
180 base::WeakPtr<VideoCaptureController> > EntryMap; | 182 base::WeakPtr<VideoCaptureController> > EntryMap; |
181 | 183 |
182 // A map of VideoCaptureControllerID to the VideoCaptureController to which it | 184 // A map of VideoCaptureControllerID to the VideoCaptureController to which it |
183 // is connected. An entry in this map holds a null controller while it is in | 185 // is connected. An entry in this map holds a null controller while it is in |
184 // the process of starting. | 186 // the process of starting. |
185 EntryMap entries_; | 187 EntryMap entries_; |
186 | 188 |
187 DISALLOW_COPY_AND_ASSIGN(VideoCaptureHost); | 189 DISALLOW_COPY_AND_ASSIGN(VideoCaptureHost); |
188 }; | 190 }; |
189 | 191 |
190 } // namespace content | 192 } // namespace content |
191 | 193 |
192 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_HOST_H_ | 194 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_HOST_H_ |
OLD | NEW |