@ -35,6 +35,8 @@
@@ -35,6 +35,8 @@
# define SAVE_AS_CUMUL 1
# define SAVE_AS_FIMG 0
# define NBR_BUFFERS 4
/* --------------------------------------------------------------------- */
# define CLEAR(x) memset(&(x), 0, sizeof(x))
@ -192,7 +194,7 @@ if ((fmt.fmt.pix.width != width) || (fmt.fmt.pix.height != height)) {
@@ -192,7 +194,7 @@ if ((fmt.fmt.pix.width != width) || (fmt.fmt.pix.height != height)) {
fprintf ( stderr , " --- Ok 1 \n " ) ;
CLEAR ( req ) ;
req . count = 2 ;
req . count = NBR_BUFFERS ;
req . type = V4L2_BUF_TYPE_VIDEO_CAPTURE ;
req . memory = V4L2_MEMORY_MMAP ;
xioctl ( fd , VIDIOC_REQBUFS , & req ) ;
@ -220,7 +222,7 @@ for (n_buffers = 0; n_buffers < req.count; ++n_buffers) {
@@ -220,7 +222,7 @@ for (n_buffers = 0; n_buffers < req.count; ++n_buffers) {
( void ) fimg_timer_set ( 0 ) ;
for ( i = 0 ; i < n_buffers ; + + i ) {
for ( i = 0 ; i < NBR_BUFFERS ; + + i ) {
CLEAR ( buf ) ;
buf . type = V4L2_BUF_TYPE_VIDEO_CAPTURE ;
buf . memory = V4L2_MEMORY_MMAP ;
@ -286,7 +288,10 @@ for (i = 0; i < nbre_capt; i++) {
@@ -286,7 +288,10 @@ for (i = 0; i < nbre_capt; i++) {
buf . memory = V4L2_MEMORY_MMAP ;
xioctl ( fd , VIDIOC_DQBUF , & buf ) ;
fprintf ( stderr , " xioctl VIDIOC_DQBUF done \n " ) ; fflush ( stderr ) ;
if ( verbosity > 2 ) {
fprintf ( stderr , " xioctl VIDIOC_DQBUF done \n " ) ;
fflush ( stderr ) ;
}
# if SAVE_AS_CUMUL
if ( upscaling ) {
@ -403,7 +408,7 @@ fimg_destroy(&cumul);
@@ -403,7 +408,7 @@ fimg_destroy(&cumul);
type = V4L2_BUF_TYPE_VIDEO_CAPTURE ;
xioctl ( fd , VIDIOC_STREAMOFF , & type ) ;
for ( i = 0 ; i < n_buffers ; + + i ) {
for ( i = 0 ; i < NBR_BUFFERS ; + + i ) {
v4l2_munmap ( buffers [ i ] . start , buffers [ i ] . length ) ;
}