Commit | Line | Data |
---|---|---|
47d23e36 MCC |
1 | .. -*- coding: utf-8; mode: rst -*- |
2 | ||
3 | .. _VIDEO_GET_EVENT: | |
4 | ||
586027ce | 5 | =============== |
47d23e36 MCC |
6 | VIDEO_GET_EVENT |
7 | =============== | |
8 | ||
15e7d615 | 9 | Name |
586027ce | 10 | ---- |
47d23e36 | 11 | |
586027ce | 12 | VIDEO_GET_EVENT |
47d23e36 | 13 | |
cf8076c3 | 14 | .. attention:: This ioctl is deprecated. |
15e7d615 MCC |
15 | |
16 | Synopsis | |
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 | 23 | Arguments |
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 | 50 | Description |
586027ce MCC |
51 | ----------- |
52 | ||
53 | This ioctl is for DVB 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 | ||
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 | 85 | Return Value |
47d23e36 MCC |
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 | ||
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. |