Proposal for changes to interface.h

Peter Pregler Peter.Pregler@risc.uni-linz.ac.at
Sun, 12 Sep 1999 22:48:05 +0200 (CEST)


On 09-Sep-99 sbertin@mindspring.com wrote:
> 
> - All pointer should point to memory in kernel space, not user space.

Agree, but this means that there should be no copy_to|from_user in
interface_pp.c. I had to remove that to write the v4l-layer. All that checking
should be done in the module-layer itself (i.e. right now in module.c). Could
you remove the checks again?

> - Registers callback function cb to be called with cbdata when an image is
> ready
> while streaming.  If cb is NULL, only single image grabs are allowed.
> cb should immediately call if_StreamRead to read the data or data may be
> lost.
> - Returns negative value on error, otherwise 0.

I have added a function if_RegisterCallback in order to implement the
v4l-module. I did this mainly because I did not want to change the interface
for all my test-programs right now. But such a function would be a good idea
anyway?

> int if_StreamRead (void *privdata, u8 *frame);
> - frame should be a buffer of MAX_IMAGE_SIZE bytes.  The driver higher up is
> responsible for handling partial reads.  Right now I think data will be
> lost on a partial read.  Ideally, this would be buffered by the higher level
> driver until the programs asks for it.

I don't think doing partial reads is worth the effort. What should that be good
for? Actually I have added a check such that if_StreamRead reports an error if
only a partial image is read. In other words, I would prefer to make a
if_StreamFrameRead out of it.

This poses another question: do we need a simple if_FrameRead that utilizes
grab mode. Right now we assume that the higher level does switch the camera to 
stream mode for if_StreamRead. As a sideremark: how does now check in what mode
the camera is? What exactly do the return 
values of GetCameraStatus.StreamState/GrabState mean? There is no real
explanation in the specification. Just the names.

Have fun, Peter

PS: Nice cleanup of the code. I was too lazy to do that stuff. :)

-------------------------------
Even the thought that a ship was waiting to take him back to Earth
did not wipe out the sense of loss he felt at that moment.
-------------------------------
Email: Peter.Pregler@risc.uni-linz.ac.at
Peter Pregler / RISC, University of Linz, Austria
-----------------------------------------------------------------------------
To unsubscribe from this mailinglist, send the line "unsubscribe vision-webcam" in the
body of a message to "majordomo@errors.no".