int changedPos;
int started;
+ QTTime endOfMovie;
};
return;
}
+ [mCaptureSession gotoEnd];
+ endOfMovie = [mCaptureSession currentTime];
[mCaptureSession gotoBeginning];
bool CvCaptureFile::grabFrame() {
NSAutoreleasePool* localpool = [[NSAutoreleasePool alloc] init];
double t1 = getProperty(CV_CAP_PROP_POS_MSEC);
+
+ QTTime curTime;
+ curTime = [mCaptureSession currentTime];
+ bool isEnd=(QTTimeCompare(curTime,endOfMovie) == NSOrderedSame);
+
[mCaptureSession stepForward];
double t2 = getProperty(CV_CAP_PROP_POS_MSEC);
if (t2>t1 && !changedPos) {
}
changedPos = 0;
[localpool drain];
- return 1;
+ return !isEnd;
}