| 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/media_stream_manager.h" | 5 #include "content/browser/renderer_host/media/media_stream_manager.h" |
| 6 | 6 |
| 7 #include <list> | 7 #include <list> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 1424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1435 // We want to be notified of IO message loop destruction to delete the thread | 1435 // We want to be notified of IO message loop destruction to delete the thread |
| 1436 // and the device managers. | 1436 // and the device managers. |
| 1437 io_loop_ = base::MessageLoop::current(); | 1437 io_loop_ = base::MessageLoop::current(); |
| 1438 io_loop_->AddDestructionObserver(this); | 1438 io_loop_->AddDestructionObserver(this); |
| 1439 | 1439 |
| 1440 if (CommandLine::ForCurrentProcess()->HasSwitch( | 1440 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 1441 switches::kUseFakeDeviceForMediaStream)) { | 1441 switches::kUseFakeDeviceForMediaStream)) { |
| 1442 audio_input_device_manager()->UseFakeDevice(); | 1442 audio_input_device_manager()->UseFakeDevice(); |
| 1443 } | 1443 } |
| 1444 | 1444 |
| 1445 video_capture_manager_ = new VideoCaptureManager( | 1445 video_capture_manager_ = |
| 1446 media::VideoCaptureDeviceFactory::CreateFactory()); | 1446 new VideoCaptureManager(media::VideoCaptureDeviceFactory::CreateFactory( |
| 1447 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI))); |
| 1447 video_capture_manager_->Register(this, device_task_runner_); | 1448 video_capture_manager_->Register(this, device_task_runner_); |
| 1448 } | 1449 } |
| 1449 | 1450 |
| 1450 void MediaStreamManager::Opened(MediaStreamType stream_type, | 1451 void MediaStreamManager::Opened(MediaStreamType stream_type, |
| 1451 int capture_session_id) { | 1452 int capture_session_id) { |
| 1452 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 1453 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 1453 DVLOG(1) << "Opened({stream_type = " << stream_type << "} " | 1454 DVLOG(1) << "Opened({stream_type = " << stream_type << "} " |
| 1454 << "{capture_session_id = " << capture_session_id << "})"; | 1455 << "{capture_session_id = " << capture_session_id << "})"; |
| 1455 // Find the request(s) containing this device and mark it as used. | 1456 // Find the request(s) containing this device and mark it as used. |
| 1456 // It can be used in several requests since the same device can be | 1457 // It can be used in several requests since the same device can be |
| (...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1927 if (it->device.type == MEDIA_DESKTOP_VIDEO_CAPTURE) { | 1928 if (it->device.type == MEDIA_DESKTOP_VIDEO_CAPTURE) { |
| 1928 video_capture_manager_->SetDesktopCaptureWindowId(it->session_id, | 1929 video_capture_manager_->SetDesktopCaptureWindowId(it->session_id, |
| 1929 window_id); | 1930 window_id); |
| 1930 break; | 1931 break; |
| 1931 } | 1932 } |
| 1932 } | 1933 } |
| 1933 } | 1934 } |
| 1934 } | 1935 } |
| 1935 | 1936 |
| 1936 } // namespace content | 1937 } // namespace content |
| OLD | NEW |