1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 07:43:03 +04:00

Merge pull request #8271 from ziggy90127:avfoundation-bugfix1

This commit is contained in:
Vadim Pisarevsky
2017-05-03 12:59:44 +00:00
2 changed files with 4 additions and 2 deletions
+2 -1
View File
@@ -317,7 +317,8 @@ int CvCaptureCAM::startCaptureDevice(int cameraNum) {
capture = [[CaptureDelegate alloc] init];
AVCaptureDevice *device;
NSArray* devices = [AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo];
NSArray* devices = [[AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo]
arrayByAddingObjectsFromArray:[AVCaptureDevice devicesWithMediaType:AVMediaTypeMuxed]];
if ([devices count] == 0) {
std::cout << "AV Foundation didn't find any attached Video Input Devices!" << std::endl;
[localpool drain];
+2 -1
View File
@@ -305,7 +305,8 @@ int CvCaptureCAM::startCaptureDevice(int cameraNum) {
NSAutoreleasePool *localpool = [[NSAutoreleasePool alloc] init];
// get capture device
NSArray *devices = [AVCaptureDevice devicesWithMediaType: AVMediaTypeVideo];
NSArray *devices = [[AVCaptureDevice devicesWithMediaType: AVMediaTypeVideo]
arrayByAddingObjectsFromArray:[AVCaptureDevice devicesWithMediaType:AVMediaTypeMuxed]];
if ( devices.count == 0 ) {
fprintf(stderr, "OpenCV: AVFoundation didn't find any attached Video Input Devices!\n");