[libdc1394-devel] Re: [PATCH] fix wrong timestamps in video1394
Capture and control API for IIDC compliant cameras
Brought to you by:
ddouxchamps,
gordp
From: Ben C. <bco...@de...> - 2005-10-13 04:19:49
|
Let's get rid of the superflouse debug printk's. On Wed, Oct 12, 2005 at 12:07:20PM +0900, Damien Douxchamps wrote: > Hi all, > > The following patch fixes a problem that appeared in 2.6.12: the > timestamps attached to each image buffer were periodically wrong. See > the following post on the libdc1394-devel list for a more accurate > description of the problem: > > http://sourceforge.net/mailarchive/forum.php?thread_id=8435600&forum_id=7492 > > Thanks to Johann Schoonees and David Penman for their help in correcting > the bug. > > Damien > > -- > _ Damien 'Takahara' Douxchamps, PhD > ('- Post-doctoral investigator > //\ Image Processing Group, NAIST > V_/_ http://chihara.aist-nara.ac.jp/ > > diff -u ieee1394-old/video1394.c ieee1394/video1394.c > --- ieee1394-old/video1394.c 2005-10-11 03:54:29.000000000 +0900 > +++ ieee1394/video1394.c 2005-10-12 11:20:50.000000000 +0900 > @@ -33,12 +33,15 @@ > * EAGAIN for resource allocation failure that could perhaps succeed later > * ENOTTY for unsupported ioctl request > * > - */ > - > -/* Markus Tavenrath <spe...@sp...> : > - - fixed checks for valid buffer-numbers in video1394_icotl > - - changed the ways the dma prg's are used, now it's possible to use > - even a single dma buffer > + * Markus Tavenrath <spe...@sp...> : > + * - fixed checks for valid buffer-numbers in video1394_icotl > + * - changed the ways the dma prg's are used, now it's possible to use > + * even a single dma buffer > + * > + * Damien Douxchamps <ddo...@us...>, Johann Schoonees and > + * David Penman: > + * - fixed wrong timestamps bug introduced during the last change. > + * > */ > #include <linux/config.h> > #include <linux/kernel.h> > @@ -539,7 +542,10 @@ > if (d->ir_prg[i][d->nb_cmd-1].status & cpu_to_le32(0xFFFF0000)) { > reset_ir_status(d, i); > d->buffer_status[d->buffer_prg_assignment[i]] = VIDEO1394_BUFFER_READY; > - do_gettimeofday(&d->buffer_time[i]); > + do_gettimeofday(&d->buffer_time[d->buffer_prg_assignment[i]]); > + > + //printk("Got timestamp %d.%.06d\n",(int)d->buffer_time[d->buffer_prg_assignment[i]].tv_sec,(int)d->buffer_time[d->buffer_prg_assignment[i]].tv_usec); > + > } > } > > @@ -1046,7 +1052,7 @@ > > /* set time of buffer */ > v.filltime = d->buffer_time[v.buffer]; > -// printk("Buffer %d time %d\n", v.buffer, (d->buffer_time[v.buffer]).tv_usec); > + //printk("Set buffer %d time to %d.%.06d\n", v.buffer, (int)(d->buffer_time[v.buffer]).tv_sec, (int)(d->buffer_time[v.buffer]).tv_usec); > > /* > * Look ahead to see how many more buffers have been received -- Ubuntu - http://www.ubuntu.com/ Debian - http://www.debian.org/ Linux 1394 - http://www.linux1394.org/ SwissDisk - http://www.swissdisk.com/ |