Merge remote-tracking branch 'iommu/next'
[deliverable/linux.git] / Documentation / media / uapi / dvb / video-get-event.rst
CommitLineData
47d23e36
MCC
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _VIDEO_GET_EVENT:
4
586027ce 5===============
47d23e36
MCC
6VIDEO_GET_EVENT
7===============
8
15e7d615 9Name
586027ce 10----
47d23e36 11
586027ce 12VIDEO_GET_EVENT
47d23e36 13
cf8076c3 14.. attention:: This ioctl is deprecated.
15e7d615
MCC
15
16Synopsis
47d23e36
MCC
17--------
18
cf8076c3
MCC
19.. c:function:: int ioctl(fd, VIDEO_GET_EVENT, struct video_event *ev)
20 :name: VIDEO_GET_EVENT
47d23e36 21
47d23e36 22
15e7d615 23Arguments
586027ce 24---------
47d23e36
MCC
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
15e7d615 50Description
586027ce
MCC
51-----------
52
53This ioctl is for DVB devices only. To get events from a V4L2 decoder
54use the V4L2 :ref:`VIDIOC_DQEVENT` ioctl instead.
55
56This ioctl call returns an event of type video_event if available. If
57an event is not available, the behavior depends on whether the device is
58in blocking or non-blocking mode. In the latter case, the call fails
59immediately with errno set to ``EWOULDBLOCK``. In the former case, the call
60blocks until an event becomes available. The standard Linux poll()
61and/or select() system calls can be used with the device file descriptor
62to watch for new events. For select(), the file descriptor should be
63included in the exceptfds argument, and for poll(), POLLPRI should be
64specified as the wake-up condition. Read-only permissions are sufficient
65for this ioctl call.
66
848d1031
MCC
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 };
586027ce 84
15e7d615 85Return Value
47d23e36
MCC
86------------
87
88On success 0 is returned, on error -1 and the ``errno`` variable is set
89appropriately. The generic error codes are described at the
90:ref:`Generic Error Codes <gen-errors>` chapter.
91
47d23e36
MCC
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.
This page took 0.046581 seconds and 5 git commands to generate.