| 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 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 466 void MediaStreamManager::GenerateStream(MediaStreamRequester* requester, | 466 void MediaStreamManager::GenerateStream(MediaStreamRequester* requester, |
| 467 int render_process_id, | 467 int render_process_id, |
| 468 int render_frame_id, | 468 int render_frame_id, |
| 469 const ResourceContext::SaltCallback& sc, | 469 const ResourceContext::SaltCallback& sc, |
| 470 int page_request_id, | 470 int page_request_id, |
| 471 const StreamOptions& options, | 471 const StreamOptions& options, |
| 472 const GURL& security_origin, | 472 const GURL& security_origin, |
| 473 bool user_gesture) { | 473 bool user_gesture) { |
| 474 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 474 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 475 DVLOG(1) << "GenerateStream()"; | 475 DVLOG(1) << "GenerateStream()"; |
| 476 if (CommandLine::ForCurrentProcess()->HasSwitch( | 476 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 477 switches::kUseFakeUIForMediaStream)) { | 477 switches::kUseFakeUIForMediaStream)) { |
| 478 UseFakeUI(scoped_ptr<FakeMediaStreamUIProxy>()); | 478 UseFakeUI(scoped_ptr<FakeMediaStreamUIProxy>()); |
| 479 } | 479 } |
| 480 | 480 |
| 481 DeviceRequest* request = new DeviceRequest(requester, | 481 DeviceRequest* request = new DeviceRequest(requester, |
| 482 render_process_id, | 482 render_process_id, |
| 483 render_frame_id, | 483 render_frame_id, |
| 484 page_request_id, | 484 page_request_id, |
| 485 security_origin, | 485 security_origin, |
| 486 user_gesture, | 486 user_gesture, |
| (...skipping 1099 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1586 device_task_runner_ = audio_manager_->GetWorkerTaskRunner(); | 1586 device_task_runner_ = audio_manager_->GetWorkerTaskRunner(); |
| 1587 | 1587 |
| 1588 audio_input_device_manager_ = new AudioInputDeviceManager(audio_manager_); | 1588 audio_input_device_manager_ = new AudioInputDeviceManager(audio_manager_); |
| 1589 audio_input_device_manager_->Register(this, device_task_runner_); | 1589 audio_input_device_manager_->Register(this, device_task_runner_); |
| 1590 | 1590 |
| 1591 // We want to be notified of IO message loop destruction to delete the thread | 1591 // We want to be notified of IO message loop destruction to delete the thread |
| 1592 // and the device managers. | 1592 // and the device managers. |
| 1593 io_loop_ = base::MessageLoop::current(); | 1593 io_loop_ = base::MessageLoop::current(); |
| 1594 io_loop_->AddDestructionObserver(this); | 1594 io_loop_->AddDestructionObserver(this); |
| 1595 | 1595 |
| 1596 if (CommandLine::ForCurrentProcess()->HasSwitch( | 1596 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 1597 switches::kUseFakeDeviceForMediaStream)) { | 1597 switches::kUseFakeDeviceForMediaStream)) { |
| 1598 audio_input_device_manager()->UseFakeDevice(); | 1598 audio_input_device_manager()->UseFakeDevice(); |
| 1599 } | 1599 } |
| 1600 | 1600 |
| 1601 video_capture_manager_ = | 1601 video_capture_manager_ = |
| 1602 new VideoCaptureManager(media::VideoCaptureDeviceFactory::CreateFactory( | 1602 new VideoCaptureManager(media::VideoCaptureDeviceFactory::CreateFactory( |
| 1603 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI))); | 1603 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI))); |
| 1604 #if defined(OS_WIN) | 1604 #if defined(OS_WIN) |
| 1605 // Use an STA Video Capture Thread to try to avoid crashes on enumeration of | 1605 // Use an STA Video Capture Thread to try to avoid crashes on enumeration of |
| 1606 // buggy third party Direct Show modules, http://crbug.com/428958. | 1606 // buggy third party Direct Show modules, http://crbug.com/428958. |
| 1607 video_capture_thread_.init_com_with_mta(false); | 1607 video_capture_thread_.init_com_with_mta(false); |
| (...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2131 } | 2131 } |
| 2132 } | 2132 } |
| 2133 | 2133 |
| 2134 void MediaStreamManager::SetKeyboardMicOnDeviceThread() { | 2134 void MediaStreamManager::SetKeyboardMicOnDeviceThread() { |
| 2135 DCHECK(device_task_runner_->BelongsToCurrentThread()); | 2135 DCHECK(device_task_runner_->BelongsToCurrentThread()); |
| 2136 audio_manager_->SetHasKeyboardMic(); | 2136 audio_manager_->SetHasKeyboardMic(); |
| 2137 } | 2137 } |
| 2138 #endif | 2138 #endif |
| 2139 | 2139 |
| 2140 } // namespace content | 2140 } // namespace content |
| OLD | NEW |