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 "chrome/browser/media/media_capture_devices_dispatcher.h" | 5 #include "chrome/browser/media/media_capture_devices_dispatcher.h" |
6 | 6 |
7 #include "apps/app_window.h" | 7 #include "apps/app_window.h" |
8 #include "apps/app_window_registry.h" | 8 #include "apps/app_window_registry.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
267 : is_device_enumeration_disabled_(false), | 267 : is_device_enumeration_disabled_(false), |
268 media_stream_capture_indicator_(new MediaStreamCaptureIndicator()) { | 268 media_stream_capture_indicator_(new MediaStreamCaptureIndicator()) { |
269 // MediaCaptureDevicesDispatcher is a singleton. It should be created on | 269 // MediaCaptureDevicesDispatcher is a singleton. It should be created on |
270 // UI thread. Otherwise, it will not receive | 270 // UI thread. Otherwise, it will not receive |
271 // content::NOTIFICATION_WEB_CONTENTS_DESTROYED, and that will result in | 271 // content::NOTIFICATION_WEB_CONTENTS_DESTROYED, and that will result in |
272 // possible use after free. | 272 // possible use after free. |
273 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 273 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
274 notifications_registrar_.Add( | 274 notifications_registrar_.Add( |
275 this, content::NOTIFICATION_WEB_CONTENTS_DESTROYED, | 275 this, content::NOTIFICATION_WEB_CONTENTS_DESTROYED, |
276 content::NotificationService::AllSources()); | 276 content::NotificationService::AllSources()); |
277 | |
278 // AVFoundation is used for video/audio device monitoring and video capture in | |
279 // Mac. Experimentally, connect it in Canary and Unknown (developer builds). | |
280 #if defined(OS_MACOSX) | |
andresp-chromium
2014/08/06 06:50:33
I wonder why this was here and not controlled by t
vrk (LEFT CHROMIUM)
2014/08/07 01:25:00
Acknowledged.
| |
281 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel(); | |
282 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kForceQTKit)) { | |
283 if (channel == chrome::VersionInfo::CHANNEL_CANARY || | |
284 channel == chrome::VersionInfo::CHANNEL_UNKNOWN) { | |
285 CommandLine::ForCurrentProcess()->AppendSwitch( | |
286 switches::kEnableAVFoundation); | |
287 } | |
288 } | |
289 #endif | |
290 } | 277 } |
291 | 278 |
292 MediaCaptureDevicesDispatcher::~MediaCaptureDevicesDispatcher() {} | 279 MediaCaptureDevicesDispatcher::~MediaCaptureDevicesDispatcher() {} |
293 | 280 |
294 void MediaCaptureDevicesDispatcher::RegisterProfilePrefs( | 281 void MediaCaptureDevicesDispatcher::RegisterProfilePrefs( |
295 user_prefs::PrefRegistrySyncable* registry) { | 282 user_prefs::PrefRegistrySyncable* registry) { |
296 registry->RegisterStringPref( | 283 registry->RegisterStringPref( |
297 prefs::kDefaultAudioCaptureDevice, | 284 prefs::kDefaultAudioCaptureDevice, |
298 std::string(), | 285 std::string(), |
299 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 286 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
(...skipping 713 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1013 | 1000 |
1014 void MediaCaptureDevicesDispatcher::SetTestAudioCaptureDevices( | 1001 void MediaCaptureDevicesDispatcher::SetTestAudioCaptureDevices( |
1015 const MediaStreamDevices& devices) { | 1002 const MediaStreamDevices& devices) { |
1016 test_audio_devices_ = devices; | 1003 test_audio_devices_ = devices; |
1017 } | 1004 } |
1018 | 1005 |
1019 void MediaCaptureDevicesDispatcher::SetTestVideoCaptureDevices( | 1006 void MediaCaptureDevicesDispatcher::SetTestVideoCaptureDevices( |
1020 const MediaStreamDevices& devices) { | 1007 const MediaStreamDevices& devices) { |
1021 test_video_devices_ = devices; | 1008 test_video_devices_ = devices; |
1022 } | 1009 } |
OLD | NEW |