From 715b5d0c55b2b0ae6c5f1b5927bb18bb2230d73f Mon Sep 17 00:00:00 2001 From: Stefano Fabri Date: Wed, 8 Jun 2011 12:44:01 +0000 Subject: [PATCH] Little fix for multicast (we'll testing in a real multicast environment in the next days) --- modules/highgui/src/cap_pvapi.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/modules/highgui/src/cap_pvapi.cpp b/modules/highgui/src/cap_pvapi.cpp index 7e4bf560a8..2663cd8951 100644 --- a/modules/highgui/src/cap_pvapi.cpp +++ b/modules/highgui/src/cap_pvapi.cpp @@ -58,6 +58,7 @@ #include #include +#include //#include #define MAX_CAMERAS 10 @@ -276,8 +277,12 @@ double CvCaptureCAM_PvAPI::getProperty( int property_id ) PvAttrUint32Get(Camera.Handle, "Height", &nTemp); return (double)nTemp; case CV_CAP_PROP_EXPOSURE: - PvAttrUint32Get(Camera.Handle,"ExposureValue",&nTemp); - return (double)nTemp; + PvAttrUint32Get(Camera.Handle,"ExposureValue",&nTemp); + return (double)nTemp; + case CV_CAP_PROP_FPS: + tPvFloat32 nfTemp; + PvAttrFloat32Get(Camera.Handle, "StatFrameRate", &nfTemp); + return (double)nfTemp; } return -1.0; } @@ -321,13 +326,12 @@ bool CvCaptureCAM_PvAPI::setProperty( int property_id, double value ) return false; } else { - string ip=cv::format("%d.%d.%d.%d", (value>>24)&255, (value>>16)&255, (value>>8)&255, value&255); + std::string ip=cv::format("%d.%d.%d.%d", ((int)value>>24)&255, ((int)value>>16)&255, ((int)value>>8)&255, (int)value&255); if ((PvAttrEnumSet(Camera.Handle,"MulticastEnable", "On")==ePvErrSuccess) && - (PvAttrStringSet(priv->handle, "MulticastIPAddress", ip.c_str())==ePvErrSuccess)) { + (PvAttrStringSet(Camera.Handle, "MulticastIPAddress", ip.c_str())==ePvErrSuccess)) break; else return false; - } } default: return false;