Commit 38f68625 authored by Vadim Pisarevsky's avatar Vadim Pisarevsky

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

parent a4f5216d
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment