summaryrefslogtreecommitdiff
path: root/include/linux/videodev2.h
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2004-01-18 18:54:44 -0800
committerLinus Torvalds <torvalds@home.osdl.org>2004-01-18 18:54:44 -0800
commit3fcdee6b28470d336e29ee5ce212d24a05df5aa0 (patch)
tree513688f846c4765e68ef5682ee95b026d3b70ee8 /include/linux/videodev2.h
parent71b2640649328667bde0079bdc29b4d376449693 (diff)
[PATCH] v4l: v4l2 update
From: Gerd Knorr <kraxel@bytesex.org> This patch is a v4l2 update. Changes: * added new ioctls (VIDIOC_G_PRIORITY, VIDIOC_S_PRIORITY) to give v4l apps priorities for tuning and other controls. Main purpose is that backgrounds applictions like nxtvepg which are fishing informations from /dev/vbi (teletext, epg, ...) can run at lower priority than interactive tv apps and thus the user isn't annonyed with unexpected channel switches. * add a set of helper functions to handle priorities to the v4l2-common module. * minor fixes in the v4l1-compat module. * minor header file fixes.
Diffstat (limited to 'include/linux/videodev2.h')
-rw-r--r--include/linux/videodev2.h84
1 files changed, 77 insertions, 7 deletions
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index c60eb026dc20..1bfc45a4a430 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -13,7 +13,9 @@
* Justin Schoeman
* et al.
*/
+#ifdef __KERNEL__
#include <linux/time.h> /* need struct timeval */
+#endif
/*
* M I S C E L L A N E O U S
@@ -111,6 +113,14 @@ enum v4l2_colorspace {
V4L2_COLORSPACE_SRGB = 8,
};
+enum v4l2_priority {
+ V4L2_PRIORITY_UNSET = 0, /* not initialized */
+ V4L2_PRIORITY_BACKGROUND = 1,
+ V4L2_PRIORITY_INTERACTIVE = 2,
+ V4L2_PRIORITY_RECORD = 3,
+ V4L2_PRIORITY_DEFAULT = V4L2_PRIORITY_INTERACTIVE,
+};
+
struct v4l2_rect {
__s32 left;
__s32 top;
@@ -144,8 +154,9 @@ struct v4l2_capability
#define V4L2_CAP_VBI_OUTPUT 0x00000020 /* Is a VBI output device */
#define V4L2_CAP_RDS_CAPTURE 0x00000100 /* RDS data capture */
-#define V4L2_CAP_TUNER 0x00010000 /* Has a tuner */
+#define V4L2_CAP_TUNER 0x00010000 /* has a tuner */
#define V4L2_CAP_AUDIO 0x00020000 /* has audio support */
+#define V4L2_CAP_RADIO 0x00040000 /* is a radio device */
#define V4L2_CAP_READWRITE 0x01000000 /* read/write systemcalls */
#define V4L2_CAP_ASYNCIO 0x02000000 /* async I/O */
@@ -203,7 +214,7 @@ struct v4l2_pix_format
#define V4L2_PIX_FMT_MPEG v4l2_fourcc('M','P','E','G') /* MPEG */
/* Vendor-specific formats */
-#define V4L2_PIX_FMT_WNVA v4l2_fourcc('W','N','V','A') /* Winnov hw compres */
+#define V4L2_PIX_FMT_WNVA v4l2_fourcc('W','N','V','A') /* Winnov hw compress */
/*
* F O R M A T E N U M E R A T I O N
@@ -264,6 +275,51 @@ struct v4l2_compression
__u32 keyframerate;
__u32 pframerate;
__u32 reserved[5];
+
+/* what we'll need for MPEG, extracted from some postings on
+ the v4l list (Gert Vervoort, PlasmaJohn).
+
+system stream:
+ - type: elementary stream(ES), packatised elementary stream(s) (PES)
+ program stream(PS), transport stream(TS)
+ - system bitrate
+ - PS packet size (DVD: 2048 bytes, VCD: 2324 bytes)
+ - TS video PID
+ - TS audio PID
+ - TS PCR PID
+ - TS system information tables (PAT, PMT, CAT, NIT and SIT)
+ - (MPEG-1 systems stream vs. MPEG-2 program stream (TS not supported
+ by MPEG-1 systems)
+
+audio:
+ - type: MPEG (+Layer I,II,III), AC-3, LPCM
+ - bitrate
+ - sampling frequency (DVD: 48 Khz, VCD: 44.1 KHz, 32 kHz)
+ - Trick Modes? (ff, rew)
+ - Copyright
+ - Inverse Telecine
+
+video:
+ - picturesize (SIF, 1/2 D1, 2/3 D1, D1) and PAL/NTSC norm can be set
+ through excisting V4L2 controls
+ - noise reduction, parameters encoder specific?
+ - MPEG video version: MPEG-1, MPEG-2
+ - GOP (Group Of Pictures) definition:
+ - N: number of frames per GOP
+ - M: distance between reference (I,P) frames
+ - open/closed GOP
+ - quantiser matrix: inter Q matrix (64 bytes) and intra Q matrix (64 bytes)
+ - quantiser scale: linear or logarithmic
+ - scanning: alternate or zigzag
+ - bitrate mode: CBR (constant bitrate) or VBR (variable bitrate).
+ - target video bitrate for CBR
+ - target video bitrate for VBR
+ - maximum video bitrate for VBR - min. quantiser value for VBR
+ - max. quantiser value for VBR
+ - adaptive quantisation value
+ - return the number of bytes per GOP or bitrate for bitrate monitoring
+
+*/
};
#endif
@@ -822,6 +878,8 @@ struct v4l2_streamparm
#define VIDIOC_TRY_FMT _IOWR ('V', 64, struct v4l2_format)
#define VIDIOC_ENUMAUDIO _IOWR ('V', 65, struct v4l2_audio)
#define VIDIOC_ENUMAUDOUT _IOWR ('V', 66, struct v4l2_audioout)
+#define VIDIOC_G_PRIORITY _IOR ('V', 67, enum v4l2_priority)
+#define VIDIOC_S_PRIORITY _IOW ('V', 68, enum v4l2_priority)
/* for compatibility, will go away some day */
#define VIDIOC_OVERLAY_OLD _IOWR ('V', 14, int)
@@ -847,17 +905,29 @@ extern unsigned int v4l2_video_std_fps(struct v4l2_standard *vs);
extern int v4l2_video_std_construct(struct v4l2_standard *vs,
int id, char *name);
-/* Compatibility layer interface */
-typedef int (*v4l2_kioctl)(struct inode *inode, struct file *file,
- unsigned int cmd, void *arg);
-int v4l_compat_translate_ioctl(struct inode *inode, struct file *file,
- int cmd, void *arg, v4l2_kioctl driver_ioctl);
+/* prority handling */
+struct v4l2_prio_state {
+ atomic_t prios[4];
+};
+int v4l2_prio_init(struct v4l2_prio_state *global);
+int v4l2_prio_change(struct v4l2_prio_state *global, enum v4l2_priority *local,
+ enum v4l2_priority new);
+int v4l2_prio_open(struct v4l2_prio_state *global, enum v4l2_priority *local);
+int v4l2_prio_close(struct v4l2_prio_state *global, enum v4l2_priority *local);
+enum v4l2_priority v4l2_prio_max(struct v4l2_prio_state *global);
+int v4l2_prio_check(struct v4l2_prio_state *global, enum v4l2_priority *local);
/* names for fancy debug output */
extern char *v4l2_field_names[];
extern char *v4l2_type_names[];
extern char *v4l2_ioctl_names[];
+/* Compatibility layer interface -- v4l1-compat module */
+typedef int (*v4l2_kioctl)(struct inode *inode, struct file *file,
+ unsigned int cmd, void *arg);
+int v4l_compat_translate_ioctl(struct inode *inode, struct file *file,
+ int cmd, void *arg, v4l2_kioctl driver_ioctl);
+
#endif /* __KERNEL__ */
#endif /* __LINUX_VIDEODEV2_H */