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 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
585 if (device_thread_) | 585 if (device_thread_) |
586 return; | 586 return; |
587 | 587 |
588 device_thread_.reset(new base::Thread("MediaStreamDeviceThread")); | 588 device_thread_.reset(new base::Thread("MediaStreamDeviceThread")); |
589 #if defined(OS_WIN) | 589 #if defined(OS_WIN) |
590 device_thread_->init_com_with_mta(true); | 590 device_thread_->init_com_with_mta(true); |
591 #endif | 591 #endif |
592 CHECK(device_thread_->Start()); | 592 CHECK(device_thread_->Start()); |
593 | 593 |
594 audio_input_device_manager_ = new AudioInputDeviceManager(audio_manager_); | 594 audio_input_device_manager_ = new AudioInputDeviceManager(audio_manager_); |
595 audio_input_device_manager_->Register(this, | 595 audio_input_device_manager_->Register( |
596 device_thread_->message_loop_proxy()); | 596 this, device_thread_->message_loop_proxy().get()); |
597 | 597 |
598 video_capture_manager_ = new VideoCaptureManager(); | 598 video_capture_manager_ = new VideoCaptureManager(); |
599 video_capture_manager_->Register(this, device_thread_->message_loop_proxy()); | 599 video_capture_manager_->Register(this, |
| 600 device_thread_->message_loop_proxy().get()); |
600 | 601 |
601 // We want to be notified of IO message loop destruction to delete the thread | 602 // We want to be notified of IO message loop destruction to delete the thread |
602 // and the device managers. | 603 // and the device managers. |
603 io_loop_ = base::MessageLoop::current(); | 604 io_loop_ = base::MessageLoop::current(); |
604 io_loop_->AddDestructionObserver(this); | 605 io_loop_->AddDestructionObserver(this); |
605 } | 606 } |
606 | 607 |
607 void MediaStreamManager::Opened(MediaStreamType stream_type, | 608 void MediaStreamManager::Opened(MediaStreamType stream_type, |
608 int capture_session_id) { | 609 int capture_session_id) { |
609 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 610 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1040 } | 1041 } |
1041 | 1042 |
1042 // Always do enumeration even though some enumeration is in progress, | 1043 // Always do enumeration even though some enumeration is in progress, |
1043 // because those enumeration commands could be sent before these devices | 1044 // because those enumeration commands could be sent before these devices |
1044 // change. | 1045 // change. |
1045 ++active_enumeration_ref_count_[stream_type]; | 1046 ++active_enumeration_ref_count_[stream_type]; |
1046 GetDeviceManager(stream_type)->EnumerateDevices(stream_type); | 1047 GetDeviceManager(stream_type)->EnumerateDevices(stream_type); |
1047 } | 1048 } |
1048 | 1049 |
1049 } // namespace content | 1050 } // namespace content |
OLD | NEW |