Back to home page

OSCL-LXR

 
 

    


0001 .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
0002 .. c:namespace:: DTV.video
0003 
0004 .. _VIDEO_GET_EVENT:
0005 
0006 ===============
0007 VIDEO_GET_EVENT
0008 ===============
0009 
0010 Name
0011 ----
0012 
0013 VIDEO_GET_EVENT
0014 
0015 .. attention:: This ioctl is deprecated.
0016 
0017 Synopsis
0018 --------
0019 
0020 .. c:macro:: VIDEO_GET_EVENT
0021 
0022 ``int ioctl(fd, VIDEO_GET_EVENT, struct video_event *ev)``
0023 
0024 Arguments
0025 ---------
0026 
0027 .. flat-table::
0028     :header-rows:  0
0029     :stub-columns: 0
0030 
0031     -  .. row 1
0032 
0033        -  int fd
0034 
0035        -  File descriptor returned by a previous call to open().
0036 
0037     -  .. row 2
0038 
0039        -  int request
0040 
0041        -  Equals VIDEO_GET_EVENT for this command.
0042 
0043     -  .. row 3
0044 
0045        -  struct video_event \*ev
0046 
0047        -  Points to the location where the event, if any, is to be stored.
0048 
0049 Description
0050 -----------
0051 
0052 This ioctl is for Digital TV devices only. To get events from a V4L2 decoder
0053 use the V4L2 :ref:`VIDIOC_DQEVENT` ioctl instead.
0054 
0055 This ioctl call returns an event of type video_event if available. If
0056 an event is not available, the behavior depends on whether the device is
0057 in blocking or non-blocking mode. In the latter case, the call fails
0058 immediately with errno set to ``EWOULDBLOCK``. In the former case, the call
0059 blocks until an event becomes available. The standard Linux poll()
0060 and/or select() system calls can be used with the device file descriptor
0061 to watch for new events. For select(), the file descriptor should be
0062 included in the exceptfds argument, and for poll(), POLLPRI should be
0063 specified as the wake-up condition. Read-only permissions are sufficient
0064 for this ioctl call.
0065 
0066 .. c:type:: video_event
0067 
0068 .. code-block:: c
0069 
0070         struct video_event {
0071                 __s32 type;
0072         #define VIDEO_EVENT_SIZE_CHANGED        1
0073         #define VIDEO_EVENT_FRAME_RATE_CHANGED  2
0074         #define VIDEO_EVENT_DECODER_STOPPED     3
0075         #define VIDEO_EVENT_VSYNC               4
0076                 long timestamp;
0077                 union {
0078                         video_size_t size;
0079                         unsigned int frame_rate;        /* in frames per 1000sec */
0080                         unsigned char vsync_field;      /* unknown/odd/even/progressive */
0081                 } u;
0082         };
0083 
0084 Return Value
0085 ------------
0086 
0087 On success 0 is returned, on error -1 and the ``errno`` variable is set
0088 appropriately. The generic error codes are described at the
0089 :ref:`Generic Error Codes <gen-errors>` chapter.
0090 
0091 .. flat-table::
0092     :header-rows:  0
0093     :stub-columns: 0
0094 
0095     -  .. row 1
0096 
0097        -  ``EWOULDBLOCK``
0098 
0099        -  There is no event pending, and the device is in non-blocking mode.
0100 
0101     -  .. row 2
0102 
0103        -  ``EOVERFLOW``
0104 
0105        -  Overflow in event queue - one or more events were lost.