From 2b8229f716f77853160fa6e8cd4be28aa3595b90 Mon Sep 17 00:00:00 2001 From: StevenPuttemans Date: Wed, 12 Nov 2014 10:48:24 +0100 Subject: [PATCH] adding extra buffer parameter --- modules/highgui/include/opencv2/highgui/highgui_c.h | 1 + modules/highgui/src/cap_dc1394_v2.cpp | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/modules/highgui/include/opencv2/highgui/highgui_c.h b/modules/highgui/include/opencv2/highgui/highgui_c.h index 1f86abb9d..71b28d1df 100644 --- a/modules/highgui/include/opencv2/highgui/highgui_c.h +++ b/modules/highgui/include/opencv2/highgui/highgui_c.h @@ -385,6 +385,7 @@ enum CV_CAP_PROP_ROLL =35, CV_CAP_PROP_IRIS =36, CV_CAP_PROP_SETTINGS =37, + CV_CAP_PROP_BUFFERSIZE =38, CV_CAP_PROP_AUTOGRAB =1024, // property for highgui class CvCapture_Android only CV_CAP_PROP_SUPPORTED_PREVIEW_SIZES_STRING=1025, // readonly, tricky property, returns cpnst char* indeed diff --git a/modules/highgui/src/cap_dc1394_v2.cpp b/modules/highgui/src/cap_dc1394_v2.cpp index 0d5f89818..86a77c1ab 100644 --- a/modules/highgui/src/cap_dc1394_v2.cpp +++ b/modules/highgui/src/cap_dc1394_v2.cpp @@ -278,6 +278,7 @@ CvCaptureCAM_DC1394_v2_CPP::CvCaptureCAM_DC1394_v2_CPP() dcCam = 0; isoSpeed = 400; fps = 15; + // Resetted the value here to 1 in order to ensure only a single frame is stored in the buffer! nDMABufs = 8; started = false; cameraId = 0; @@ -732,6 +733,11 @@ bool CvCaptureCAM_DC1394_v2_CPP::setProperty(int propId, double value) return false; isoSpeed = cvRound(value); break; + case CV_CAP_PROP_BUFFERSIZE: + if(started) + return false; + nDMABufs = value; + break; //The code below is based on coriander, callbacks.c:795, refer to case RANGE_MENU_MAN : default: if (propId