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

pull/13383/head
Vadim Pisarevsky 13 years ago
parent a4f5216d52
commit 38f686252c
  1. 11
      modules/highgui/src/cap_qtkit.mm

@ -864,6 +864,17 @@ bool CvCaptureFile::setProperty(int property_id, double value) {
case CV_CAP_PROP_FPS: case CV_CAP_PROP_FPS:
//etval = currentFPS; //etval = currentFPS;
break; 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: case CV_CAP_PROP_FOURCC:
default: default:
retval = false; retval = false;

Loading…
Cancel
Save