added CV_CAP_PROP_PVAPI_MULTICASTIP property (thanks to Stefano Fabri for the patch)

pull/13383/head
Vadim Pisarevsky 14 years ago
parent fcd2a0c3d3
commit a87d12eb9e
  1. 3
      modules/highgui/include/opencv2/highgui/highgui_c.h
  2. 19
      modules/highgui/src/cap_pvapi.cpp

@ -365,7 +365,8 @@ enum
CV_CAP_OPENNI_DEPTH_GENERATOR_FOCAL_LENGTH = CV_CAP_OPENNI_DEPTH_GENERATOR + CV_CAP_PROP_OPENNI_FOCAL_LENGTH, CV_CAP_OPENNI_DEPTH_GENERATOR_FOCAL_LENGTH = CV_CAP_OPENNI_DEPTH_GENERATOR + CV_CAP_PROP_OPENNI_FOCAL_LENGTH,
// Properties of cameras available through GStreamer interface // Properties of cameras available through GStreamer interface
CV_CAP_GSTREAMER_QUEUE_LENGTH = 200 // default is 1 CV_CAP_GSTREAMER_QUEUE_LENGTH = 200, // default is 1
CV_CAP_PROP_PVAPI_MULTICASTIP = 300 // ip for anable multicast master mode. 0 for disable multicast
}; };
enum enum

@ -308,10 +308,27 @@ bool CvCaptureCAM_PvAPI::setProperty( int property_id, double value )
monocrome=false; monocrome=false;
break; break;
case CV_CAP_PROP_EXPOSURE: case CV_CAP_PROP_EXPOSURE:
if (PvAttrUint32Set(Camera.Handle,"ExposureValue",(tPvUint32)value)==ePvErrSuccess) if ((PvAttrUint32Set(Camera.Handle,"ExposureValue",(tPvUint32)value)==ePvErrSuccess))
break; break;
else else
return false; return false;
case CV_CAP_PROP_PVAPI_MULTICASTIP:
if (value==-1) {
if ((PvAttrEnumSet(Camera.Handle,"MulticastEnable", "Off")==ePvErrSuccess))
break;
else
return false;
}
else {
string ip=cv::format("%d.%d.%d.%d", (value>>24)&255, (value>>16)&255, (value>>8)&255, value&255);
if ((PvAttrEnumSet(Camera.Handle,"MulticastEnable", "On")==ePvErrSuccess) &&
(PvAttrStringSet(priv->handle, "MulticastIPAddress", ip.c_str())==ePvErrSuccess)) {
break;
else
return false;
}
}
default: default:
return false; return false;
} }

Loading…
Cancel
Save