1 .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
2 .. c:namespace:: DTV.video
15 .. attention:: This ioctl is deprecated.
20 .. c:macro:: VIDEO_GET_EVENT
22 ``int ioctl(fd, VIDEO_GET_EVENT, struct video_event *ev)``
35 - File descriptor returned by a previous call to open().
41 - Equals VIDEO_GET_EVENT for this command.
45 - struct video_event \*ev
47 - Points to the location where the event, if any, is to be stored.
52 This ioctl is for Digital TV devices only. To get events from a V4L2 decoder
53 use the V4L2 :ref:`VIDIOC_DQEVENT` ioctl instead.
55 This ioctl call returns an event of type video_event if available. If
56 an event is not available, the behavior depends on whether the device is
57 in blocking or non-blocking mode. In the latter case, the call fails
58 immediately with errno set to ``EWOULDBLOCK``. In the former case, the call
59 blocks until an event becomes available. The standard Linux poll()
60 and/or select() system calls can be used with the device file descriptor
61 to watch for new events. For select(), the file descriptor should be
62 included in the exceptfds argument, and for poll(), POLLPRI should be
63 specified as the wake-up condition. Read-only permissions are sufficient
66 .. c:type:: video_event
72 #define VIDEO_EVENT_SIZE_CHANGED 1
73 #define VIDEO_EVENT_FRAME_RATE_CHANGED 2
74 #define VIDEO_EVENT_DECODER_STOPPED 3
75 #define VIDEO_EVENT_VSYNC 4
79 unsigned int frame_rate; /* in frames per 1000sec */
80 unsigned char vsync_field; /* unknown/odd/even/progressive */
87 On success 0 is returned, on error -1 and the ``errno`` variable is set
88 appropriately. The generic error codes are described at the
89 :ref:`Generic Error Codes <gen-errors>` chapter.
99 - There is no event pending, and the device is in non-blocking mode.
105 - Overflow in event queue - one or more events were lost.