removed confusing CvCapture::queryFrame(); rewritten cvQueryFrame() (ticket #235)
This commit is contained in:
parent
534ac83b8d
commit
24dcfa1a4f
@ -73,7 +73,11 @@ CV_IMPL void cvReleaseCapture( CvCapture** pcapture )
|
||||
|
||||
CV_IMPL IplImage* cvQueryFrame( CvCapture* capture )
|
||||
{
|
||||
return capture ? capture->queryFrame() : 0;
|
||||
if(!capture)
|
||||
return 0;
|
||||
if(!capture->grabFrame())
|
||||
return 0;
|
||||
return capture->retrieveFrame(0);
|
||||
}
|
||||
|
||||
|
||||
|
@ -99,7 +99,6 @@ public:
|
||||
~CvCaptureCAM();
|
||||
virtual bool grabFrame();
|
||||
virtual IplImage* retrieveFrame(int);
|
||||
virtual IplImage* queryFrame();
|
||||
virtual double getProperty(int property_id);
|
||||
virtual bool setProperty(int property_id, double value);
|
||||
virtual int didStart();
|
||||
@ -142,7 +141,6 @@ public:
|
||||
~CvCaptureFile();
|
||||
virtual bool grabFrame();
|
||||
virtual IplImage* retrieveFrame(int);
|
||||
virtual IplImage* queryFrame();
|
||||
virtual double getProperty(int property_id);
|
||||
virtual bool setProperty(int property_id, double value);
|
||||
virtual int didStart();
|
||||
@ -294,18 +292,6 @@ IplImage* CvCaptureCAM::retrieveFrame(int) {
|
||||
return [capture getOutput];
|
||||
}
|
||||
|
||||
IplImage* CvCaptureCAM::queryFrame() {
|
||||
while (!grabFrame()) {
|
||||
cout << "WARNING: Couldn't grab new frame from camera!!!" << endl;
|
||||
/*
|
||||
cout << "Attempting to restart camera; set capture property DISABLE_AUTO_RESTART to disable." << endl;
|
||||
stopCaptureDevice();
|
||||
startCaptureDevice(camNum);
|
||||
*/
|
||||
}
|
||||
return retrieveFrame(0);
|
||||
}
|
||||
|
||||
void CvCaptureCAM::stopCaptureDevice() {
|
||||
NSAutoreleasePool* localpool = [[NSAutoreleasePool alloc] init];
|
||||
|
||||
@ -781,11 +767,6 @@ IplImage* CvCaptureFile::retrieveFrame(int) {
|
||||
return retrieveFramePixelBuffer();
|
||||
}
|
||||
|
||||
IplImage* CvCaptureFile::queryFrame() {
|
||||
grabFrame();
|
||||
return retrieveFrame(0);
|
||||
}
|
||||
|
||||
double CvCaptureFile::getFPS() {
|
||||
if (mCaptureSession == nil) return 0;
|
||||
NSAutoreleasePool* localpool = [[NSAutoreleasePool alloc] init];
|
||||
|
@ -98,7 +98,6 @@ struct CvCapture
|
||||
virtual bool setProperty(int, double) { return 0; }
|
||||
virtual bool grabFrame() { return true; }
|
||||
virtual IplImage* retrieveFrame(int) { return 0; }
|
||||
virtual IplImage* queryFrame() { return grabFrame() ? retrieveFrame(0) : 0; }
|
||||
virtual int getCaptureDomain() { return CV_CAP_ANY; } // Return the type of the capture object: CV_CAP_VFW, etc...
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user