added video stream positioning in QTKit-based VideoCapture backend (patch #1420)

This commit is contained in:
Vadim Pisarevsky 2012-03-30 14:13:21 +00:00
parent a4f5216d52
commit 38f686252c

View File

@ -864,6 +864,17 @@ bool CvCaptureFile::setProperty(int property_id, double value) {
case CV_CAP_PROP_FPS:
//etval = currentFPS;
break;
case CV_CAP_PROP_FRAME_COUNT:
{
NSArray *videoTracks = [mCaptureSession tracksOfMediaType:QTMediaTypeVideo];
if ([videoTracks count] > 0) {
QTMedia *media = [[videoTracks objectAtIndex:0] media];
retval = [[media attributeForKey:QTMediaSampleCountAttribute] longValue];
} else {
retval = 0;
}
}
break;
case CV_CAP_PROP_FOURCC:
default:
retval = false;