| 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 "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/metrics/field_trial.h" | 9 #include "base/metrics/field_trial.h" |
| 10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 // MediaCaptureDevicesDispatcher is a singleton. It should be created on | 294 // MediaCaptureDevicesDispatcher is a singleton. It should be created on |
| 295 // UI thread. Otherwise, it will not receive | 295 // UI thread. Otherwise, it will not receive |
| 296 // content::NOTIFICATION_WEB_CONTENTS_DESTROYED, and that will result in | 296 // content::NOTIFICATION_WEB_CONTENTS_DESTROYED, and that will result in |
| 297 // possible use after free. | 297 // possible use after free. |
| 298 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 298 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 299 notifications_registrar_.Add( | 299 notifications_registrar_.Add( |
| 300 this, content::NOTIFICATION_WEB_CONTENTS_DESTROYED, | 300 this, content::NOTIFICATION_WEB_CONTENTS_DESTROYED, |
| 301 content::NotificationService::AllSources()); | 301 content::NotificationService::AllSources()); |
| 302 | 302 |
| 303 // AVFoundation is used for video/audio device monitoring and video capture in | 303 // AVFoundation is used for video/audio device monitoring and video capture in |
| 304 // Mac. Experimentally, connect it in Canary and Unknown (developer builds). | 304 // Mac. Experimentally, connect it in Dev, Canary and Unknown (developer |
| 305 // builds). |
| 305 #if defined(OS_MACOSX) | 306 #if defined(OS_MACOSX) |
| 306 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel(); | 307 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel(); |
| 307 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kForceQTKit)) { | 308 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kForceQTKit)) { |
| 308 if (channel == chrome::VersionInfo::CHANNEL_CANARY || | 309 if (channel == chrome::VersionInfo::CHANNEL_DEV || |
| 310 channel == chrome::VersionInfo::CHANNEL_CANARY || |
| 309 channel == chrome::VersionInfo::CHANNEL_UNKNOWN) { | 311 channel == chrome::VersionInfo::CHANNEL_UNKNOWN) { |
| 310 CommandLine::ForCurrentProcess()->AppendSwitch( | 312 CommandLine::ForCurrentProcess()->AppendSwitch( |
| 311 switches::kEnableAVFoundation); | 313 switches::kEnableAVFoundation); |
| 312 } | 314 } |
| 313 } | 315 } |
| 314 #endif | 316 #endif |
| 315 } | 317 } |
| 316 | 318 |
| 317 MediaCaptureDevicesDispatcher::~MediaCaptureDevicesDispatcher() {} | 319 MediaCaptureDevicesDispatcher::~MediaCaptureDevicesDispatcher() {} |
| 318 | 320 |
| (...skipping 769 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1088 | 1090 |
| 1089 void MediaCaptureDevicesDispatcher::SetTestAudioCaptureDevices( | 1091 void MediaCaptureDevicesDispatcher::SetTestAudioCaptureDevices( |
| 1090 const MediaStreamDevices& devices) { | 1092 const MediaStreamDevices& devices) { |
| 1091 test_audio_devices_ = devices; | 1093 test_audio_devices_ = devices; |
| 1092 } | 1094 } |
| 1093 | 1095 |
| 1094 void MediaCaptureDevicesDispatcher::SetTestVideoCaptureDevices( | 1096 void MediaCaptureDevicesDispatcher::SetTestVideoCaptureDevices( |
| 1095 const MediaStreamDevices& devices) { | 1097 const MediaStreamDevices& devices) { |
| 1096 test_video_devices_ = devices; | 1098 test_video_devices_ = devices; |
| 1097 } | 1099 } |
| OLD | NEW |