Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(314)

Side by Side Diff: chrome/browser/media/media_capture_devices_dispatcher.cc

Issue 622543007: Mac Video Capture: Connect AVFoundation by default (unless --force-qtkit). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 media_stream_capture_indicator_(new MediaStreamCaptureIndicator()) { 250 media_stream_capture_indicator_(new MediaStreamCaptureIndicator()) {
251 // MediaCaptureDevicesDispatcher is a singleton. It should be created on 251 // MediaCaptureDevicesDispatcher is a singleton. It should be created on
252 // UI thread. Otherwise, it will not receive 252 // UI thread. Otherwise, it will not receive
253 // content::NOTIFICATION_WEB_CONTENTS_DESTROYED, and that will result in 253 // content::NOTIFICATION_WEB_CONTENTS_DESTROYED, and that will result in
254 // possible use after free. 254 // possible use after free.
255 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 255 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
256 notifications_registrar_.Add( 256 notifications_registrar_.Add(
257 this, content::NOTIFICATION_WEB_CONTENTS_DESTROYED, 257 this, content::NOTIFICATION_WEB_CONTENTS_DESTROYED,
258 content::NotificationService::AllSources()); 258 content::NotificationService::AllSources());
259 259
260 // AVFoundation is used for video/audio device monitoring and video capture in
261 // Mac. Experimentally, connect it in Dev, Canary and Unknown (developer
262 // builds).
263 #if defined(OS_MACOSX) 260 #if defined(OS_MACOSX)
264 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel(); 261 // AVFoundation is used for video/audio device monitoring and video capture.
265 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kForceQTKit)) { 262 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kForceQTKit)) {
266 if (channel == chrome::VersionInfo::CHANNEL_DEV || 263 CommandLine::ForCurrentProcess()->AppendSwitch(
267 channel == chrome::VersionInfo::CHANNEL_CANARY || 264 switches::kEnableAVFoundation);
268 channel == chrome::VersionInfo::CHANNEL_UNKNOWN) {
269 CommandLine::ForCurrentProcess()->AppendSwitch(
270 switches::kEnableAVFoundation);
271 }
272 } 265 }
273 #endif 266 #endif
274 } 267 }
275 268
276 MediaCaptureDevicesDispatcher::~MediaCaptureDevicesDispatcher() {} 269 MediaCaptureDevicesDispatcher::~MediaCaptureDevicesDispatcher() {}
277 270
278 void MediaCaptureDevicesDispatcher::RegisterProfilePrefs( 271 void MediaCaptureDevicesDispatcher::RegisterProfilePrefs(
279 user_prefs::PrefRegistrySyncable* registry) { 272 user_prefs::PrefRegistrySyncable* registry) {
280 registry->RegisterStringPref( 273 registry->RegisterStringPref(
281 prefs::kDefaultAudioCaptureDevice, 274 prefs::kDefaultAudioCaptureDevice,
(...skipping 811 matching lines...) Expand 10 before | Expand all | Expand 10 after
1093 1086
1094 void MediaCaptureDevicesDispatcher::SetTestAudioCaptureDevices( 1087 void MediaCaptureDevicesDispatcher::SetTestAudioCaptureDevices(
1095 const MediaStreamDevices& devices) { 1088 const MediaStreamDevices& devices) {
1096 test_audio_devices_ = devices; 1089 test_audio_devices_ = devices;
1097 } 1090 }
1098 1091
1099 void MediaCaptureDevicesDispatcher::SetTestVideoCaptureDevices( 1092 void MediaCaptureDevicesDispatcher::SetTestVideoCaptureDevices(
1100 const MediaStreamDevices& devices) { 1093 const MediaStreamDevices& devices) {
1101 test_video_devices_ = devices; 1094 test_video_devices_ = devices;
1102 } 1095 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698