kopia lustrzana https://gitlab.com/sane-project/backends
Added option for disabling double-buffering. Updated man page. New version:
1.0-108. Henning Meier-Geinitz <henning@meier-geinitz.de>DEVEL_2_0_BRANCH-1
rodzic
2cc5b5d2db
commit
0e7b9ed8dc
|
@ -46,7 +46,7 @@
|
|||
|
||||
/**************************************************************************/
|
||||
/* Mustek backend version */
|
||||
#define BUILD 107
|
||||
#define BUILD 108
|
||||
/**************************************************************************/
|
||||
|
||||
#include "../include/sane/config.h"
|
||||
|
@ -95,6 +95,9 @@ static double strip_height;
|
|||
/* Should we wait for the scan slider to return after each scan? */
|
||||
static SANE_Bool force_wait;
|
||||
|
||||
/* Should we disable double buffering when reading data from the scanner? */
|
||||
static SANE_Bool disable_double_buffering;
|
||||
|
||||
static SANE_Int num_devices;
|
||||
static Mustek_Device *first_dev;
|
||||
static Mustek_Scanner *first_handle;
|
||||
|
@ -404,7 +407,7 @@ scsi_inquiry_wait_ready (Mustek_Scanner *s)
|
|||
{
|
||||
DBG(5, "scsi_inquiry_wait_ready: sending INQUIRY\n");
|
||||
status = inquiry (s);
|
||||
DBG(5, "scsi_inquiry_ready: INQUIRY finished\n");
|
||||
DBG(5, "scsi_inquiry_wait_ready: INQUIRY finished\n");
|
||||
switch (status)
|
||||
{
|
||||
default:
|
||||
|
@ -4536,6 +4539,10 @@ reader_process (Mustek_Scanner *s, SANE_Int fd)
|
|||
SANE_Bool finished; /* block is finished */
|
||||
} bstat [2];
|
||||
|
||||
if (disable_double_buffering)
|
||||
DBG(3, "reader_process: disable_double_buffering is set, this may be "
|
||||
"slow.\n");
|
||||
|
||||
sigemptyset (&sigterm_set);
|
||||
sigaddset (&sigterm_set, SIGTERM);
|
||||
|
||||
|
@ -4681,6 +4688,15 @@ reader_process (Mustek_Scanner *s, SANE_Int fd)
|
|||
if (bstat[buffernumber].finished)
|
||||
break; /* everything written; exit loop */
|
||||
}
|
||||
if (disable_double_buffering)
|
||||
{
|
||||
/* Enter only one buffer at once */
|
||||
if (buffernumber == 1)
|
||||
buffernumber = 0;
|
||||
else
|
||||
buffernumber = 1;
|
||||
}
|
||||
|
||||
/* enter read requests only if data left */
|
||||
if ((s->line < s->hw->lines) && (buffer_count < max_buffers))
|
||||
{
|
||||
|
@ -4732,12 +4748,13 @@ reader_process (Mustek_Scanner *s, SANE_Int fd)
|
|||
return status;
|
||||
}
|
||||
}
|
||||
|
||||
if (!disable_double_buffering)
|
||||
{
|
||||
if (buffernumber == 1)
|
||||
buffernumber = 0;
|
||||
else
|
||||
buffernumber = 1;
|
||||
|
||||
}
|
||||
/* This is said to fix the scanner hangs that reportedly show on
|
||||
some MFS-12000SP scanners. */
|
||||
if (s->mode == 0 && (s->hw->flags & MUSTEK_FLAG_LINEART_FIX))
|
||||
|
@ -4819,6 +4836,7 @@ sane_init (SANE_Int *version_code, SANE_Auth_Callback authorize)
|
|||
|
||||
num_devices = 0;
|
||||
force_wait = SANE_FALSE;
|
||||
disable_double_buffering = SANE_FALSE;
|
||||
|
||||
fp = sanei_config_open (MUSTEK_CONFIG_FILE);
|
||||
if (!fp)
|
||||
|
@ -4899,6 +4917,15 @@ sane_init (SANE_Int *version_code, SANE_Auth_Callback authorize)
|
|||
free (word);
|
||||
word = 0;
|
||||
}
|
||||
else if (strcmp (word, "disable-double-buffering") == 0)
|
||||
{
|
||||
DBG(3, "sane_init: config file line %d: disabling "
|
||||
"double-buffering\n", linenumber);
|
||||
disable_double_buffering = SANE_TRUE;
|
||||
if (word)
|
||||
free (word);
|
||||
word = 0;
|
||||
}
|
||||
else if (strcmp (word, "legal-size") == 0)
|
||||
{
|
||||
if (new_dev_len > 0)
|
||||
|
|
|
@ -1,5 +1,14 @@
|
|||
CHANGES for the SANE Mustek backend
|
||||
|
||||
2001-07-07
|
||||
* Released Mustek backend 1.0-108.
|
||||
|
||||
2001-07-07
|
||||
* added option to disable double-buffering
|
||||
* don't set any options by default in mustek.conf
|
||||
* updated manpage
|
||||
* fixed debug statement in scsi_inquiry_wait_ready
|
||||
|
||||
2001-05-06
|
||||
* Fixed memory leak in sane_get_devices ()
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue