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

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

Issue 1233043003: Remove some legacy versions of StartsWith and EndsWith. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
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 17 matching lines...) Expand all
28 const char* unique_id_signature; 28 const char* unique_id_signature;
29 const int capture_width; 29 const int capture_width;
30 const int capture_height; 30 const int capture_height;
31 const float capture_frame_rate; 31 const float capture_frame_rate;
32 } kBlacklistedCameras[] = { {"-01FDA82C8A9C", 1280, 720, 60.0f } }; 32 } kBlacklistedCameras[] = { {"-01FDA82C8A9C", 1280, 720, 60.0f } };
33 33
34 static bool IsDeviceBlacklisted(const VideoCaptureDevice::Name& name) { 34 static bool IsDeviceBlacklisted(const VideoCaptureDevice::Name& name) {
35 bool is_device_blacklisted = false; 35 bool is_device_blacklisted = false;
36 for(size_t i = 0; 36 for(size_t i = 0;
37 !is_device_blacklisted && i < arraysize(kBlacklistedCameras); ++i) { 37 !is_device_blacklisted && i < arraysize(kBlacklistedCameras); ++i) {
38 is_device_blacklisted = base::EndsWith(name.id(), 38 is_device_blacklisted =
39 kBlacklistedCameras[i].unique_id_signature, false); 39 base::EndsWith(name.id(),
40 kBlacklistedCameras[i].unique_id_signature,
41 base::CompareCase::INSENSITIVE_ASCII);
40 } 42 }
41 DVLOG_IF(2, is_device_blacklisted) << "Blacklisted camera: " << 43 DVLOG_IF(2, is_device_blacklisted) << "Blacklisted camera: " <<
42 name.name() << ", id: " << name.id(); 44 name.name() << ", id: " << name.id();
43 return is_device_blacklisted; 45 return is_device_blacklisted;
44 } 46 }
45 47
46 static scoped_ptr<media::VideoCaptureDevice::Names> 48 static scoped_ptr<media::VideoCaptureDevice::Names>
47 EnumerateDevicesUsingQTKit() { 49 EnumerateDevicesUsingQTKit() {
48 // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/458397 is 50 // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/458397 is
49 // fixed. 51 // fixed.
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 [VideoCaptureDeviceAVFoundation getDevice:device 179 [VideoCaptureDeviceAVFoundation getDevice:device
178 supportedFormats:supported_formats]; 180 supportedFormats:supported_formats];
179 break; 181 break;
180 case VideoCaptureDevice::Name::QTKIT: 182 case VideoCaptureDevice::Name::QTKIT:
181 // Blacklisted cameras provide their own supported format(s), otherwise no 183 // Blacklisted cameras provide their own supported format(s), otherwise no
182 // such information is provided for QTKit devices. 184 // such information is provided for QTKit devices.
183 if (device.is_blacklisted()) { 185 if (device.is_blacklisted()) {
184 for (size_t i = 0; i < arraysize(kBlacklistedCameras); ++i) { 186 for (size_t i = 0; i < arraysize(kBlacklistedCameras); ++i) {
185 if (base::EndsWith(device.id(), 187 if (base::EndsWith(device.id(),
186 kBlacklistedCameras[i].unique_id_signature, 188 kBlacklistedCameras[i].unique_id_signature,
187 false)) { 189 base::CompareCase::INSENSITIVE_ASCII)) {
188 supported_formats->push_back(media::VideoCaptureFormat( 190 supported_formats->push_back(media::VideoCaptureFormat(
189 gfx::Size(kBlacklistedCameras[i].capture_width, 191 gfx::Size(kBlacklistedCameras[i].capture_width,
190 kBlacklistedCameras[i].capture_height), 192 kBlacklistedCameras[i].capture_height),
191 kBlacklistedCameras[i].capture_frame_rate, 193 kBlacklistedCameras[i].capture_frame_rate,
192 media::VIDEO_CAPTURE_PIXEL_FORMAT_UYVY)); 194 media::VIDEO_CAPTURE_PIXEL_FORMAT_UYVY));
193 break; 195 break;
194 } 196 }
195 } 197 }
196 } 198 }
197 break; 199 break;
198 case VideoCaptureDevice::Name::DECKLINK: 200 case VideoCaptureDevice::Name::DECKLINK:
199 DVLOG(1) << "Enumerating video capture capabilities " << device.name(); 201 DVLOG(1) << "Enumerating video capture capabilities " << device.name();
200 VideoCaptureDeviceDeckLinkMac::EnumerateDeviceCapabilities( 202 VideoCaptureDeviceDeckLinkMac::EnumerateDeviceCapabilities(
201 device, supported_formats); 203 device, supported_formats);
202 break; 204 break;
203 default: 205 default:
204 NOTREACHED(); 206 NOTREACHED();
205 } 207 }
206 } 208 }
207 209
208 // static 210 // static
209 VideoCaptureDeviceFactory* 211 VideoCaptureDeviceFactory*
210 VideoCaptureDeviceFactory::CreateVideoCaptureDeviceFactory( 212 VideoCaptureDeviceFactory::CreateVideoCaptureDeviceFactory(
211 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) { 213 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) {
212 return new VideoCaptureDeviceFactoryMac(ui_task_runner); 214 return new VideoCaptureDeviceFactoryMac(ui_task_runner);
213 } 215 }
214 216
215 } // namespace media 217 } // namespace media
OLDNEW
« no previous file with comments | « media/filters/source_buffer_stream_unittest.cc ('k') | media/video/capture/video_capture_device.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698