Re: [libdc] Corrupted frames under OS X - libdc1394 2.0.1
Capture and control API for IIDC compliant cameras
Brought to you by:
ddouxchamps,
gordp
From: David M. <dcm@MIT.EDU> - 2008-03-12 04:14:05
|
On Thu, 2008-02-28 at 10:50 +0100, Mark wrote: > > I don't really like adding a DC1394_BAD_FRAME return code because that > > would imply that the dequeue somehow failed, when it did not. > > > I'm just thinking about a way to still get the corrupted frame - maybe > for debugging purposes. When I reported the issue the first thing you > asked me for was screenshots of the bad frames... > I'm changing my mind about the corrupted frame detection. I think I'd like to return the corrupted frame data from dc1394_capture_dequeue() just like a normal frame. However, there will be a new function: dc1394bool_t dc1394_capture_is_frame_corrupt (dc1394camera_t *, dc1394video_frame_t *); which can be used to test if a frame is corrupt or not (after it has been dequeued). The main reason for this is that when using select() on juju or Linux, the file descriptor becomes readable as soon as a frame is available, whether it is corrupt or not. At this point, dc1394_capture_dequeue() is expected to run without blocking and return some data. Thus, to keep this working properly, it makes sense to return the data and let the user test for corruption if they are so included. An alternative option is to set frame=NULL from dequeue if the frame is corrupt. Anyone have thoughts? -David |