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 #include "content/browser/renderer_host/media/video_capture_host.h" | 5 #include "content/browser/renderer_host/media/video_capture_host.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "content/browser/browser_main_loop.h" | 9 #include "content/browser/browser_main_loop.h" |
10 #include "content/browser/renderer_host/media/media_stream_manager.h" | 10 #include "content/browser/renderer_host/media/media_stream_manager.h" |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
170 | 170 |
171 void VideoCaptureHost::DoHandleErrorOnIOThread( | 171 void VideoCaptureHost::DoHandleErrorOnIOThread( |
172 const VideoCaptureControllerID& controller_id) { | 172 const VideoCaptureControllerID& controller_id) { |
173 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 173 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
174 | 174 |
175 if (entries_.find(controller_id) == entries_.end()) | 175 if (entries_.find(controller_id) == entries_.end()) |
176 return; | 176 return; |
177 | 177 |
178 Send(new VideoCaptureMsg_StateChanged(controller_id.device_id, | 178 Send(new VideoCaptureMsg_StateChanged(controller_id.device_id, |
179 VIDEO_CAPTURE_STATE_ERROR)); | 179 VIDEO_CAPTURE_STATE_ERROR)); |
180 DeleteVideoCaptureControllerOnIOThread(controller_id); | 180 |
mcasas
2014/04/24 11:09:47
All platforms/implementations will basically pass
jiayl
2014/04/24 18:11:13
Not sure I understand you. Does the refactored cod
mcasas
2014/04/25 17:18:35
I think is gone.
On 2014/04/24 18:11:13, jiayl wr
| |
181 EntryMap::iterator it = entries_.find(controller_id); | |
182 if (it == entries_.end()) | |
183 return; | |
184 | |
185 if (it->second) { | |
186 media_stream_manager_->video_capture_manager()->AbortCaptureForDeviceError( | |
187 it->second.get(), controller_id, this); | |
188 } | |
189 entries_.erase(it); | |
181 } | 190 } |
mcasas
2014/04/24 11:09:47
This is just a copy-modify-1-word of DeleteVideoCa
jiayl
2014/04/24 18:11:13
Done.
| |
182 | 191 |
183 void VideoCaptureHost::DoEndedOnIOThread( | 192 void VideoCaptureHost::DoEndedOnIOThread( |
184 const VideoCaptureControllerID& controller_id) { | 193 const VideoCaptureControllerID& controller_id) { |
185 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 194 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
186 DVLOG(1) << "VideoCaptureHost::DoEndedOnIOThread"; | 195 DVLOG(1) << "VideoCaptureHost::DoEndedOnIOThread"; |
187 if (entries_.find(controller_id) == entries_.end()) | 196 if (entries_.find(controller_id) == entries_.end()) |
188 return; | 197 return; |
189 | 198 |
190 Send(new VideoCaptureMsg_StateChanged(controller_id.device_id, | 199 Send(new VideoCaptureMsg_StateChanged(controller_id.device_id, |
191 VIDEO_CAPTURE_STATE_ENDED)); | 200 VIDEO_CAPTURE_STATE_ENDED)); |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
352 return; | 361 return; |
353 | 362 |
354 if (it->second) { | 363 if (it->second) { |
355 media_stream_manager_->video_capture_manager()->StopCaptureForClient( | 364 media_stream_manager_->video_capture_manager()->StopCaptureForClient( |
356 it->second.get(), controller_id, this); | 365 it->second.get(), controller_id, this); |
357 } | 366 } |
358 entries_.erase(it); | 367 entries_.erase(it); |
359 } | 368 } |
360 | 369 |
361 } // namespace content | 370 } // namespace content |
OLD | NEW |