diff options
Diffstat (limited to 'include/linux/videodev2.h')
-rw-r--r-- | include/linux/videodev2.h | 149 |
1 files changed, 125 insertions, 24 deletions
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index 5e11f8a1f867..c9c9a4680cc5 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h | |||
@@ -235,16 +235,25 @@ struct v4l2_fract { | |||
235 | __u32 denominator; | 235 | __u32 denominator; |
236 | }; | 236 | }; |
237 | 237 | ||
238 | /* | 238 | /** |
239 | * D R I V E R C A P A B I L I T I E S | 239 | * struct v4l2_capability - Describes V4L2 device caps returned by VIDIOC_QUERYCAP |
240 | */ | 240 | * |
241 | * @driver: name of the driver module (e.g. "bttv") | ||
242 | * @card: name of the card (e.g. "Hauppauge WinTV") | ||
243 | * @bus_info: name of the bus (e.g. "PCI:" + pci_name(pci_dev) ) | ||
244 | * @version: KERNEL_VERSION | ||
245 | * @capabilities: capabilities of the physical device as a whole | ||
246 | * @device_caps: capabilities accessed via this particular device (node) | ||
247 | * @reserved: reserved fields for future extensions | ||
248 | */ | ||
241 | struct v4l2_capability { | 249 | struct v4l2_capability { |
242 | __u8 driver[16]; /* i.e. "bttv" */ | 250 | __u8 driver[16]; |
243 | __u8 card[32]; /* i.e. "Hauppauge WinTV" */ | 251 | __u8 card[32]; |
244 | __u8 bus_info[32]; /* "PCI:" + pci_name(pci_dev) */ | 252 | __u8 bus_info[32]; |
245 | __u32 version; /* should use KERNEL_VERSION() */ | 253 | __u32 version; |
246 | __u32 capabilities; /* Device capabilities */ | 254 | __u32 capabilities; |
247 | __u32 reserved[4]; | 255 | __u32 device_caps; |
256 | __u32 reserved[3]; | ||
248 | }; | 257 | }; |
249 | 258 | ||
250 | /* Values for 'capabilities' field */ | 259 | /* Values for 'capabilities' field */ |
@@ -274,6 +283,8 @@ struct v4l2_capability { | |||
274 | #define V4L2_CAP_ASYNCIO 0x02000000 /* async I/O */ | 283 | #define V4L2_CAP_ASYNCIO 0x02000000 /* async I/O */ |
275 | #define V4L2_CAP_STREAMING 0x04000000 /* streaming I/O ioctls */ | 284 | #define V4L2_CAP_STREAMING 0x04000000 /* streaming I/O ioctls */ |
276 | 285 | ||
286 | #define V4L2_CAP_DEVICE_CAPS 0x80000000 /* sets device capabilities field */ | ||
287 | |||
277 | /* | 288 | /* |
278 | * V I D E O I M A G E F O R M A T | 289 | * V I D E O I M A G E F O R M A T |
279 | */ | 290 | */ |
@@ -751,20 +762,20 @@ struct v4l2_crop { | |||
751 | 762 | ||
752 | /* Selection targets */ | 763 | /* Selection targets */ |
753 | 764 | ||
754 | /* current cropping area */ | 765 | /* Current cropping area */ |
755 | #define V4L2_SEL_TGT_CROP_ACTIVE 0 | 766 | #define V4L2_SEL_TGT_CROP_ACTIVE 0x0000 |
756 | /* default cropping area */ | 767 | /* Default cropping area */ |
757 | #define V4L2_SEL_TGT_CROP_DEFAULT 1 | 768 | #define V4L2_SEL_TGT_CROP_DEFAULT 0x0001 |
758 | /* cropping bounds */ | 769 | /* Cropping bounds */ |
759 | #define V4L2_SEL_TGT_CROP_BOUNDS 2 | 770 | #define V4L2_SEL_TGT_CROP_BOUNDS 0x0002 |
760 | /* current composing area */ | 771 | /* Current composing area */ |
761 | #define V4L2_SEL_TGT_COMPOSE_ACTIVE 256 | 772 | #define V4L2_SEL_TGT_COMPOSE_ACTIVE 0x0100 |
762 | /* default composing area */ | 773 | /* Default composing area */ |
763 | #define V4L2_SEL_TGT_COMPOSE_DEFAULT 257 | 774 | #define V4L2_SEL_TGT_COMPOSE_DEFAULT 0x0101 |
764 | /* composing bounds */ | 775 | /* Composing bounds */ |
765 | #define V4L2_SEL_TGT_COMPOSE_BOUNDS 258 | 776 | #define V4L2_SEL_TGT_COMPOSE_BOUNDS 0x0102 |
766 | /* current composing area plus all padding pixels */ | 777 | /* Current composing area plus all padding pixels */ |
767 | #define V4L2_SEL_TGT_COMPOSE_PADDED 259 | 778 | #define V4L2_SEL_TGT_COMPOSE_PADDED 0x0103 |
768 | 779 | ||
769 | /** | 780 | /** |
770 | * struct v4l2_selection - selection info | 781 | * struct v4l2_selection - selection info |
@@ -774,7 +785,7 @@ struct v4l2_crop { | |||
774 | * @r: coordinates of selection window | 785 | * @r: coordinates of selection window |
775 | * @reserved: for future use, rounds structure size to 64 bytes, set to zero | 786 | * @reserved: for future use, rounds structure size to 64 bytes, set to zero |
776 | * | 787 | * |
777 | * Hardware may use multiple helper window to process a video stream. | 788 | * Hardware may use multiple helper windows to process a video stream. |
778 | * The structure is used to exchange this selection areas between | 789 | * The structure is used to exchange this selection areas between |
779 | * an application and a driver. | 790 | * an application and a driver. |
780 | */ | 791 | */ |
@@ -1125,6 +1136,7 @@ struct v4l2_ext_controls { | |||
1125 | #define V4L2_CTRL_CLASS_CAMERA 0x009a0000 /* Camera class controls */ | 1136 | #define V4L2_CTRL_CLASS_CAMERA 0x009a0000 /* Camera class controls */ |
1126 | #define V4L2_CTRL_CLASS_FM_TX 0x009b0000 /* FM Modulator control class */ | 1137 | #define V4L2_CTRL_CLASS_FM_TX 0x009b0000 /* FM Modulator control class */ |
1127 | #define V4L2_CTRL_CLASS_FLASH 0x009c0000 /* Camera flash controls */ | 1138 | #define V4L2_CTRL_CLASS_FLASH 0x009c0000 /* Camera flash controls */ |
1139 | #define V4L2_CTRL_CLASS_JPEG 0x009d0000 /* JPEG-compression controls */ | ||
1128 | 1140 | ||
1129 | #define V4L2_CTRL_ID_MASK (0x0fffffff) | 1141 | #define V4L2_CTRL_ID_MASK (0x0fffffff) |
1130 | #define V4L2_CTRL_ID2CLASS(id) ((id) & 0x0fff0000UL) | 1142 | #define V4L2_CTRL_ID2CLASS(id) ((id) & 0x0fff0000UL) |
@@ -1396,6 +1408,16 @@ enum v4l2_mpeg_audio_ac3_bitrate { | |||
1396 | V4L2_MPEG_AUDIO_AC3_BITRATE_576K = 17, | 1408 | V4L2_MPEG_AUDIO_AC3_BITRATE_576K = 17, |
1397 | V4L2_MPEG_AUDIO_AC3_BITRATE_640K = 18, | 1409 | V4L2_MPEG_AUDIO_AC3_BITRATE_640K = 18, |
1398 | }; | 1410 | }; |
1411 | #define V4L2_CID_MPEG_AUDIO_DEC_PLAYBACK (V4L2_CID_MPEG_BASE+112) | ||
1412 | enum v4l2_mpeg_audio_dec_playback { | ||
1413 | V4L2_MPEG_AUDIO_DEC_PLAYBACK_AUTO = 0, | ||
1414 | V4L2_MPEG_AUDIO_DEC_PLAYBACK_STEREO = 1, | ||
1415 | V4L2_MPEG_AUDIO_DEC_PLAYBACK_LEFT = 2, | ||
1416 | V4L2_MPEG_AUDIO_DEC_PLAYBACK_RIGHT = 3, | ||
1417 | V4L2_MPEG_AUDIO_DEC_PLAYBACK_MONO = 4, | ||
1418 | V4L2_MPEG_AUDIO_DEC_PLAYBACK_SWAPPED_STEREO = 5, | ||
1419 | }; | ||
1420 | #define V4L2_CID_MPEG_AUDIO_DEC_MULTILINGUAL_PLAYBACK (V4L2_CID_MPEG_BASE+113) | ||
1399 | 1421 | ||
1400 | /* MPEG video controls specific to multiplexed streams */ | 1422 | /* MPEG video controls specific to multiplexed streams */ |
1401 | #define V4L2_CID_MPEG_VIDEO_ENCODING (V4L2_CID_MPEG_BASE+200) | 1423 | #define V4L2_CID_MPEG_VIDEO_ENCODING (V4L2_CID_MPEG_BASE+200) |
@@ -1446,6 +1468,9 @@ enum v4l2_mpeg_video_multi_slice_mode { | |||
1446 | V4L2_MPEG_VIDEO_MULTI_SICE_MODE_MAX_BYTES = 2, | 1468 | V4L2_MPEG_VIDEO_MULTI_SICE_MODE_MAX_BYTES = 2, |
1447 | }; | 1469 | }; |
1448 | #define V4L2_CID_MPEG_VIDEO_VBV_SIZE (V4L2_CID_MPEG_BASE+222) | 1470 | #define V4L2_CID_MPEG_VIDEO_VBV_SIZE (V4L2_CID_MPEG_BASE+222) |
1471 | #define V4L2_CID_MPEG_VIDEO_DEC_PTS (V4L2_CID_MPEG_BASE+223) | ||
1472 | #define V4L2_CID_MPEG_VIDEO_DEC_FRAME (V4L2_CID_MPEG_BASE+224) | ||
1473 | |||
1449 | #define V4L2_CID_MPEG_VIDEO_H263_I_FRAME_QP (V4L2_CID_MPEG_BASE+300) | 1474 | #define V4L2_CID_MPEG_VIDEO_H263_I_FRAME_QP (V4L2_CID_MPEG_BASE+300) |
1450 | #define V4L2_CID_MPEG_VIDEO_H263_P_FRAME_QP (V4L2_CID_MPEG_BASE+301) | 1475 | #define V4L2_CID_MPEG_VIDEO_H263_P_FRAME_QP (V4L2_CID_MPEG_BASE+301) |
1451 | #define V4L2_CID_MPEG_VIDEO_H263_B_FRAME_QP (V4L2_CID_MPEG_BASE+302) | 1476 | #define V4L2_CID_MPEG_VIDEO_H263_B_FRAME_QP (V4L2_CID_MPEG_BASE+302) |
@@ -1734,6 +1759,29 @@ enum v4l2_flash_strobe_source { | |||
1734 | #define V4L2_CID_FLASH_CHARGE (V4L2_CID_FLASH_CLASS_BASE + 11) | 1759 | #define V4L2_CID_FLASH_CHARGE (V4L2_CID_FLASH_CLASS_BASE + 11) |
1735 | #define V4L2_CID_FLASH_READY (V4L2_CID_FLASH_CLASS_BASE + 12) | 1760 | #define V4L2_CID_FLASH_READY (V4L2_CID_FLASH_CLASS_BASE + 12) |
1736 | 1761 | ||
1762 | /* JPEG-class control IDs defined by V4L2 */ | ||
1763 | #define V4L2_CID_JPEG_CLASS_BASE (V4L2_CTRL_CLASS_JPEG | 0x900) | ||
1764 | #define V4L2_CID_JPEG_CLASS (V4L2_CTRL_CLASS_JPEG | 1) | ||
1765 | |||
1766 | #define V4L2_CID_JPEG_CHROMA_SUBSAMPLING (V4L2_CID_JPEG_CLASS_BASE + 1) | ||
1767 | enum v4l2_jpeg_chroma_subsampling { | ||
1768 | V4L2_JPEG_CHROMA_SUBSAMPLING_444 = 0, | ||
1769 | V4L2_JPEG_CHROMA_SUBSAMPLING_422 = 1, | ||
1770 | V4L2_JPEG_CHROMA_SUBSAMPLING_420 = 2, | ||
1771 | V4L2_JPEG_CHROMA_SUBSAMPLING_411 = 3, | ||
1772 | V4L2_JPEG_CHROMA_SUBSAMPLING_410 = 4, | ||
1773 | V4L2_JPEG_CHROMA_SUBSAMPLING_GRAY = 5, | ||
1774 | }; | ||
1775 | #define V4L2_CID_JPEG_RESTART_INTERVAL (V4L2_CID_JPEG_CLASS_BASE + 2) | ||
1776 | #define V4L2_CID_JPEG_COMPRESSION_QUALITY (V4L2_CID_JPEG_CLASS_BASE + 3) | ||
1777 | |||
1778 | #define V4L2_CID_JPEG_ACTIVE_MARKER (V4L2_CID_JPEG_CLASS_BASE + 4) | ||
1779 | #define V4L2_JPEG_ACTIVE_MARKER_APP0 (1 << 0) | ||
1780 | #define V4L2_JPEG_ACTIVE_MARKER_APP1 (1 << 1) | ||
1781 | #define V4L2_JPEG_ACTIVE_MARKER_COM (1 << 16) | ||
1782 | #define V4L2_JPEG_ACTIVE_MARKER_DQT (1 << 17) | ||
1783 | #define V4L2_JPEG_ACTIVE_MARKER_DHT (1 << 18) | ||
1784 | |||
1737 | /* | 1785 | /* |
1738 | * T U N I N G | 1786 | * T U N I N G |
1739 | */ | 1787 | */ |
@@ -1897,6 +1945,54 @@ struct v4l2_encoder_cmd { | |||
1897 | }; | 1945 | }; |
1898 | }; | 1946 | }; |
1899 | 1947 | ||
1948 | /* Decoder commands */ | ||
1949 | #define V4L2_DEC_CMD_START (0) | ||
1950 | #define V4L2_DEC_CMD_STOP (1) | ||
1951 | #define V4L2_DEC_CMD_PAUSE (2) | ||
1952 | #define V4L2_DEC_CMD_RESUME (3) | ||
1953 | |||
1954 | /* Flags for V4L2_DEC_CMD_START */ | ||
1955 | #define V4L2_DEC_CMD_START_MUTE_AUDIO (1 << 0) | ||
1956 | |||
1957 | /* Flags for V4L2_DEC_CMD_PAUSE */ | ||
1958 | #define V4L2_DEC_CMD_PAUSE_TO_BLACK (1 << 0) | ||
1959 | |||
1960 | /* Flags for V4L2_DEC_CMD_STOP */ | ||
1961 | #define V4L2_DEC_CMD_STOP_TO_BLACK (1 << 0) | ||
1962 | #define V4L2_DEC_CMD_STOP_IMMEDIATELY (1 << 1) | ||
1963 | |||
1964 | /* Play format requirements (returned by the driver): */ | ||
1965 | |||
1966 | /* The decoder has no special format requirements */ | ||
1967 | #define V4L2_DEC_START_FMT_NONE (0) | ||
1968 | /* The decoder requires full GOPs */ | ||
1969 | #define V4L2_DEC_START_FMT_GOP (1) | ||
1970 | |||
1971 | /* The structure must be zeroed before use by the application | ||
1972 | This ensures it can be extended safely in the future. */ | ||
1973 | struct v4l2_decoder_cmd { | ||
1974 | __u32 cmd; | ||
1975 | __u32 flags; | ||
1976 | union { | ||
1977 | struct { | ||
1978 | __u64 pts; | ||
1979 | } stop; | ||
1980 | |||
1981 | struct { | ||
1982 | /* 0 or 1000 specifies normal speed, | ||
1983 | 1 specifies forward single stepping, | ||
1984 | -1 specifies backward single stepping, | ||
1985 | >1: playback at speed/1000 of the normal speed, | ||
1986 | <-1: reverse playback at (-speed/1000) of the normal speed. */ | ||
1987 | __s32 speed; | ||
1988 | __u32 format; | ||
1989 | } start; | ||
1990 | |||
1991 | struct { | ||
1992 | __u32 data[16]; | ||
1993 | } raw; | ||
1994 | }; | ||
1995 | }; | ||
1900 | #endif | 1996 | #endif |
1901 | 1997 | ||
1902 | 1998 | ||
@@ -2307,6 +2403,11 @@ struct v4l2_create_buffers { | |||
2307 | #define VIDIOC_G_SELECTION _IOWR('V', 94, struct v4l2_selection) | 2403 | #define VIDIOC_G_SELECTION _IOWR('V', 94, struct v4l2_selection) |
2308 | #define VIDIOC_S_SELECTION _IOWR('V', 95, struct v4l2_selection) | 2404 | #define VIDIOC_S_SELECTION _IOWR('V', 95, struct v4l2_selection) |
2309 | 2405 | ||
2406 | /* Experimental, these two ioctls may change over the next couple of kernel | ||
2407 | versions. */ | ||
2408 | #define VIDIOC_DECODER_CMD _IOWR('V', 96, struct v4l2_decoder_cmd) | ||
2409 | #define VIDIOC_TRY_DECODER_CMD _IOWR('V', 97, struct v4l2_decoder_cmd) | ||
2410 | |||
2310 | /* Reminder: when adding new ioctls please add support for them to | 2411 | /* Reminder: when adding new ioctls please add support for them to |
2311 | drivers/media/video/v4l2-compat-ioctl32.c as well! */ | 2412 | drivers/media/video/v4l2-compat-ioctl32.c as well! */ |
2312 | 2413 | ||