diff options
Diffstat (limited to 'linux/include')
-rw-r--r-- | linux/include/linux/videodev.h | 102 | ||||
-rw-r--r-- | linux/include/linux/videodev2.h | 102 | ||||
-rw-r--r-- | linux/include/media/video-buf.h | 4 |
3 files changed, 108 insertions, 100 deletions
diff --git a/linux/include/linux/videodev.h b/linux/include/linux/videodev.h index b060da77d..2f2bb1c84 100644 --- a/linux/include/linux/videodev.h +++ b/linux/include/linux/videodev.h @@ -1,83 +1,16 @@ #ifndef __LINUX_VIDEODEV_H #define __LINUX_VIDEODEV_H -#include <linux/compiler.h> #include <linux/types.h> -#define HAVE_V4L2 1 +#define HAVE_V4L1 1 + #include <linux/videodev2.h> #ifdef __KERNEL__ -#include <linux/poll.h> #include <linux/mm.h> -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,69) -#include <linux/devfs_fs_kernel.h> -#endif -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) -#include <linux/device.h> -#endif - -struct video_device -{ - /* device info */ -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) - struct device *dev; -#endif - char name[32]; - int type; /* v4l1 */ - int type2; /* v4l2 */ - int hardware; - int minor; - - /* device ops + callbacks */ - struct file_operations *fops; - void (*release)(struct video_device *vfd); - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) - /* old, obsolete interface -- dropped in 2.5.x, don't use it */ - int (*open)(struct video_device *, int mode); - void (*close)(struct video_device *); - long (*read)(struct video_device *, char *, unsigned long, int noblock); - long (*write)(struct video_device *, const char *, unsigned long, int noblock); - unsigned int (*poll)(struct video_device *, struct file *, poll_table *); - int (*ioctl)(struct video_device *, unsigned int , void *); - int (*mmap)(struct video_device *, const char *, unsigned long); - int (*initialize)(struct video_device *); -#endif - -#if 1 /* to be removed in 2.7.x */ - /* obsolete -- fops->owner is used instead */ - struct module *owner; - /* dev->driver_data will be used instead some day. - * Use the video_{get|set}_drvdata() helper functions, - * so the switch over will be transparent for you. - * Or use {pci|usb}_{get|set}_drvdata() directly. */ - void *priv; -#endif - - /* for videodev.c intenal usage -- please don't touch */ - int users; /* video_exclusive_{open|close} ... */ - struct semaphore lock; /* ... helper function uses these */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,69) - devfs_handle_t devfs_handle; /* devfs */ -#else - char devfs_name[64]; /* devfs */ -#endif -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) - struct class_device class_dev; /* sysfs */ -#endif -}; - -#define VIDEO_MAJOR 81 -#define VFL_TYPE_GRABBER 0 -#define VFL_TYPE_VBI 1 -#define VFL_TYPE_RADIO 2 -#define VFL_TYPE_VTX 3 - -extern int video_register_device(struct video_device *, int type, int nr); -extern void video_unregister_device(struct video_device *); extern struct video_device* video_devdata(struct file*); #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) @@ -96,11 +29,7 @@ video_device_remove_file(struct video_device *vfd, } #endif -/* helper functions to alloc / release struct video_device, the - later can be used for video_device->release() */ -struct video_device *video_device_alloc(void); -void video_device_release(struct video_device *vfd); - +#if 1 /* to be removed in 2.7.x */ /* helper functions to access driver private data. */ static inline void *video_get_drvdata(struct video_device *dev) { @@ -111,30 +40,12 @@ 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); -extern int video_usercopy(struct inode *inode, struct file *file, - unsigned int cmd, unsigned long arg, - int (*func)(struct inode *inode, struct file *file, - unsigned int cmd, void *arg)); #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 { char name[32]; @@ -288,9 +199,6 @@ struct video_key __u32 flags; }; - -#define VIDEO_MAX_FRAME 32 - struct video_mbuf { int size; /* Total memory to map */ @@ -298,10 +206,8 @@ struct video_mbuf int offsets[VIDEO_MAX_FRAME]; }; - #define VIDEO_NO_UNIT (-1) - struct video_unit { int video; /* Video minor */ diff --git a/linux/include/linux/videodev2.h b/linux/include/linux/videodev2.h index b622cc226..24a4978bc 100644 --- a/linux/include/linux/videodev2.h +++ b/linux/include/linux/videodev2.h @@ -18,6 +18,108 @@ #endif #include <linux/compiler.h> /* need __user */ +#include <linux/poll.h> +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,69) +#include <linux/devfs_fs_kernel.h> +#endif +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) +#include <linux/device.h> +#endif + +#define HAVE_V4L2 1 + +/* + * Common stuff for both V4L1 and V4L2 + * Moved from videodev.h + */ + +#define VIDEO_MAX_FRAME 32 + +#define VFL_TYPE_GRABBER 0 +#define VFL_TYPE_VBI 1 +#define VFL_TYPE_RADIO 2 +#define VFL_TYPE_VTX 3 + +struct video_device +{ + /* device info */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) + struct device *dev; +#endif + char name[32]; + int type; /* v4l1 */ + int type2; /* v4l2 */ + int hardware; + int minor; + + /* device ops + callbacks */ + struct file_operations *fops; + void (*release)(struct video_device *vfd); + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) + /* old, obsolete interface -- dropped in 2.5.x, don't use it */ + int (*open)(struct video_device *, int mode); + void (*close)(struct video_device *); + long (*read)(struct video_device *, char *, unsigned long, int noblock); + long (*write)(struct video_device *, const char *, unsigned long, int noblock); + unsigned int (*poll)(struct video_device *, struct file *, poll_table *); + int (*ioctl)(struct video_device *, unsigned int , void *); + int (*mmap)(struct video_device *, const char *, unsigned long); + int (*initialize)(struct video_device *); +#endif + +#if 1 /* to be removed in 2.7.x */ + /* obsolete -- fops->owner is used instead */ + struct module *owner; + /* dev->driver_data will be used instead some day. + * Use the video_{get|set}_drvdata() helper functions, + * so the switch over will be transparent for you. + * Or use {pci|usb}_{get|set}_drvdata() directly. */ + void *priv; +#endif + + /* for videodev.c intenal usage -- please don't touch */ + int users; /* video_exclusive_{open|close} ... */ + struct semaphore lock; /* ... helper function uses these */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,69) + devfs_handle_t devfs_handle; /* devfs */ +#else + char devfs_name[64]; /* devfs */ +#endif +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) + struct class_device class_dev; /* sysfs */ +#endif +}; + +#define VIDEO_MAJOR 81 + +#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 */ + +extern int video_register_device(struct video_device *, int type, int nr); +extern void video_unregister_device(struct video_device *); +extern int video_usercopy(struct inode *inode, struct file *file, + unsigned int cmd, unsigned long arg, + int (*func)(struct inode *inode, struct file *file, + unsigned int cmd, void *arg)); + +/* helper functions to alloc / release struct video_device, the + later can be used for video_device->release() */ +struct video_device *video_device_alloc(void); +void video_device_release(struct video_device *vfd); + /* * M I S C E L L A N E O U S */ diff --git a/linux/include/media/video-buf.h b/linux/include/media/video-buf.h index d5297072d..6c1dc2777 100644 --- a/linux/include/media/video-buf.h +++ b/linux/include/media/video-buf.h @@ -1,5 +1,5 @@ /* - * $Id: video-buf.h,v 1.10 2005/10/16 12:13:58 mchehab Exp $ + * $Id: video-buf.h,v 1.11 2005/10/17 21:18:42 mchehab Exp $ * * generic helper functions for video4linux capture buffers, to handle * memory management and PCI DMA. Right now bttv + saa7134 use it. @@ -18,7 +18,7 @@ * (at your option) any later version. */ -#include <linux/videodev.h> +#include <linux/videodev2.h> #define UNSET (-1U) |