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

Side by Side Diff: talk/media/devices/win32devicemanager.cc

Issue 1405023016: Convert usage of ARRAY_SIZE to arraysize. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: static_cast<int> Created 5 years, 1 month 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 | « talk/media/devices/devicemanager_unittest.cc ('k') | talk/media/sctp/sctpdataengine.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * libjingle 2 * libjingle
3 * Copyright 2004 Google Inc. 3 * Copyright 2004 Google Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met: 6 * modification, are permitted provided that the following conditions are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright notice, 8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer. 9 * this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice, 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
(...skipping 30 matching lines...) Expand all
41 // to define INITGUID in order to define all the uuids in this object file 41 // to define INITGUID in order to define all the uuids in this object file
42 // as it will conflict with uuid.lib (multiply defined symbols). 42 // as it will conflict with uuid.lib (multiply defined symbols).
43 // So our workaround is to define this one missing symbol here manually. 43 // So our workaround is to define this one missing symbol here manually.
44 // See: https://code.google.com/p/webrtc/issues/detail?id=3996 44 // See: https://code.google.com/p/webrtc/issues/detail?id=3996
45 EXTERN_C const PROPERTYKEY PKEY_AudioEndpoint_GUID = { { 45 EXTERN_C const PROPERTYKEY PKEY_AudioEndpoint_GUID = { {
46 0x1da5d803, 0xd492, 0x4edd, { 46 0x1da5d803, 0xd492, 0x4edd, {
47 0x8c, 0x23, 0xe0, 0xc0, 0xff, 0xee, 0x7f, 0x0e 47 0x8c, 0x23, 0xe0, 0xc0, 0xff, 0xee, 0x7f, 0x0e
48 } }, 4 48 } }, 4
49 }; 49 };
50 50
51 #include "webrtc/base/arraysize.h"
51 #include "webrtc/base/logging.h" 52 #include "webrtc/base/logging.h"
52 #include "webrtc/base/stringutils.h" 53 #include "webrtc/base/stringutils.h"
53 #include "webrtc/base/thread.h" 54 #include "webrtc/base/thread.h"
54 #include "webrtc/base/win32.h" // ToUtf8 55 #include "webrtc/base/win32.h" // ToUtf8
55 #include "webrtc/base/win32window.h" 56 #include "webrtc/base/win32window.h"
56 #include "talk/media/base/mediacommon.h" 57 #include "talk/media/base/mediacommon.h"
57 #ifdef HAVE_LOGITECH_HEADERS 58 #ifdef HAVE_LOGITECH_HEADERS
58 #include "third_party/logitech/files/logitechquickcam.h" 59 #include "third_party/logitech/files/logitechquickcam.h"
59 #endif 60 #endif
60 61
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 bool Win32DeviceManager::GetDefaultVideoCaptureDevice(Device* device) { 142 bool Win32DeviceManager::GetDefaultVideoCaptureDevice(Device* device) {
142 bool ret = false; 143 bool ret = false;
143 // If there are multiple capture devices, we want the first USB one. 144 // If there are multiple capture devices, we want the first USB one.
144 // This avoids issues with defaulting to virtual cameras or grabber cards. 145 // This avoids issues with defaulting to virtual cameras or grabber cards.
145 std::vector<Device> devices; 146 std::vector<Device> devices;
146 ret = (GetVideoCaptureDevices(&devices) && !devices.empty()); 147 ret = (GetVideoCaptureDevices(&devices) && !devices.empty());
147 if (ret) { 148 if (ret) {
148 *device = devices[0]; 149 *device = devices[0];
149 for (size_t i = 0; i < devices.size(); ++i) { 150 for (size_t i = 0; i < devices.size(); ++i) {
150 if (strnicmp(devices[i].id.c_str(), kUsbDevicePathPrefix, 151 if (strnicmp(devices[i].id.c_str(), kUsbDevicePathPrefix,
151 ARRAY_SIZE(kUsbDevicePathPrefix) - 1) == 0) { 152 arraysize(kUsbDevicePathPrefix) - 1) == 0) {
152 *device = devices[i]; 153 *device = devices[i];
153 break; 154 break;
154 } 155 }
155 } 156 }
156 } 157 }
157 return ret; 158 return ret;
158 } 159 }
159 160
160 bool Win32DeviceManager::GetAudioDevices(bool input, 161 bool Win32DeviceManager::GetAudioDevices(bool input,
161 std::vector<Device>* devs) { 162 std::vector<Device>* devs) {
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 } 406 }
406 } 407 }
407 result = 0; 408 result = 0;
408 return true; 409 return true;
409 } 410 }
410 411
411 return false; 412 return false;
412 } 413 }
413 414
414 }; // namespace cricket 415 }; // namespace cricket
OLDNEW
« no previous file with comments | « talk/media/devices/devicemanager_unittest.cc ('k') | talk/media/sctp/sctpdataengine.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698