1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-31 08:13:04 +04:00

Merged the trunk r8542:8544

This commit is contained in:
Andrey Kamaev
2012-06-01 10:59:27 +00:00
parent 8159ea3386
commit 059b79f7c2
6 changed files with 24 additions and 11 deletions
+4 -7
View File
@@ -494,19 +494,16 @@ bool VideoCapture::retrieve(Mat& image, int channel)
bool VideoCapture::read(Mat& image)
{
if(!grab())
image.release();
else
if(grab())
retrieve(image);
else
image.release();
return !image.empty();
}
VideoCapture& VideoCapture::operator >> (Mat& image)
{
if(!grab())
image.release();
else
retrieve(image);
read(image);
return *this;
}
+4
View File
@@ -438,6 +438,10 @@ bool CvCapture_FFMPEG::grabFrame()
const int max_number_of_attempts = 1 << 16;
if( !ic || !video_st ) return false;
if( ic->streams[video_stream]->nb_frames > 0 &&
frame_number > ic->streams[video_stream]->nb_frames )
return false;
av_free_packet (&packet);
+3 -1
View File
@@ -316,7 +316,9 @@ int CvCaptureCAM::startCaptureDevice(int cameraNum) {
capture = [[CaptureDelegate alloc] init];
QTCaptureDevice *device;
NSArray* devices = [QTCaptureDevice inputDevicesWithMediaType:QTMediaTypeVideo];
NSArray* devices = [[[QTCaptureDevice inputDevicesWithMediaType:QTMediaTypeVideo]
arrayByAddingObjectsFromArray:[QTCaptureDevice inputDevicesWithMediaType:QTMediaTypeMuxed]] retain];
if ([devices count] == 0) {
cout << "QTKit didn't find any attached Video Input Devices!" << endl;
[localpool drain];