pwc
[Top] [All Lists]

Re: [pwc] VIDIOCPWCRUSER: Bad file descriptor

To: oliver <>
Subject: Re: [pwc] VIDIOCPWCRUSER: Bad file descriptor
From: Mathieu Bouchard <>
Date: Thu, 20 Sep 2007 00:29:34 -0400 (EDT)
On Thu, 20 Sep 2007, oliver wrote:

in: setpwc_bang
fd=-1; does not look right to me.

check_device sets fd. the =-1 might be simply a way to avoid an
"uninitialized variable" warning.

Maybe you could declare it as a global variable,

this would make it stop trying to reopen the device every time and
forgetting the filehandle that it doesn't close. however it shouldn't be
global, because there can be multiple instances of t_setpwc; instead, a
"int fd;" should be added in t_setpwc (x_obj really has to be the first
field though, as it represents the superclass). A setpwc_free function
must also be written and registered in order to close the filehandle at
the time of destruction of the object.

However, this will prevent the device from being opened by the camera
input object, as the device can only be opened once at a time. That handle
cannot be passed around given the way that PureData/GEM are made. If at
the same time the desired setting resets on each reopen, then this object
class is rather futile for this task.

Let me know if I understood anything wrong.

 _ _ __ ___ _____ ________ _____________ _____________________ ...
| Mathieu Bouchard - tél:+1.514.383.3801, Montréal QC Canada
_______________________________________________
pwc mailing list

http://lists.saillard.org/mailman/listinfo/pwc
<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU