diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2011-11-24 07:53:43 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-02-14 10:41:42 -0500 |
commit | a45c0ad51d344dad18c6fb67304b4f87cf0ffd59 (patch) | |
tree | acdd8cac43a26db7f5d993adffb5e7e6a2634498 /include/linux/videodev2.h | |
parent | 32d7e63c1f4f86ad18404e3f36be99c9910fae9b (diff) |
[media] v4l2: add VIDIOC_(TRY_)DECODER_CMD
As discussed during the 2011 V4L-DVB workshop, the API in dvb/video.h should
be replaced by a proper V4L2 API. This patch turns the VIDEO_(TRY_)DECODER_CMD
ioctls into proper V4L2 ioctls.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'include/linux/videodev2.h')
-rw-r--r-- | include/linux/videodev2.h | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index 0db05033c2ec..e4ba8d77196d 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h | |||
@@ -1908,6 +1908,54 @@ struct v4l2_encoder_cmd { | |||
1908 | }; | 1908 | }; |
1909 | }; | 1909 | }; |
1910 | 1910 | ||
1911 | /* Decoder commands */ | ||
1912 | #define V4L2_DEC_CMD_START (0) | ||
1913 | #define V4L2_DEC_CMD_STOP (1) | ||
1914 | #define V4L2_DEC_CMD_PAUSE (2) | ||
1915 | #define V4L2_DEC_CMD_RESUME (3) | ||
1916 | |||
1917 | /* Flags for V4L2_DEC_CMD_START */ | ||
1918 | #define V4L2_DEC_CMD_START_MUTE_AUDIO (1 << 0) | ||
1919 | |||
1920 | /* Flags for V4L2_DEC_CMD_PAUSE */ | ||
1921 | #define V4L2_DEC_CMD_PAUSE_TO_BLACK (1 << 0) | ||
1922 | |||
1923 | /* Flags for V4L2_DEC_CMD_STOP */ | ||
1924 | #define V4L2_DEC_CMD_STOP_TO_BLACK (1 << 0) | ||
1925 | #define V4L2_DEC_CMD_STOP_IMMEDIATELY (1 << 1) | ||
1926 | |||
1927 | /* Play format requirements (returned by the driver): */ | ||
1928 | |||
1929 | /* The decoder has no special format requirements */ | ||
1930 | #define V4L2_DEC_START_FMT_NONE (0) | ||
1931 | /* The decoder requires full GOPs */ | ||
1932 | #define V4L2_DEC_START_FMT_GOP (1) | ||
1933 | |||
1934 | /* The structure must be zeroed before use by the application | ||
1935 | This ensures it can be extended safely in the future. */ | ||
1936 | struct v4l2_decoder_cmd { | ||
1937 | __u32 cmd; | ||
1938 | __u32 flags; | ||
1939 | union { | ||
1940 | struct { | ||
1941 | __u64 pts; | ||
1942 | } stop; | ||
1943 | |||
1944 | struct { | ||
1945 | /* 0 or 1000 specifies normal speed, | ||
1946 | 1 specifies forward single stepping, | ||
1947 | -1 specifies backward single stepping, | ||
1948 | >1: playback at speed/1000 of the normal speed, | ||
1949 | <-1: reverse playback at (-speed/1000) of the normal speed. */ | ||
1950 | __s32 speed; | ||
1951 | __u32 format; | ||
1952 | } start; | ||
1953 | |||
1954 | struct { | ||
1955 | __u32 data[16]; | ||
1956 | } raw; | ||
1957 | }; | ||
1958 | }; | ||
1911 | #endif | 1959 | #endif |
1912 | 1960 | ||
1913 | 1961 | ||
@@ -2318,6 +2366,11 @@ struct v4l2_create_buffers { | |||
2318 | #define VIDIOC_G_SELECTION _IOWR('V', 94, struct v4l2_selection) | 2366 | #define VIDIOC_G_SELECTION _IOWR('V', 94, struct v4l2_selection) |
2319 | #define VIDIOC_S_SELECTION _IOWR('V', 95, struct v4l2_selection) | 2367 | #define VIDIOC_S_SELECTION _IOWR('V', 95, struct v4l2_selection) |
2320 | 2368 | ||
2369 | /* Experimental, these two ioctls may change over the next couple of kernel | ||
2370 | versions. */ | ||
2371 | #define VIDIOC_DECODER_CMD _IOWR('V', 96, struct v4l2_decoder_cmd) | ||
2372 | #define VIDIOC_TRY_DECODER_CMD _IOWR('V', 97, struct v4l2_decoder_cmd) | ||
2373 | |||
2321 | /* Reminder: when adding new ioctls please add support for them to | 2374 | /* Reminder: when adding new ioctls please add support for them to |
2322 | drivers/media/video/v4l2-compat-ioctl32.c as well! */ | 2375 | drivers/media/video/v4l2-compat-ioctl32.c as well! */ |
2323 | 2376 | ||