Commit a419ecfd authored by Stefano Fabri's avatar Stefano Fabri

Return false if cannot adapt packed size with mtu max of network adapter

parent 686737e2
...@@ -186,7 +186,8 @@ bool CvCaptureCAM_PvAPI::open( int index ) ...@@ -186,7 +186,8 @@ bool CvCaptureCAM_PvAPI::open( int index )
//PvAttrEnumGet(Camera.Handle, "pixelFormat", pixelFormat,256,NULL); //PvAttrEnumGet(Camera.Handle, "pixelFormat", pixelFormat,256,NULL);
maxSize = 8228; maxSize = 8228;
PvAttrUint32Get(Camera.Handle,"PacketSize",&maxSize); PvAttrUint32Get(Camera.Handle,"PacketSize",&maxSize);
PvCaptureAdjustPacketSize(Camera.Handle,maxSize); if (PvCaptureAdjustPacketSize(Camera.Handle,maxSize)!=ePvErrSuccess)
return false;
//printf ("Pixel Format %s %d %d\n ", pixelFormat,frameWidth,frameHeight); //printf ("Pixel Format %s %d %d\n ", pixelFormat,frameWidth,frameHeight);
if (strncmp(pixelFormat, "Mono8",NULL)==0) { if (strncmp(pixelFormat, "Mono8",NULL)==0) {
grayframe = cvCreateImage(cvSize((int)frameWidth, (int)frameHeight), IPL_DEPTH_8U, 1); grayframe = cvCreateImage(cvSize((int)frameWidth, (int)frameHeight), IPL_DEPTH_8U, 1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment