[PATCH] V4L 2.1.122 Picture Number

Peter Schlaile (udbz@rz.uni-karlsruhe.de)
Sun, 20 Sep 1998 22:08:00 +0200 (CES)


Hello Alan, hello linux-kernel,

the following patch adds a small ioctl to the videodev-interface. For
realtime video-processing applications it is essential to know, how many
frames you have skipped. Now you can query the number of the picture you
have grabbed. (I considered that missing feature a bug, so no problem with
the feature freeze ;-) Apart from that, I do not think, that this little
change can break anything.

Greetings,
Peter

--- include/linux/videodev.h.backup Sat Sep 19 20:26:39 1998
+++ include/linux/videodev.h Sat Sep 19 20:39:40 1998
@@ -238,6 +238,7 @@
#define VIDIOCGUNIT _IOR('v', 21, struct video_unit) /* Get attached units */
#define VIDIOCGCAPTURE _IOR('v',22, struct video_capture) /* Get frame buffer */
#define VIDIOCSCAPTURE _IOW('v',23, struct video_capture) /* Set frame buffer - root only */
+#define VIDIOCGPICNR _IOR('v',24, int) /* Get number of grabbed picture */

#define BASE_VIDIOCPRIVATE 192 /* 192-255 are private */

--- drivers/char/bttv.c.backup Sat Sep 19 20:29:08 1998
+++ drivers/char/bttv.c Sat Sep 19 20:39:53 1998
@@ -80,6 +80,8 @@

static unsigned int vidmem=0; /* manually set video mem address */
static int triton1=0;
+static unsigned int picture_number=0; /* number of grabbed picture */
+static unsigned int picture_number_comp=0;

static unsigned int remap[BTTV_MAX]; /* remap Bt848 */
static unsigned int radio[BTTV_MAX];
@@ -1893,7 +1895,10 @@
return -EFAULT;
return 0;
}
-
+ case VIDIOCGPICNR:
+ {
+ return picture_number;
+ }
default:
return -ENOIOCTLCMD;
}
@@ -2759,6 +2764,7 @@
if (astat&BT848_INT_VSYNC)
{
IDEBUG(printk ("bttv%d: IRQ_VSYNC\n", btv->nr));
+ picture_number_comp++;
}
if (astat&BT848_INT_SCERR) {
IDEBUG(printk ("bttv%d: IRQ_SCERR\n", btv->nr));
@@ -2771,6 +2777,8 @@
if (astat&BT848_INT_RISCI)
{
IDEBUG(printk ("bttv%d: IRQ_RISCI\n", btv->nr));
+
+ picture_number = picture_number_comp;

/* captured VBI frame */
if (stat&(1<<28))

-- 
Peter Schlaile  ***  eMail udbz@rz.uni-karlsruhe.de

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/