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

Side by Side Diff: media/video/capture/mac/video_capture_device_factory_mac.mm

Issue 398093002: AVFoundation video capture: blacklisting micro fix (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 | Annotate | Revision Log
« 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "media/video/capture/mac/video_capture_device_factory_mac.h" 5 #include "media/video/capture/mac/video_capture_device_factory_mac.h"
6 6
7 #import <IOKit/audio/IOAudioTypes.h> 7 #import <IOKit/audio/IOAudioTypes.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 (transport_type == kIOAudioDeviceTransportTypeBuiltIn || 111 (transport_type == kIOAudioDeviceTransportTypeBuiltIn ||
112 transport_type == kIOAudioDeviceTransportTypeUSB) 112 transport_type == kIOAudioDeviceTransportTypeUSB)
113 ? VideoCaptureDevice::Name::USB_OR_BUILT_IN 113 ? VideoCaptureDevice::Name::USB_OR_BUILT_IN
114 : VideoCaptureDevice::Name::OTHER_TRANSPORT; 114 : VideoCaptureDevice::Name::OTHER_TRANSPORT;
115 VideoCaptureDevice::Name name( 115 VideoCaptureDevice::Name name(
116 [[[capture_devices valueForKey:key] deviceName] UTF8String], 116 [[[capture_devices valueForKey:key] deviceName] UTF8String],
117 [key UTF8String], VideoCaptureDevice::Name::AVFOUNDATION, 117 [key UTF8String], VideoCaptureDevice::Name::AVFOUNDATION,
118 device_transport_type); 118 device_transport_type);
119 device_names->push_back(name); 119 device_names->push_back(name);
120 for (size_t i = 0; i < arraysize(kBlacklistedCameras); ++i) { 120 for (size_t i = 0; i < arraysize(kBlacklistedCameras); ++i) {
121 is_any_device_blacklisted = EndsWith(name.id(), 121 is_any_device_blacklisted |= EndsWith(name.id(),
tommi (sloooow) - chröme 2014/07/17 10:46:57 The loop breaks as soon as is_any_device_blacklist
mcasas 2014/07/17 11:25:13 This flag accumulates over the devices walked in t
122 kBlacklistedCameras[i].unique_id_signature, false); 122 kBlacklistedCameras[i].unique_id_signature, false);
123 if (is_any_device_blacklisted) 123 if (is_any_device_blacklisted)
124 break; 124 break;
125 } 125 }
126 } 126 }
127 // If there is any device blacklisted in the system, walk the QTKit device 127 // If there is any device blacklisted in the system, walk the QTKit device
128 // list and add those devices with a blacklisted name to the |device_names|. 128 // list and add those devices with a blacklisted name to the |device_names|.
129 // AVFoundation and QTKit device lists partially overlap, so add a "QTKit" 129 // AVFoundation and QTKit device lists partially overlap, so add a "QTKit"
130 // prefix to the latter ones to distinguish them from the AVFoundation ones. 130 // prefix to the latter ones to distinguish them from the AVFoundation ones.
131 if (is_any_device_blacklisted) { 131 if (is_any_device_blacklisted) {
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 if (device.capture_api_type() == VideoCaptureDevice::Name::AVFOUNDATION) { 173 if (device.capture_api_type() == VideoCaptureDevice::Name::AVFOUNDATION) {
174 DVLOG(1) << "Enumerating video capture capabilities, AVFoundation"; 174 DVLOG(1) << "Enumerating video capture capabilities, AVFoundation";
175 [VideoCaptureDeviceAVFoundation getDevice:device 175 [VideoCaptureDeviceAVFoundation getDevice:device
176 supportedFormats:supported_formats]; 176 supportedFormats:supported_formats];
177 } else { 177 } else {
178 NOTIMPLEMENTED(); 178 NOTIMPLEMENTED();
179 } 179 }
180 } 180 }
181 181
182 } // namespace media 182 } // namespace media
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