Merge tag 'nfs-for-4.14-2' of git://git.linux-nfs.org/projects/trondmy/linux-nfs
[sfrench/cifs-2.6.git] / Documentation / media / uapi / dvb / video-get-event.rst
1 .. -*- coding: utf-8; mode: rst -*-
2
3 .. _VIDEO_GET_EVENT:
4
5 ===============
6 VIDEO_GET_EVENT
7 ===============
8
9 Name
10 ----
11
12 VIDEO_GET_EVENT
13
14 .. attention:: This ioctl is deprecated.
15
16 Synopsis
17 --------
18
19 .. c:function:: int ioctl(fd, VIDEO_GET_EVENT, struct video_event *ev)
20     :name: VIDEO_GET_EVENT
21
22
23 Arguments
24 ---------
25
26 .. flat-table::
27     :header-rows:  0
28     :stub-columns: 0
29
30
31     -  .. row 1
32
33        -  int fd
34
35        -  File descriptor returned by a previous call to open().
36
37     -  .. row 2
38
39        -  int request
40
41        -  Equals VIDEO_GET_EVENT for this command.
42
43     -  .. row 3
44
45        -  struct video_event \*ev
46
47        -  Points to the location where the event, if any, is to be stored.
48
49
50 Description
51 -----------
52
53 This ioctl is for Digital TV devices only. To get events from a V4L2 decoder
54 use the V4L2 :ref:`VIDIOC_DQEVENT` ioctl instead.
55
56 This ioctl call returns an event of type video_event if available. If
57 an event is not available, the behavior depends on whether the device is
58 in blocking or non-blocking mode. In the latter case, the call fails
59 immediately with errno set to ``EWOULDBLOCK``. In the former case, the call
60 blocks until an event becomes available. The standard Linux poll()
61 and/or select() system calls can be used with the device file descriptor
62 to watch for new events. For select(), the file descriptor should be
63 included in the exceptfds argument, and for poll(), POLLPRI should be
64 specified as the wake-up condition. Read-only permissions are sufficient
65 for this ioctl call.
66
67 .. c:type:: video_event
68
69 .. code-block:: c
70
71         struct video_event {
72                 __s32 type;
73         #define VIDEO_EVENT_SIZE_CHANGED        1
74         #define VIDEO_EVENT_FRAME_RATE_CHANGED  2
75         #define VIDEO_EVENT_DECODER_STOPPED     3
76         #define VIDEO_EVENT_VSYNC               4
77                 __kernel_time_t timestamp;
78                 union {
79                         video_size_t size;
80                         unsigned int frame_rate;        /* in frames per 1000sec */
81                         unsigned char vsync_field;      /* unknown/odd/even/progressive */
82                 } u;
83         };
84
85 Return Value
86 ------------
87
88 On success 0 is returned, on error -1 and the ``errno`` variable is set
89 appropriately. The generic error codes are described at the
90 :ref:`Generic Error Codes <gen-errors>` chapter.
91
92 .. flat-table::
93     :header-rows:  0
94     :stub-columns: 0
95
96
97     -  .. row 1
98
99        -  ``EWOULDBLOCK``
100
101        -  There is no event pending, and the device is in non-blocking mode.
102
103     -  .. row 2
104
105        -  ``EOVERFLOW``
106
107        -  Overflow in event queue - one or more events were lost.