sane-project-website/old-archive/2000-02/0226.html

126 wiersze
5.6 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>
<TITLE>sane-devel: Re: backend fork/reader-process &lt;-&gt; sane_read</TITLE>
<META NAME="Author" CONTENT="Chris Pinkham (cpinkham@infi.net)">
<META NAME="Subject" CONTENT="Re: backend fork/reader-process &lt;-&gt; sane_read">
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H1>Re: backend fork/reader-process &lt;-&gt; sane_read</H1>
<!-- received="Sat Feb 19 10:10:51 2000" -->
<!-- isoreceived="20000219181051" -->
<!-- sent="Sat, 19 Feb 2000 13:09:56 -0500 (EST)" -->
<!-- isosent="20000219180956" -->
<!-- name="Chris Pinkham" -->
<!-- email="cpinkham@infi.net" -->
<!-- subject="Re: backend fork/reader-process &lt;-&gt; sane_read" -->
<!-- id="200002191809.NAA07412@panther.panther.net" -->
<!-- inreplyto="38AED3DE.7A67A25D@wolfsburg.de" -->
<STRONG>From:</STRONG> Chris Pinkham (<A HREF="mailto:cpinkham@infi.net?Subject=Re:%20backend%20fork/reader-process%20&lt;-&gt;%20sane_read&In-Reply-To=&lt;200002191809.NAA07412@panther.panther.net&gt;"><EM>cpinkham@infi.net</EM></A>)<BR>
<STRONG>Date:</STRONG> Sat Feb 19 2000 - 10:09:56 PST
<P>
<!-- next="start" -->
<LI><STRONG>Next message:</STRONG> <A HREF="0227.html">Oliver Rauch: "xsane-0.56 and 16 bit preview"</A>
<UL>
<LI><STRONG>Previous message:</STRONG> <A HREF="0225.html">Oliver Rauch: "Re: Xsane-0.55: scan resolution selection (Epson 1200S, CVS Sane)"</A>
<LI><STRONG>In reply to:</STRONG> <A HREF="0223.html">Oliver Rauch: "backend fork/reader-process &lt;-&gt; sane_read"</A>
<!-- nextthread="start" -->
<LI><STRONG>Next in thread:</STRONG> <A HREF="0252.html">Yuri Dario: "Re: backend fork/reader-process &lt;-&gt; sane_read"</A>
<!-- reply="end" -->
<LI><STRONG>Messages sorted by:</STRONG>
<A HREF="date.html#226">[ date ]</A>
<A HREF="index.html#226">[ thread ]</A>
<A HREF="subject.html#226">[ subject ]</A>
<A HREF="author.html#226">[ author ]</A>
</UL>
<HR NOSHADE><P>
<!-- body="start" -->
<P>
<EM>&gt; b) there is no own reader process, the backend itself calls sanei_scsi_read()
</EM><BR>
<P><EM>&gt; All this could be hidden in a sanei_ routine so the backend does not see
</EM><BR>
<EM>&gt; anything about that. So a backend would not call sanei_scsi_read(),
</EM><BR>
<EM>&gt; instead it would call sanei_scsi_read_buffered().
</EM><BR>
<P>This is sort of what I did in my Artec backend. I have a sane_read() function
<BR>
and an artec_sane_read() function. sane_read has a buffer. When sane_read
<BR>
is called, if the buffer is empty, then artec_sane_read is called to read
<BR>
data from the scanner, up to the maximum size of the buffer. If there is
<BR>
data already in the buffer, then that data is returned up to the maximum
<BR>
amount requested. I wrote this &quot;wrapper&quot; sane_read function when I was
<BR>
informed that my backend didn't work over the net. It could really be
<BR>
used for any backend by renaming sane_read to sane_read_buffered and
<BR>
changing the function's internal calls from artec_sane_read() to just
<BR>
plain sane_read(). A few other things such as max read size from the
<BR>
scanner might have to be changed, but the individual sane_read() functions
<BR>
in each backend should handle that as they do now. The wrapper function
<BR>
could also be changed to increase the size of the buffer (I think I use
<BR>
only about 32K or 64K right now). If this buffer were bigger, then
<BR>
the backend's sane_read() function could be called multiple times in a row
<BR>
in order to fill up the buffer. This might cause jerkiness in data being
<BR>
returned to the application, but it would probably eliminate some of the
<BR>
backtracing of the scan head.
<BR>
<P>Chris
<BR>
<P>*****************************************************************************
<BR>
** Chris Pinkham Linux v2.2.6, Sane v1.0.1, Cajun v3.0-8 **
<BR>
** <A HREF="mailto:cpinkham@infi.net?Subject=Re:%20backend%20fork/reader-process%20&lt;-&gt;%20sane_read&In-Reply-To=&lt;200002191809.NAA07412@panther.panther.net&gt;">cpinkham@infi.net</A> <A HREF="http://www4.infi.net/~cpinkham/">http://www4.infi.net/~cpinkham/</A> **
<BR>
*****************************************************************************
<BR>
<P><PRE>
--
Source code, list archive, and docs: <A HREF="http://www.mostang.com/sane/">http://www.mostang.com/sane/</A>
To unsubscribe: echo unsubscribe sane-devel | mail <A HREF="mailto:majordomo@mostang.com?Subject=Re:%20backend%20fork/reader-process%20&lt;-&gt;%20sane_read&In-Reply-To=&lt;200002191809.NAA07412@panther.panther.net&gt;">majordomo@mostang.com</A>
</PRE>
<P><!-- body="end" -->
<HR NOSHADE>
<UL>
<!-- next="start" -->
<LI><STRONG>Next message:</STRONG> <A HREF="0227.html">Oliver Rauch: "xsane-0.56 and 16 bit preview"</A>
<LI><STRONG>Previous message:</STRONG> <A HREF="0225.html">Oliver Rauch: "Re: Xsane-0.55: scan resolution selection (Epson 1200S, CVS Sane)"</A>
<LI><STRONG>In reply to:</STRONG> <A HREF="0223.html">Oliver Rauch: "backend fork/reader-process &lt;-&gt; sane_read"</A>
<!-- nextthread="start" -->
<LI><STRONG>Next in thread:</STRONG> <A HREF="0252.html">Yuri Dario: "Re: backend fork/reader-process &lt;-&gt; sane_read"</A>
<!-- reply="end" -->
<LI><STRONG>Messages sorted by:</STRONG>
<A HREF="date.html#226">[ date ]</A>
<A HREF="index.html#226">[ thread ]</A>
<A HREF="subject.html#226">[ subject ]</A>
<A HREF="author.html#226">[ author ]</A>
</UL>
<!-- trailer="footer" -->
<HR NOSHADE>
<P>
<SMALL>
<EM>
This archive was generated by <A HREF="http://www.hypermail.org/">hypermail 2b29</A>
: <EM>Sat Feb 19 2000 - 10:12:44 PST</EM>
</EM>
</SMALL>
</BODY>
</HTML>