Merge pull request #8271 from ziggy90127:avfoundation-bugfix1

pull/8609/head
Vadim Pisarevsky 8 years ago
commit 05387b3921
  1. 3
      modules/videoio/src/cap_avfoundation.mm
  2. 3
      modules/videoio/src/cap_avfoundation_mac.mm

@ -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];

@ -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");

Loading…
Cancel
Save