Update of /cvsroot/robotflow/RobotFlow/Devices/include
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23617/include
Modified Files:
V4L2Capture.h
Log Message:
fixed segfault, default to RGB24
Index: V4L2Capture.h
===================================================================
RCS file: /cvsroot/robotflow/RobotFlow/Devices/include/V4L2Capture.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** V4L2Capture.h 19 Oct 2005 20:54:33 -0000 1.11
--- V4L2Capture.h 19 Oct 2005 20:57:06 -0000 1.12
***************
*** 33,37 ****
#define DEFAULT_WIDTH 320
#define DEFAULT_HEIGHT 240
! #define DEFAULT_FORMAT V4L2_PIX_FMT_RGB24
class capture {
--- 33,37 ----
#define DEFAULT_WIDTH 320
#define DEFAULT_HEIGHT 240
! #define DEFAULT_FORMAT V4L2_PIX_FMT_RGB555
class capture {
***************
*** 103,110 ****
//allocate image
! Image *image = Image::alloc(DEFAULT_WIDTH,DEFAULT_HEIGHT,3);
//copy image
! memcpy(image->get_data(),p, DEFAULT_WIDTH * DEFAULT_HEIGHT * 3);
m_image = FD::ObjectRef(image);
--- 103,110 ----
//allocate image
! Image *image = Image::alloc(DEFAULT_WIDTH,DEFAULT_HEIGHT,2);
//copy image
! memcpy(image->get_data(),p, DEFAULT_WIDTH * DEFAULT_HEIGHT * 2);
m_image = FD::ObjectRef(image);
***************
*** 536,540 ****
/* Buggy driver paranoia. */
! min = fmt.fmt.pix.width * 3;
if (fmt.fmt.pix.bytesperline < min)
fmt.fmt.pix.bytesperline = min;
--- 536,540 ----
/* Buggy driver paranoia. */
! min = fmt.fmt.pix.width * 2;
if (fmt.fmt.pix.bytesperline < min)
fmt.fmt.pix.bytesperline = min;
|