@@ -88,7 +88,10 @@ of this software and associated documentation files (the "Software"), to deal
88
88
LOG (LOG_DEBUG, " enumerateDevices called\n " );
89
89
90
90
m_devices.clear ();
91
- for (AVCaptureDevice* device in [AVCaptureDevice devicesWithMediaType: AVMediaTypeVideo])
91
+ AVCaptureDeviceDiscoverySession *captureDeviceDiscoverySession = [AVCaptureDeviceDiscoverySession discoverySessionWithDeviceTypes: @[AVCaptureDeviceTypeBuiltInWideAngleCamera,AVCaptureDeviceTypeExternalUnknown]
92
+ mediaType: AVMediaTypeVideo
93
+ position: AVCaptureDevicePositionUnspecified];
94
+ for (AVCaptureDevice* device in [captureDeviceDiscoverySession devices ])
92
95
{
93
96
platformDeviceInfo* deviceInfo = new platformDeviceInfo ();
94
97
deviceInfo->m_captureDevice = CFBridgingRetain (device);
@@ -104,7 +107,7 @@ of this software and associated documentation files (the "Software"), to deal
104
107
NSRange vidRange = [device.modelID rangeOfString: @" VendorID_" ];
105
108
if (vidRange.length > 0 )
106
109
{
107
- uint32_t maxLen = device.modelID .length - vidRange.location - 9 ;
110
+ unsigned long maxLen = device.modelID .length - vidRange.location - 9 ;
108
111
maxLen = (maxLen > 5 ) ? 5 : maxLen;
109
112
deviceInfo->m_vid = [[device.modelID substringWithRange: NSMakeRange (vidRange.location + 9 , maxLen)] intValue ];
110
113
}
@@ -117,7 +120,7 @@ of this software and associated documentation files (the "Software"), to deal
117
120
NSRange pidRange = [device.modelID rangeOfString: @" ProductID_" ];
118
121
if (pidRange.length > 0 )
119
122
{
120
- uint32_t maxLen = device.modelID .length - pidRange.location - 10 ;
123
+ unsigned long maxLen = device.modelID .length - pidRange.location - 10 ;
121
124
maxLen = (maxLen > 5 ) ? 5 : maxLen;
122
125
deviceInfo->m_pid = [[device.modelID substringWithRange: NSMakeRange (pidRange.location + 10 , maxLen)] intValue ];
123
126
}
0 commit comments