--- opencv-svn/modules/highgui/src/cap_qtkit.mm 2011-03-26 09:15:29.000000000 +0100 +++ opencv-patched/modules/highgui/src/cap_qtkit.mm 2011-03-26 09:07:54.000000000 +0100 @@ -250,7 +250,7 @@ camNum = cameraNum; if (!startCaptureDevice(camNum)) { - cout << "Warning, camera failed to properly initialize!" << endl; + cerr << "Warning, camera failed to properly initialize!" << endl; started = 0; } else { started = 1; @@ -261,7 +261,7 @@ CvCaptureCAM::~CvCaptureCAM() { stopCaptureDevice(); - cout << "Cleaned up camera." << endl; + cerr << "Cleaned up camera." << endl; } int CvCaptureCAM::didStart() { @@ -296,9 +296,9 @@ IplImage* CvCaptureCAM::queryFrame() { while (!grabFrame()) { - cout << "WARNING: Couldn't grab new frame from camera!!!" << endl; + cerr << "WARNING: Couldn't grab new frame from camera!!!" << endl; /* - cout << "Attempting to restart camera; set capture property DISABLE_AUTO_RESTART to disable." << endl; + cerr << "Attempting to restart camera; set capture property DISABLE_AUTO_RESTART to disable." << endl; stopCaptureDevice(); startCaptureDevice(camNum); */ @@ -332,7 +332,7 @@ QTCaptureDevice *device; NSArray* devices = [QTCaptureDevice inputDevicesWithMediaType:QTMediaTypeVideo]; if ([devices count] == 0) { - cout << "QTKit didn't find any attached Video Input Devices!" << endl; + cerr << "QTKit didn't find any attached Video Input Devices!" << endl; [localpool drain]; return 0; } @@ -340,7 +340,7 @@ if (cameraNum >= 0) { camNum = cameraNum % [devices count]; if (camNum != cameraNum) { - cout << "Warning: Max Camera Num is " << [devices count]-1 << "; Using camera " << camNum << endl; + cerr << "Warning: Max Camera Num is " << [devices count]-1 << "; Using camera " << camNum << endl; } device = [devices objectAtIndex:camNum] ; } else { @@ -353,7 +353,7 @@ success = [device open:&error]; if (!success) { - cout << "QTKit failed to open a Video Capture Device" << endl; + cerr << "QTKit failed to open a Video Capture Device" << endl; [localpool drain]; return 0; } @@ -364,7 +364,7 @@ success = [mCaptureSession addInput:mCaptureDeviceInput error:&error]; if (!success) { - cout << "QTKit failed to start capture session with opened Capture Device" << endl; + cerr << "QTKit failed to start capture session with opened Capture Device" << endl; [localpool drain]; return 0; } @@ -396,7 +396,7 @@ success = [mCaptureSession addOutput:mCaptureDecompressedVideoOutput error:&error]; if (!success) { - cout << "QTKit failed to add Output to Capture Session" << endl; + cerr << "QTKit failed to add Output to Capture Session" << endl; [localpool drain]; return 0; } @@ -532,7 +532,7 @@ - (void)captureOutput:(QTCaptureOutput *)captureOutput didDropVideoFrameWithSampleBuffer:(QTSampleBuffer *)sampleBuffer fromConnection:(QTCaptureConnection *)connection { - cout << "Camera dropped frame!" << endl; + cerr << "Camera dropped frame!" << endl; } -(IplImage*) getOutput { @@ -641,7 +641,7 @@ forKey:QTMovieLoopsAttribute]; if (mCaptureSession == nil) { - cout << "WARNING: Couldn't read movie file " << filename << endl; + cerr << "WARNING: Couldn't read movie file " << filename << endl; [localpool drain]; started = 0; return; @@ -923,7 +923,7 @@ cc[4] = 0; int cc2 = CV_FOURCC(cc[0], cc[1], cc[2], cc[3]); if (cc2!=fourcc) { - cout << "WARNING: Didn't properly encode FourCC. Expected " << fourcc + cerr << "WARNING: Didn't properly encode FourCC. Expected " << fourcc << " but got " << cc2 << "." << endl; } @@ -935,13 +935,13 @@ NSFileManager* files = [NSFileManager defaultManager]; if ([files fileExistsAtPath:path]) { if (![files removeItemAtPath:path error:nil]) { - cout << "WARNING: Failed to remove existing file " << [path cStringUsingEncoding:NSASCIIStringEncoding] << endl; + cerr << "WARNING: Failed to remove existing file " << [path cStringUsingEncoding:NSASCIIStringEncoding] << endl; } } mMovie = [[QTMovie alloc] initToWritableFile:path error:&error]; if (!mMovie) { - cout << "WARNING: Could not create empty movie file container." << endl; + cerr << "WARNING: Could not create empty movie file container." << endl; [localpool drain]; return; } @@ -1016,7 +1016,7 @@ [NSNumber numberWithInt:100*movieFPS], QTTrackTimeScaleAttribute,nil]]; if (![mMovie updateMovieFile]) { - cout << "Didn't successfully update movie file." << endl; + cerr << "Didn't successfully update movie file." << endl; } [imageRep release];