[PATCH 2/2] V4L: convert saa7146 VIDIOCGMBUF to videobuf_cgmbuf

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

 



Converting saa7146 to videobuf_cgmbuf was suggested by Mauro last week
and should work, but I am unable to test it on real hardware.  

e9hack could you test this?

Signed-off-by: Brandon Philips <bphilips@xxxxxxx>
---

diff --git a/linux/drivers/media/common/saa7146_video.c b/linux/drivers/media/common/saa7146_video.c
--- a/linux/drivers/media/common/saa7146_video.c
+++ b/linux/drivers/media/common/saa7146_video.c
@@ -1196,28 +1196,11 @@ int saa7146_video_do_ioctl(struct inode 
 	case VIDIOCGMBUF:
 	{
 		struct video_mbuf *mbuf = arg;
-		struct videobuf_queue *q;
-		int i;
-
-		/* fixme: number of capture buffers and sizes for v4l apps */
 		int gbuffers = 2;
-		int gbufsize = 768*576*4;
 
 		DEB_D(("VIDIOCGMBUF \n"));
 
-		q = &fh->video_q;
-		err = videobuf_mmap_setup(q,gbuffers,gbufsize,
-					  V4L2_MEMORY_MMAP);
-		if (err < 0) 
-			return err;
-
-		gbuffers = err;
-		memset(mbuf,0,sizeof(*mbuf));
-		mbuf->frames = gbuffers;
-		mbuf->size   = gbuffers * gbufsize;
-		for (i = 0; i < gbuffers; i++)
-			mbuf->offsets[i] = i * gbufsize;
-		return 0;
+		return videobuf_cgmbuf(&fh->video_q, mbuf, gbuffers);
 	}
 #endif
 	default:

_______________________________________________
linux-dvb mailing list
linux-dvb@xxxxxxxxxxx
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

[Index of Archives]     [Linux Media]     [Video 4 Linux]     [Asterisk]     [Samba]     [Xorg]     [Xfree86]     [Linux USB]

  Powered by Linux