Commit 05387b39 authored by Vadim Pisarevsky's avatar Vadim Pisarevsky

Merge pull request #8271 from ziggy90127:avfoundation-bugfix1

parents 986d57c7 d69b3e38
...@@ -317,7 +317,8 @@ int CvCaptureCAM::startCaptureDevice(int cameraNum) { ...@@ -317,7 +317,8 @@ int CvCaptureCAM::startCaptureDevice(int cameraNum) {
capture = [[CaptureDelegate alloc] init]; capture = [[CaptureDelegate alloc] init];
AVCaptureDevice *device; AVCaptureDevice *device;
NSArray* devices = [AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo]; NSArray* devices = [[AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo]
arrayByAddingObjectsFromArray:[AVCaptureDevice devicesWithMediaType:AVMediaTypeMuxed]];
if ([devices count] == 0) { if ([devices count] == 0) {
std::cout << "AV Foundation didn't find any attached Video Input Devices!" << std::endl; std::cout << "AV Foundation didn't find any attached Video Input Devices!" << std::endl;
[localpool drain]; [localpool drain];
......
...@@ -305,7 +305,8 @@ int CvCaptureCAM::startCaptureDevice(int cameraNum) { ...@@ -305,7 +305,8 @@ int CvCaptureCAM::startCaptureDevice(int cameraNum) {
NSAutoreleasePool *localpool = [[NSAutoreleasePool alloc] init]; NSAutoreleasePool *localpool = [[NSAutoreleasePool alloc] init];
// get capture device // get capture device
NSArray *devices = [AVCaptureDevice devicesWithMediaType: AVMediaTypeVideo]; NSArray *devices = [[AVCaptureDevice devicesWithMediaType: AVMediaTypeVideo]
arrayByAddingObjectsFromArray:[AVCaptureDevice devicesWithMediaType:AVMediaTypeMuxed]];
if ( devices.count == 0 ) { if ( devices.count == 0 ) {
fprintf(stderr, "OpenCV: AVFoundation didn't find any attached Video Input Devices!\n"); fprintf(stderr, "OpenCV: AVFoundation didn't find any attached Video Input Devices!\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment