| 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 // TODO(miu): Confirm use of VideoCaptureHostMsg_* only applies to the user |
| 284 // video capture devices, and does not have anything to do with |
| 285 // MediaStreamHostMsg_*. |
| 286 return BrowserMainLoop::GetMediaStreamManager()->GetVideoCaptureManager( |
| 287 content::MEDIA_STREAM_DEVICE_TYPE_USER_VIDEO_CAPTURE); |
| 283 } | 288 } |
| OLD | NEW |