From 38f686252c9e01374603a96d0dc6210202a40c4e Mon Sep 17 00:00:00 2001 From: Vadim Pisarevsky Date: Fri, 30 Mar 2012 14:13:21 +0000 Subject: [PATCH] added video stream positioning in QTKit-based VideoCapture backend (patch #1420) --- modules/highgui/src/cap_qtkit.mm | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/modules/highgui/src/cap_qtkit.mm b/modules/highgui/src/cap_qtkit.mm index 3cbcb751f2..6efe4bd21a 100644 --- a/modules/highgui/src/cap_qtkit.mm +++ b/modules/highgui/src/cap_qtkit.mm @@ -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;