18c2ecf20Sopenharmony_ci.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
28c2ecf20Sopenharmony_ci.. c:namespace:: DTV.video
38c2ecf20Sopenharmony_ci
48c2ecf20Sopenharmony_ci.. _VIDEO_GET_EVENT:
58c2ecf20Sopenharmony_ci
68c2ecf20Sopenharmony_ci===============
78c2ecf20Sopenharmony_ciVIDEO_GET_EVENT
88c2ecf20Sopenharmony_ci===============
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_ciName
118c2ecf20Sopenharmony_ci----
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_ciVIDEO_GET_EVENT
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_ci.. attention:: This ioctl is deprecated.
168c2ecf20Sopenharmony_ci
178c2ecf20Sopenharmony_ciSynopsis
188c2ecf20Sopenharmony_ci--------
198c2ecf20Sopenharmony_ci
208c2ecf20Sopenharmony_ci.. c:macro:: VIDEO_GET_EVENT
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ci``int ioctl(fd, VIDEO_GET_EVENT, struct video_event *ev)``
238c2ecf20Sopenharmony_ci
248c2ecf20Sopenharmony_ciArguments
258c2ecf20Sopenharmony_ci---------
268c2ecf20Sopenharmony_ci
278c2ecf20Sopenharmony_ci.. flat-table::
288c2ecf20Sopenharmony_ci    :header-rows:  0
298c2ecf20Sopenharmony_ci    :stub-columns: 0
308c2ecf20Sopenharmony_ci
318c2ecf20Sopenharmony_ci    -  .. row 1
328c2ecf20Sopenharmony_ci
338c2ecf20Sopenharmony_ci       -  int fd
348c2ecf20Sopenharmony_ci
358c2ecf20Sopenharmony_ci       -  File descriptor returned by a previous call to open().
368c2ecf20Sopenharmony_ci
378c2ecf20Sopenharmony_ci    -  .. row 2
388c2ecf20Sopenharmony_ci
398c2ecf20Sopenharmony_ci       -  int request
408c2ecf20Sopenharmony_ci
418c2ecf20Sopenharmony_ci       -  Equals VIDEO_GET_EVENT for this command.
428c2ecf20Sopenharmony_ci
438c2ecf20Sopenharmony_ci    -  .. row 3
448c2ecf20Sopenharmony_ci
458c2ecf20Sopenharmony_ci       -  struct video_event \*ev
468c2ecf20Sopenharmony_ci
478c2ecf20Sopenharmony_ci       -  Points to the location where the event, if any, is to be stored.
488c2ecf20Sopenharmony_ci
498c2ecf20Sopenharmony_ciDescription
508c2ecf20Sopenharmony_ci-----------
518c2ecf20Sopenharmony_ci
528c2ecf20Sopenharmony_ciThis ioctl is for Digital TV devices only. To get events from a V4L2 decoder
538c2ecf20Sopenharmony_ciuse the V4L2 :ref:`VIDIOC_DQEVENT` ioctl instead.
548c2ecf20Sopenharmony_ci
558c2ecf20Sopenharmony_ciThis ioctl call returns an event of type video_event if available. If
568c2ecf20Sopenharmony_cian event is not available, the behavior depends on whether the device is
578c2ecf20Sopenharmony_ciin blocking or non-blocking mode. In the latter case, the call fails
588c2ecf20Sopenharmony_ciimmediately with errno set to ``EWOULDBLOCK``. In the former case, the call
598c2ecf20Sopenharmony_ciblocks until an event becomes available. The standard Linux poll()
608c2ecf20Sopenharmony_ciand/or select() system calls can be used with the device file descriptor
618c2ecf20Sopenharmony_cito watch for new events. For select(), the file descriptor should be
628c2ecf20Sopenharmony_ciincluded in the exceptfds argument, and for poll(), POLLPRI should be
638c2ecf20Sopenharmony_cispecified as the wake-up condition. Read-only permissions are sufficient
648c2ecf20Sopenharmony_cifor this ioctl call.
658c2ecf20Sopenharmony_ci
668c2ecf20Sopenharmony_ci.. c:type:: video_event
678c2ecf20Sopenharmony_ci
688c2ecf20Sopenharmony_ci.. code-block:: c
698c2ecf20Sopenharmony_ci
708c2ecf20Sopenharmony_ci	struct video_event {
718c2ecf20Sopenharmony_ci		__s32 type;
728c2ecf20Sopenharmony_ci	#define VIDEO_EVENT_SIZE_CHANGED	1
738c2ecf20Sopenharmony_ci	#define VIDEO_EVENT_FRAME_RATE_CHANGED	2
748c2ecf20Sopenharmony_ci	#define VIDEO_EVENT_DECODER_STOPPED 	3
758c2ecf20Sopenharmony_ci	#define VIDEO_EVENT_VSYNC 		4
768c2ecf20Sopenharmony_ci		long timestamp;
778c2ecf20Sopenharmony_ci		union {
788c2ecf20Sopenharmony_ci			video_size_t size;
798c2ecf20Sopenharmony_ci			unsigned int frame_rate;	/* in frames per 1000sec */
808c2ecf20Sopenharmony_ci			unsigned char vsync_field;	/* unknown/odd/even/progressive */
818c2ecf20Sopenharmony_ci		} u;
828c2ecf20Sopenharmony_ci	};
838c2ecf20Sopenharmony_ci
848c2ecf20Sopenharmony_ciReturn Value
858c2ecf20Sopenharmony_ci------------
868c2ecf20Sopenharmony_ci
878c2ecf20Sopenharmony_ciOn success 0 is returned, on error -1 and the ``errno`` variable is set
888c2ecf20Sopenharmony_ciappropriately. The generic error codes are described at the
898c2ecf20Sopenharmony_ci:ref:`Generic Error Codes <gen-errors>` chapter.
908c2ecf20Sopenharmony_ci
918c2ecf20Sopenharmony_ci.. flat-table::
928c2ecf20Sopenharmony_ci    :header-rows:  0
938c2ecf20Sopenharmony_ci    :stub-columns: 0
948c2ecf20Sopenharmony_ci
958c2ecf20Sopenharmony_ci    -  .. row 1
968c2ecf20Sopenharmony_ci
978c2ecf20Sopenharmony_ci       -  ``EWOULDBLOCK``
988c2ecf20Sopenharmony_ci
998c2ecf20Sopenharmony_ci       -  There is no event pending, and the device is in non-blocking mode.
1008c2ecf20Sopenharmony_ci
1018c2ecf20Sopenharmony_ci    -  .. row 2
1028c2ecf20Sopenharmony_ci
1038c2ecf20Sopenharmony_ci       -  ``EOVERFLOW``
1048c2ecf20Sopenharmony_ci
1058c2ecf20Sopenharmony_ci       -  Overflow in event queue - one or more events were lost.
106