[MPlayer-users] [BUG] CVS v4l2 failure to compile

Giacomo Comes comes at naic.edu
Mon Sep 19 19:27:02 CEST 2005


Between 6 and 12 september a change has gone into libmpdemux/tvi_v4l2.c:

--- main6/libmpdemux/tvi_v4l2.c 2005-08-22 16:04:42.000000000 -0400
+++ main12/libmpdemux/tvi_v4l2.c        2005-09-10 14:38:23.000000000 -0400
@@ -40,7 +40,8 @@
 #ifdef HAVE_SYS_SYSINFO_H
 #include <sys/sysinfo.h>
 #endif
-#include "videodev2.h"
+#include <linux/types.h>
+#include <linux/videodev2.h>
 #include "../mp_msg.h"
 #include "../libvo/img_format.h"
 #include "../libaf/af_format.h"


The result is that CVS does not compile anymore on my system. In order to 
compile it I have to --disable-tv-v4l2.

As you can see, the problem is caused by the removing of videodev2.h and the
usage of the system one. If I replace:
#include <linux/videodev2.h>
with
#include "videodev2.h"
and put back the old videodev2.h file, CVS does compile.

The command diff -ru /usr/include/linux/videodev2.h /dev/shm/main6/libmpdemux/videodev2.h
gives:


--- /usr/include/linux/videodev2.h	2003-10-02 12:47:50.000000000 -0400
+++ /dev/shm/main6/libmpdemux/videodev2.h	2003-08-07 08:18:04.000000000 -0400
@@ -6,16 +6,17 @@
  *	Header file for v4l or V4L2 drivers and applications, for
  *	Linux kernels 2.2.x or 2.4.x.
  *
- *	See http://bytesex.org/v4l/ for API specs and other
+ *	See http://www.thedirks.org/v4l2/ for API specs and other
  *	v4l2 documentation.
  *
  *	Author: Bill Dirks <bdirks at pacbell.net>
  *		Justin Schoeman
  *		et al.
  */
-#ifdef __KERNEL__
-#include <linux/time.h> /* need struct timeval */
-#endif
+#include <sys/time.h> /* need struct timeval */
+
+#include <linux/types.h>
+#include <linux/version.h>
 
 /*
  *	M I S C E L L A N E O U S
@@ -132,7 +133,7 @@
 {
 	__u8	driver[16];	/* i.e. "bttv" */
 	__u8	card[32];	/* i.e. "Hauppauge WinTV" */
-	__u8	bus_info[32];	/* "PCI:" + pci_name(pci_dev) */
+	__u8	bus_info[32];	/* "PCI:" + pci_dev->slot_name */
 	__u32   version;        /* should use KERNEL_VERSION() */
 	__u32	capabilities;	/* Device capabilities */
 	__u32	reserved[4];
@@ -311,7 +312,6 @@
 	__u32	                reserved[2];
 };
 
-#ifdef __KERNEL__
 struct v4l2_buffer
 {
 	__u32			index;
@@ -333,7 +333,6 @@
 
 	__u32			reserved[2];
 };
-#endif
 
 /*  Flags for 'flags' field */
 #define V4L2_BUF_FLAG_MAPPED	0x0001  /* Buffer is mapped (flag) */


The compilation error is:

gcc -c -I../libvo -I../../libvo -I/usr/X11/include -fno-PIC -O4 -march=pentium4 -mcpu=pentium4 -pipe -ffast-math -fomit-frame-pointer -D_REENTRANT -D_
LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -I.. -I../loader    -I../libavutil -I../libavcodec -I../libavformat    -o tvi_v4l2.o tvi_v4l2.c

tvi_v4l2.c:60: error: field `buf' has incomplete type
tvi_v4l2.c: In function `uninit':
tvi_v4l2.c:869: error: storage size of `buf' isn't known
tvi_v4l2.c:889: error: invalid application of `sizeof' to an incomplete type
tvi_v4l2.c: In function `start':
tvi_v4l2.c:1285: error: invalid application of `sizeof' to an incomplete type
tvi_v4l2.c:1304: error: invalid application of `sizeof' to an incomplete type
tvi_v4l2.c: In function `video_grabber':
tvi_v4l2.c:1367: error: storage size of `buf' isn't known
tvi_v4l2.c:1422: error: invalid application of `sizeof' to an incomplete type
tvi_v4l2.c:1439: error: invalid application of `sizeof' to an incomplete type
tvi_v4l2.c:1446: error: invalid application of `sizeof' to an incomplete type
tvi_v4l2.c:1540: error: invalid application of `sizeof' to an incomplete type
make[1]: *** [tvi_v4l2.o] Error 1


I personally do not use v4l2, so I have no problem to disable it and
compile MPlayer. But probably there are users affected who care.

Giacomo




More information about the MPlayer-users mailing list