OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/renderer_host/media/media_stream_manager.h" | 10 #include "content/browser/renderer_host/media/media_stream_manager.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 // kStarting: host has requested a controller, but has not got it yet. | 31 // kStarting: host has requested a controller, but has not got it yet. |
32 // kStarted: host got a controller and has called StartCapture. | 32 // kStarted: host got a controller and has called StartCapture. |
33 // kStopping: renderer process requests StopCapture before host gets | 33 // kStopping: renderer process requests StopCapture before host gets |
34 // a controller. | 34 // a controller. |
35 // kStopped: host has called StopCapture. | 35 // kStopped: host has called StopCapture. |
36 // kError: an error occurred and capture is stopped consequently. | 36 // kError: an error occurred and capture is stopped consequently. |
37 video_capture::State state; | 37 video_capture::State state; |
38 }; | 38 }; |
39 | 39 |
40 VideoCaptureHost::VideoCaptureHost(content::ResourceContext* resource_context, | 40 VideoCaptureHost::VideoCaptureHost(content::ResourceContext* resource_context, |
41 AudioManager* audio_manager) | 41 media::AudioManager* audio_manager) |
42 : resource_context_(resource_context), | 42 : resource_context_(resource_context), |
43 audio_manager_(audio_manager) { | 43 audio_manager_(audio_manager) { |
44 } | 44 } |
45 | 45 |
46 VideoCaptureHost::~VideoCaptureHost() {} | 46 VideoCaptureHost::~VideoCaptureHost() {} |
47 | 47 |
48 void VideoCaptureHost::OnChannelClosing() { | 48 void VideoCaptureHost::OnChannelClosing() { |
49 BrowserMessageFilter::OnChannelClosing(); | 49 BrowserMessageFilter::OnChannelClosing(); |
50 | 50 |
51 // Since the IPC channel is gone, close all requested VideCaptureDevices. | 51 // Since the IPC channel is gone, close all requested VideCaptureDevices. |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 delete it->second; | 282 delete it->second; |
283 entries_.erase(id); | 283 entries_.erase(id); |
284 } | 284 } |
285 } | 285 } |
286 | 286 |
287 media_stream::VideoCaptureManager* VideoCaptureHost::GetVideoCaptureManager() { | 287 media_stream::VideoCaptureManager* VideoCaptureHost::GetVideoCaptureManager() { |
288 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 288 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
289 return media_stream::MediaStreamManager::GetForResourceContext( | 289 return media_stream::MediaStreamManager::GetForResourceContext( |
290 resource_context_, audio_manager_)->video_capture_manager(); | 290 resource_context_, audio_manager_)->video_capture_manager(); |
291 } | 291 } |
OLD | NEW |