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 511863002: Mac Video Capture: Connect AVFoundation for Canary and Developer builds. Other channels unaffected. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 "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 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 : is_device_enumeration_disabled_(false), 269 : is_device_enumeration_disabled_(false),
270 media_stream_capture_indicator_(new MediaStreamCaptureIndicator()) { 270 media_stream_capture_indicator_(new MediaStreamCaptureIndicator()) {
271 // MediaCaptureDevicesDispatcher is a singleton. It should be created on 271 // MediaCaptureDevicesDispatcher is a singleton. It should be created on
272 // UI thread. Otherwise, it will not receive 272 // UI thread. Otherwise, it will not receive
273 // content::NOTIFICATION_WEB_CONTENTS_DESTROYED, and that will result in 273 // content::NOTIFICATION_WEB_CONTENTS_DESTROYED, and that will result in
274 // possible use after free. 274 // possible use after free.
275 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 275 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
276 notifications_registrar_.Add( 276 notifications_registrar_.Add(
277 this, content::NOTIFICATION_WEB_CONTENTS_DESTROYED, 277 this, content::NOTIFICATION_WEB_CONTENTS_DESTROYED,
278 content::NotificationService::AllSources()); 278 content::NotificationService::AllSources());
279
280 // AVFoundation is used for video/audio device monitoring and video capture in
281 // Mac. Experimentally, connect it in Canary and Unknown (developer builds).
282 #if defined(OS_MACOSX)
283 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel();
284 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kForceQTKit)) {
285 if (channel == chrome::VersionInfo::CHANNEL_CANARY ||
286 channel == chrome::VersionInfo::CHANNEL_UNKNOWN) {
287 CommandLine::ForCurrentProcess()->AppendSwitch(
288 switches::kEnableAVFoundation);
289 }
290 }
291 #endif
279 } 292 }
280 293
281 MediaCaptureDevicesDispatcher::~MediaCaptureDevicesDispatcher() {} 294 MediaCaptureDevicesDispatcher::~MediaCaptureDevicesDispatcher() {}
282 295
283 void MediaCaptureDevicesDispatcher::RegisterProfilePrefs( 296 void MediaCaptureDevicesDispatcher::RegisterProfilePrefs(
284 user_prefs::PrefRegistrySyncable* registry) { 297 user_prefs::PrefRegistrySyncable* registry) {
285 registry->RegisterStringPref( 298 registry->RegisterStringPref(
286 prefs::kDefaultAudioCaptureDevice, 299 prefs::kDefaultAudioCaptureDevice,
287 std::string(), 300 std::string(),
288 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); 301 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
(...skipping 713 matching lines...) Expand 10 before | Expand all | Expand 10 after
1002 1015
1003 void MediaCaptureDevicesDispatcher::SetTestAudioCaptureDevices( 1016 void MediaCaptureDevicesDispatcher::SetTestAudioCaptureDevices(
1004 const MediaStreamDevices& devices) { 1017 const MediaStreamDevices& devices) {
1005 test_audio_devices_ = devices; 1018 test_audio_devices_ = devices;
1006 } 1019 }
1007 1020
1008 void MediaCaptureDevicesDispatcher::SetTestVideoCaptureDevices( 1021 void MediaCaptureDevicesDispatcher::SetTestVideoCaptureDevices(
1009 const MediaStreamDevices& devices) { 1022 const MediaStreamDevices& devices) {
1010 test_video_devices_ = devices; 1023 test_video_devices_ = devices;
1011 } 1024 }
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