svn commit: r252892 - in head/sys: compat/linux contrib/v4l

Alexander Leidinger netchild at FreeBSD.org
Sat Jul 6 19:59:07 UTC 2013


Author: netchild
Date: Sat Jul  6 19:59:06 2013
New Revision: 252892
URL: http://svnweb.freebsd.org/changeset/base/252892

Log:
  - Move videodev headers from compat/linux to contrib/v4l (cp from vendor and
    apply diff to compat/linux versions).
  - The cp implies an update of videodev2.h to the linux kernel 2.6.34.14 one.
  
  The update makes video in skype v4 work on FreeBSD.
  
  Tested by:	Artyom Mirgorodskiy <artyom.mirgorodsky at gmail.com>
  		(update of header only)

Added:
  head/sys/contrib/v4l/
     - copied from r252890, vendor/v4l/dist/
Deleted:
  head/sys/compat/linux/linux_videodev.h
  head/sys/compat/linux/linux_videodev2.h
Modified:
  head/sys/compat/linux/linux_ioctl.c
  head/sys/contrib/v4l/videodev.h
  head/sys/contrib/v4l/videodev2.h

Modified: head/sys/compat/linux/linux_ioctl.c
==============================================================================
--- head/sys/compat/linux/linux_ioctl.c	Sat Jul  6 19:43:42 2013	(r252891)
+++ head/sys/compat/linux/linux_ioctl.c	Sat Jul  6 19:59:06 2013	(r252892)
@@ -85,10 +85,10 @@ __FBSDID("$FreeBSD$");
 #include <compat/linux/linux_socket.h>
 #include <compat/linux/linux_util.h>
 
-#include <compat/linux/linux_videodev.h>
+#include <contrib/v4l/videodev.h>
 #include <compat/linux/linux_videodev_compat.h>
 
-#include <compat/linux/linux_videodev2.h>
+#include <contrib/v4l/videodev2.h>
 #include <compat/linux/linux_videodev2_compat.h>
 
 CTASSERT(LINUX_IFNAMSIZ == IFNAMSIZ);

Modified: head/sys/contrib/v4l/videodev.h
==============================================================================
--- vendor/v4l/dist/videodev.h	Sat Jul  6 18:28:06 2013	(r252890)
+++ head/sys/contrib/v4l/videodev.h	Sat Jul  6 19:59:06 2013	(r252892)
@@ -1,48 +1,41 @@
+/*
+ * This header comes from linux, but it has no license. The author
+ * (Alan Cox @ Redhat) gave explicit permissions to use it in FreeBSD.
+ * The FreeBSD vendor branch for v4l gives a more detailed description
+ * about this in the README.
+ *
+ * $FreeBSD$
+ */
+
 #ifndef __LINUX_VIDEODEV_H
 #define __LINUX_VIDEODEV_H
 
-#include <linux/types.h>
+#include <sys/types.h>
+typedef int32_t __s32;
+typedef uint32_t __u32;
+typedef uint16_t __u16;
+typedef uint8_t __u8;
 
+#if 0
 #define HAVE_V4L1 1
 
 #include <linux/videodev2.h>
+#endif 
 
-#ifdef __KERNEL__
-
-#include <linux/mm.h>
-
-extern struct video_device* video_devdata(struct file*);
-
-#define to_video_device(cd) container_of(cd, struct video_device, class_dev)
-static inline void
-video_device_create_file(struct video_device *vfd,
-			 struct class_device_attribute *attr)
-{
-	class_device_create_file(&vfd->class_dev, attr);
-}
-static inline void
-video_device_remove_file(struct video_device *vfd,
-			 struct class_device_attribute *attr)
-{
-	class_device_remove_file(&vfd->class_dev, attr);
-}
-
-#if OBSOLETE_OWNER /* to be removed in 2.6.15 */
-/* helper functions to access driver private data. */
-static inline void *video_get_drvdata(struct video_device *dev)
-{
-	return dev->priv;
-}
-
-static inline void video_set_drvdata(struct video_device *dev, void *data)
-{
-	dev->priv = data;
-}
-#endif
-
-extern int video_exclusive_open(struct inode *inode, struct file *file);
-extern int video_exclusive_release(struct inode *inode, struct file *file);
-#endif /* __KERNEL__ */
+#define VID_TYPE_CAPTURE	1	/* Can capture */
+#define VID_TYPE_TUNER		2	/* Can tune */
+#define VID_TYPE_TELETEXT	4	/* Does teletext */
+#define VID_TYPE_OVERLAY	8	/* Overlay onto frame buffer */
+#define VID_TYPE_CHROMAKEY	16	/* Overlay by chromakey */
+#define VID_TYPE_CLIPPING	32	/* Can clip */
+#define VID_TYPE_FRAMERAM	64	/* Uses the frame buffer memory */
+#define VID_TYPE_SCALES		128	/* Scalable */
+#define VID_TYPE_MONOCHROME	256	/* Monochrome only */
+#define VID_TYPE_SUBCAPTURE	512	/* Can capture subareas of the image */
+#define VID_TYPE_MPEG_DECODER	1024	/* Can decode MPEG streams */
+#define VID_TYPE_MPEG_ENCODER	2048	/* Can encode MPEG streams */
+#define VID_TYPE_MJPEG_DECODER	4096	/* Can decode MJPEG streams */
+#define VID_TYPE_MJPEG_ENCODER	8192	/* Can encode MJPEG streams */
 
 struct video_capability
 {
@@ -157,7 +150,7 @@ struct video_window
 	__u32	width,height;		/* Its size */
 	__u32	chromakey;
 	__u32	flags;
-	struct	video_clip __user *clips;	/* Set only */
+	struct	video_clip *clips;	/* Set only */
 	int	clipcount;
 #define VIDEO_WINDOW_INTERLACE	1
 #define VIDEO_WINDOW_CHROMAKEY	16	/* Overlay by chromakey */
@@ -197,6 +190,8 @@ struct video_key
 	__u32	flags;
 };
 
+#define VIDEO_MAX_FRAME		32
+
 struct video_mbuf
 {
 	int	size;		/* Total memory to map */

Modified: head/sys/contrib/v4l/videodev2.h
==============================================================================
--- vendor/v4l/dist/videodev2.h	Sat Jul  6 18:28:06 2013	(r252890)
+++ head/sys/contrib/v4l/videodev2.h	Sat Jul  6 19:59:06 2013	(r252892)
@@ -52,10 +52,18 @@
  *		Justin Schoeman
  *              Hans Verkuil <hverkuil at xs4all.nl>
  *		et al.
+ *
+ * $FreeBSD$
  */
 #ifndef __LINUX_VIDEODEV2_H
 #define __LINUX_VIDEODEV2_H
 
+#ifdef __FreeBSD__
+#define __user
+typedef uint64_t	__u64;
+typedef int64_t		__s64;
+typedef uint32_t	__le32;
+#else
 #ifdef __KERNEL__
 #include <linux/time.h>     /* need struct timeval */
 #else
@@ -64,6 +72,7 @@
 #include <linux/compiler.h>
 #include <linux/ioctl.h>
 #include <linux/types.h>
+#endif
 
 /*
  * Common stuff for both V4L1 and V4L2


More information about the svn-src-head mailing list