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" |
11 #include "content/browser/renderer_host/media/video_capture_manager.h" | 11 #include "content/browser/renderer_host/media/video_capture_manager.h" |
12 #include "content/common/media/video_capture_messages.h" | 12 #include "content/common/media/video_capture_messages.h" |
13 | 13 |
14 namespace content { | 14 namespace content { |
15 | 15 |
16 VideoCaptureHost::VideoCaptureHost(MediaStreamManager* media_stream_manager) | 16 VideoCaptureHost::VideoCaptureHost(MediaStreamManager* media_stream_manager) |
17 : media_stream_manager_(media_stream_manager) { | 17 : BrowserMessageFilter(VideoCaptureMsgStart), |
| 18 media_stream_manager_(media_stream_manager) { |
18 } | 19 } |
19 | 20 |
20 VideoCaptureHost::~VideoCaptureHost() {} | 21 VideoCaptureHost::~VideoCaptureHost() {} |
21 | 22 |
22 void VideoCaptureHost::OnChannelClosing() { | 23 void VideoCaptureHost::OnChannelClosing() { |
23 // Since the IPC channel is gone, close all requested VideoCaptureDevices. | 24 // Since the IPC channel is gone, close all requested VideoCaptureDevices. |
24 for (EntryMap::iterator it = entries_.begin(); it != entries_.end(); ) { | 25 for (EntryMap::iterator it = entries_.begin(); it != entries_.end(); ) { |
25 const base::WeakPtr<VideoCaptureController>& controller = it->second; | 26 const base::WeakPtr<VideoCaptureController>& controller = it->second; |
26 if (controller) { | 27 if (controller) { |
27 VideoCaptureControllerID controller_id(it->first); | 28 VideoCaptureControllerID controller_id(it->first); |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 return; | 313 return; |
313 | 314 |
314 if (it->second) { | 315 if (it->second) { |
315 media_stream_manager_->video_capture_manager()->StopCaptureForClient( | 316 media_stream_manager_->video_capture_manager()->StopCaptureForClient( |
316 it->second.get(), controller_id, this); | 317 it->second.get(), controller_id, this); |
317 } | 318 } |
318 entries_.erase(it); | 319 entries_.erase(it); |
319 } | 320 } |
320 | 321 |
321 } // namespace content | 322 } // namespace content |
OLD | NEW |