video-get-event.rst 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. .. -*- coding: utf-8; mode: rst -*-
  2. .. _VIDEO_GET_EVENT:
  3. ===============
  4. VIDEO_GET_EVENT
  5. ===============
  6. Name
  7. ----
  8. VIDEO_GET_EVENT
  9. .. attention:: This ioctl is deprecated.
  10. Synopsis
  11. --------
  12. .. c:function:: int ioctl(fd, VIDEO_GET_EVENT, struct video_event *ev)
  13. :name: VIDEO_GET_EVENT
  14. Arguments
  15. ---------
  16. .. flat-table::
  17. :header-rows: 0
  18. :stub-columns: 0
  19. - .. row 1
  20. - int fd
  21. - File descriptor returned by a previous call to open().
  22. - .. row 2
  23. - int request
  24. - Equals VIDEO_GET_EVENT for this command.
  25. - .. row 3
  26. - struct video_event \*ev
  27. - Points to the location where the event, if any, is to be stored.
  28. Description
  29. -----------
  30. This ioctl is for Digital TV devices only. To get events from a V4L2 decoder
  31. use the V4L2 :ref:`VIDIOC_DQEVENT` ioctl instead.
  32. This ioctl call returns an event of type video_event if available. If
  33. an event is not available, the behavior depends on whether the device is
  34. in blocking or non-blocking mode. In the latter case, the call fails
  35. immediately with errno set to ``EWOULDBLOCK``. In the former case, the call
  36. blocks until an event becomes available. The standard Linux poll()
  37. and/or select() system calls can be used with the device file descriptor
  38. to watch for new events. For select(), the file descriptor should be
  39. included in the exceptfds argument, and for poll(), POLLPRI should be
  40. specified as the wake-up condition. Read-only permissions are sufficient
  41. for this ioctl call.
  42. .. c:type:: video_event
  43. .. code-block:: c
  44. struct video_event {
  45. __s32 type;
  46. #define VIDEO_EVENT_SIZE_CHANGED 1
  47. #define VIDEO_EVENT_FRAME_RATE_CHANGED 2
  48. #define VIDEO_EVENT_DECODER_STOPPED 3
  49. #define VIDEO_EVENT_VSYNC 4
  50. __kernel_time_t timestamp;
  51. union {
  52. video_size_t size;
  53. unsigned int frame_rate; /* in frames per 1000sec */
  54. unsigned char vsync_field; /* unknown/odd/even/progressive */
  55. } u;
  56. };
  57. Return Value
  58. ------------
  59. On success 0 is returned, on error -1 and the ``errno`` variable is set
  60. appropriately. The generic error codes are described at the
  61. :ref:`Generic Error Codes <gen-errors>` chapter.
  62. .. flat-table::
  63. :header-rows: 0
  64. :stub-columns: 0
  65. - .. row 1
  66. - ``EWOULDBLOCK``
  67. - There is no event pending, and the device is in non-blocking mode.
  68. - .. row 2
  69. - ``EOVERFLOW``
  70. - Overflow in event queue - one or more events were lost.