nvrec & bttv-0.9.x?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Hello!

After removing #include <linux/times.h> from videodev2.h i'm able to
compile nvrec 20020812-9 but without V4L2 support. Is there a patch for
v4l2_core.c so nvrec will compile with the new V4L2-API?

I fixed some pieces, but following remains:
v4l2_core.c: In function `v4l2_core_next':
v4l2_core.c:121: incompatible types in assignment
v4l2_core.c:125: invalid operands to binary -
v4l2_core.c:129: incompatible types in assignment
v4l2_core.c: In function `v4l2_core_init':
v4l2_core.c:339: storage size of `std' isn't known
v4l2_core.c:339: warning: unused variable `std'
v4l2_core.c:394: structure has no member named `flags'
v4l2_core.c:427: aggregate value used where an integer was expected
v4l2_core.c:457: structure has no member named `offset'

So, how to convert struct v4l2_enumstd in line 339?

Regards,
-- 
Dirk Meul <dirk.meul@xxxxxxxx>
--- v4l2_core.c.orig	2002-08-12 16:34:02.000000000 +0200
+++ v4l2_core.c	2002-12-08 16:03:35.000000000 +0100
@@ -29,7 +29,7 @@
 
 #include "nvrec.h"
 
-#ifdef V4L2_MAJOR_VERSION
+#ifdef HAVE_V4L2
 
 struct v4l2_core_t {
 	int fd;			// file descriptor
@@ -76,7 +76,7 @@
 	ioctl(vct->fd, VIDIOC_S_CTRL, &ctrl);
 
 	DXPRINT("setup streamoff\n");
-	i = V4L2_BUF_TYPE_CAPTURE;
+	i = V4L2_BUF_TYPE_VIDEO_CAPTURE;
 	DXPRINT("do streamoff\n");
 	ioctl(vct->fd, VIDIOC_STREAMOFF, &i);
 	
@@ -110,7 +110,7 @@
 			if(r<0)
 				PERROR("Select error");
 		}	
-		vct->cbuf.type = V4L2_BUF_TYPE_CAPTURE;
+		vct->cbuf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
 		if(ioctl(vct->fd, VIDIOC_DQBUF, &vct->cbuf)!=0) {
 			PERROR("Could not dequeue new buffer");
 			vct->new_index = -1;
@@ -357,7 +357,7 @@
 	
 	if(freq > 0) {
 		int i = (int)(freq * 16.0);
-		if(ioctl(vct->fd, VIDIOC_S_FREQ, &i)) {
+		if(ioctl(vct->fd, VIDIOC_S_FREQUENCY, &i)) {
 			PERROR("Could not set frequency");
 			goto error1;
 		}
@@ -387,11 +387,11 @@
 		}
 
 		memset(&cfmt, 0, sizeof(cfmt));
- 		cfmt.type = V4L2_BUF_TYPE_CAPTURE;
+ 		cfmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
 		cfmt.fmt.pix.width = vct->width;
 		cfmt.fmt.pix.height = vct->height;
 		cfmt.fmt.pix.pixelformat = vct->pfmt;
-		cfmt.fmt.pix.flags = V4L2_FMT_FLAG_INTERLACED;
+		cfmt.fmt.pix.flags = V4L2_FIELD_INTERLACED;
 		if (ioctl(vct->fd, VIDIOC_S_FMT, &cfmt)) {
 			PERROR("s_fmt");
 			pfmt++;
@@ -419,7 +419,7 @@
 	}
 
 	memset(&cparm, 0, sizeof(cparm));
-	cparm.type = V4L2_BUF_TYPE_CAPTURE;
+	cparm.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
 	if (ioctl(vct->fd, VIDIOC_G_PARM, &cparm) != 0) {
 		PERROR("Could not request parameters");
 		goto error1;
@@ -428,7 +428,7 @@
 	IPRINT("Frame period %lluns\n", vct->frame_period);
 
 	memset(&crbuf, 0, sizeof(crbuf));
-	crbuf.type = V4L2_BUF_TYPE_CAPTURE;
+	crbuf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
 	crbuf.count = N;
 	if (ioctl(vct->fd, VIDIOC_REQBUFS, &crbuf) != 0) {
 		PERROR("Could not request buffers");
@@ -448,7 +448,7 @@
 	IPRINT("Got %i buffers\n", vct->nbufs);
   
 	for(i=0; i<vct->nbufs; i++) {
-		vct->cbuf.type = V4L2_BUF_TYPE_CAPTURE;
+		vct->cbuf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
 		vct->cbuf.index = i;
 		if(ioctl(vct->fd, VIDIOC_QUERYBUF, &vct->cbuf)!=0) {
 			PERROR("Querybuf failed");
@@ -498,7 +498,7 @@
 	vct->new_index = -1;
 	vct->new_seq = -1;
 	
-	i = V4L2_BUF_TYPE_CAPTURE;
+	i = V4L2_BUF_TYPE_VIDEO_CAPTURE;
 	if(ioctl(vct->fd, VIDIOC_STREAMON, &i)!=0) {
 		PERROR("Could not streamon");
 		goto error2;

[Index of Archives]     [Linux DVB]     [Video Disk Recorder]     [Asterisk]     [Photo]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Free Photo Albums]     [Fedora Users]     [Fedora Women]     [ALSA Users]     [ALSA Devel]     [Linux USB]

Powered by Linux