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 "base/stl_util.h" | 9 #include "base/stl_util.h" |
10 #include "content/browser/browser_main_loop.h" | 10 #include "content/browser/browser_main_loop.h" |
11 #include "content/browser/renderer_host/media/media_stream_manager.h" | 11 #include "content/browser/renderer_host/media/media_stream_manager.h" |
12 #include "content/browser/renderer_host/media/video_capture_manager.h" | 12 #include "content/browser/renderer_host/media/video_capture_manager.h" |
13 #include "content/common/media/video_capture_messages.h" | 13 #include "content/common/media/video_capture_messages.h" |
| 14 #include "content/public/common/media_stream_request.h" |
14 | 15 |
15 using content::BrowserMainLoop; | 16 using content::BrowserMainLoop; |
16 using content::BrowserMessageFilter; | 17 using content::BrowserMessageFilter; |
17 using content::BrowserThread; | 18 using content::BrowserThread; |
18 | 19 |
19 struct VideoCaptureHost::Entry { | 20 struct VideoCaptureHost::Entry { |
20 Entry(VideoCaptureController* controller) | 21 Entry(VideoCaptureController* controller) |
21 : controller(controller) {} | 22 : controller(controller) {} |
22 | 23 |
23 ~Entry() {} | 24 ~Entry() {} |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 if (controller) { | 273 if (controller) { |
273 controller->StopCapture(controller_id, this); | 274 controller->StopCapture(controller_id, this); |
274 GetVideoCaptureManager()->RemoveController(controller, this); | 275 GetVideoCaptureManager()->RemoveController(controller, this); |
275 } | 276 } |
276 delete it->second; | 277 delete it->second; |
277 entries_.erase(controller_id); | 278 entries_.erase(controller_id); |
278 } | 279 } |
279 | 280 |
280 media_stream::VideoCaptureManager* VideoCaptureHost::GetVideoCaptureManager() { | 281 media_stream::VideoCaptureManager* VideoCaptureHost::GetVideoCaptureManager() { |
281 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 282 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
282 return BrowserMainLoop::GetMediaStreamManager()->video_capture_manager(); | 283 // NOTE: Currently, use of VideoCaptureHostMsg_* only applies to the |
| 284 // MEDIA_DEVICE_VIDEO_CAPTURE. The IPC interface could theoretically be |
| 285 // extended to allow operation with the other video capture types (e.g., tab |
| 286 // mirroring). |
| 287 return BrowserMainLoop::GetMediaStreamManager()->GetVideoCaptureManager( |
| 288 content::MEDIA_DEVICE_VIDEO_CAPTURE); |
283 } | 289 } |
OLD | NEW |