Merge pull request #581 from vpisarev:ios_fix

This commit is contained in:
Andrey Kamaev 2013-02-28 01:58:12 +04:00 committed by OpenCV Buildbot
commit c5e979ceb7
2 changed files with 8 additions and 8 deletions

View File

@ -243,7 +243,7 @@ CvCaptureCAM::CvCaptureCAM(int cameraNum) {
camNum = cameraNum; camNum = cameraNum;
if (!startCaptureDevice(camNum)) { if (!startCaptureDevice(camNum)) {
cout << "Warning, camera failed to properly initialize!" << endl; std::cout << "Warning, camera failed to properly initialize!" << std::endl;
started = 0; started = 0;
} else { } else {
started = 1; started = 1;
@ -288,7 +288,7 @@ IplImage* CvCaptureCAM::retrieveFrame(int) {
IplImage* CvCaptureCAM::queryFrame() { IplImage* CvCaptureCAM::queryFrame() {
while (!grabFrame()) { while (!grabFrame()) {
cout << "WARNING: Couldn't grab new frame from camera!!!" << endl; std::cout << "WARNING: Couldn't grab new frame from camera!!!" << std::endl;
/* /*
cout << "Attempting to restart camera; set capture property DISABLE_AUTO_RESTART to disable." << endl; cout << "Attempting to restart camera; set capture property DISABLE_AUTO_RESTART to disable." << endl;
stopCaptureDevice(); stopCaptureDevice();
@ -320,7 +320,7 @@ int CvCaptureCAM::startCaptureDevice(int cameraNum) {
AVCaptureDevice *device; AVCaptureDevice *device;
NSArray* devices = [AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo]; NSArray* devices = [AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo];
if ([devices count] == 0) { if ([devices count] == 0) {
cout << "AV Foundation didn't find any attached Video Input Devices!" << endl; std::cout << "AV Foundation didn't find any attached Video Input Devices!" << std::endl;
[localpool drain]; [localpool drain];
return 0; return 0;
} }
@ -328,7 +328,7 @@ int CvCaptureCAM::startCaptureDevice(int cameraNum) {
if (cameraNum >= 0) { if (cameraNum >= 0) {
camNum = cameraNum % [devices count]; camNum = cameraNum % [devices count];
if (camNum != cameraNum) { if (camNum != cameraNum) {
cout << "Warning: Max Camera Num is " << [devices count]-1 << "; Using camera " << camNum << endl; std::cout << "Warning: Max Camera Num is " << [devices count]-1 << "; Using camera " << camNum << std::endl;
} }
device = [devices objectAtIndex:camNum]; device = [devices objectAtIndex:camNum];
} else { } else {
@ -1166,8 +1166,8 @@ CvVideoWriter_AVFoundation::CvVideoWriter_AVFoundation(const char* filename, int
cc[4] = 0; cc[4] = 0;
int cc2 = CV_FOURCC(cc[0], cc[1], cc[2], cc[3]); int cc2 = CV_FOURCC(cc[0], cc[1], cc[2], cc[3]);
if (cc2!=fourcc) { if (cc2!=fourcc) {
cout << "WARNING: Didn't properly encode FourCC. Expected " << fourcc std::cout << "WARNING: Didn't properly encode FourCC. Expected " << fourcc
<< " but got " << cc2 << "." << endl; << " but got " << cc2 << "." << std::endl;
//exception; //exception;
} }
@ -1269,7 +1269,7 @@ bool CvVideoWriter_AVFoundation::writeFrame(const IplImage* iplimage) {
BOOL success = FALSE; BOOL success = FALSE;
if (iplimage->height!=movieSize.height || iplimage->width!=movieSize.width){ if (iplimage->height!=movieSize.height || iplimage->width!=movieSize.width){
cout<<"Frame size does not match video size."<<endl; std::cout<<"Frame size does not match video size."<<std::endl;
[localpool drain]; [localpool drain];
return false; return false;
} }

View File

@ -58,7 +58,7 @@ struct Random
}}} }}}
#elif (__GNUC__) && __GNUC__ > 3 && __GNUC_MINOR__ > 1 && !defined(__ANDROID__) #elif (__GNUC__) && __GNUC__ > 3 && __GNUC_MINOR__ > 1 && !defined(__ANDROID__) && !defined(__APPLE__)
# if defined (__cplusplus) && __cplusplus > 201100L # if defined (__cplusplus) && __cplusplus > 201100L
# include <random> # include <random>