vidioc-enum-freq-bands.rst 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. .. -*- coding: utf-8; mode: rst -*-
  2. .. _VIDIOC_ENUM_FREQ_BANDS:
  3. ****************************
  4. ioctl VIDIOC_ENUM_FREQ_BANDS
  5. ****************************
  6. Name
  7. ====
  8. VIDIOC_ENUM_FREQ_BANDS - Enumerate supported frequency bands
  9. Synopsis
  10. ========
  11. .. c:function:: int ioctl( int fd, VIDIOC_ENUM_FREQ_BANDS, struct v4l2_frequency_band *argp )
  12. :name: VIDIOC_ENUM_FREQ_BANDS
  13. Arguments
  14. =========
  15. ``fd``
  16. File descriptor returned by :ref:`open() <func-open>`.
  17. ``argp``
  18. Description
  19. ===========
  20. Enumerates the frequency bands that a tuner or modulator supports. To do
  21. this applications initialize the ``tuner``, ``type`` and ``index``
  22. fields, and zero out the ``reserved`` array of a struct
  23. :c:type:`v4l2_frequency_band` and call the
  24. :ref:`VIDIOC_ENUM_FREQ_BANDS` ioctl with a pointer to this structure.
  25. This ioctl is supported if the ``V4L2_TUNER_CAP_FREQ_BANDS`` capability
  26. of the corresponding tuner/modulator is set.
  27. .. tabularcolumns:: |p{2.9cm}|p{2.9cm}|p{5.8cm}|p{2.9cm}|p{3.0cm}|
  28. .. c:type:: v4l2_frequency_band
  29. .. flat-table:: struct v4l2_frequency_band
  30. :header-rows: 0
  31. :stub-columns: 0
  32. :widths: 1 1 2 1 1
  33. * - __u32
  34. - ``tuner``
  35. - The tuner or modulator index number. This is the same value as in
  36. the struct :c:type:`v4l2_input` ``tuner`` field and
  37. the struct :c:type:`v4l2_tuner` ``index`` field, or
  38. the struct :c:type:`v4l2_output` ``modulator`` field
  39. and the struct :c:type:`v4l2_modulator` ``index``
  40. field.
  41. * - __u32
  42. - ``type``
  43. - The tuner type. This is the same value as in the struct
  44. :c:type:`v4l2_tuner` ``type`` field. The type must be
  45. set to ``V4L2_TUNER_RADIO`` for ``/dev/radioX`` device nodes, and
  46. to ``V4L2_TUNER_ANALOG_TV`` for all others. Set this field to
  47. ``V4L2_TUNER_RADIO`` for modulators (currently only radio
  48. modulators are supported). See :c:type:`v4l2_tuner_type`
  49. * - __u32
  50. - ``index``
  51. - Identifies the frequency band, set by the application.
  52. * - __u32
  53. - ``capability``
  54. - :cspan:`2` The tuner/modulator capability flags for this
  55. frequency band, see :ref:`tuner-capability`. The
  56. ``V4L2_TUNER_CAP_LOW`` or ``V4L2_TUNER_CAP_1HZ`` capability must
  57. be the same for all frequency bands of the selected
  58. tuner/modulator. So either all bands have that capability set, or
  59. none of them have that capability.
  60. * - __u32
  61. - ``rangelow``
  62. - :cspan:`2` The lowest tunable frequency in units of 62.5 kHz, or
  63. if the ``capability`` flag ``V4L2_TUNER_CAP_LOW`` is set, in units
  64. of 62.5 Hz, for this frequency band. A 1 Hz unit is used when the
  65. ``capability`` flag ``V4L2_TUNER_CAP_1HZ`` is set.
  66. * - __u32
  67. - ``rangehigh``
  68. - :cspan:`2` The highest tunable frequency in units of 62.5 kHz,
  69. or if the ``capability`` flag ``V4L2_TUNER_CAP_LOW`` is set, in
  70. units of 62.5 Hz, for this frequency band. A 1 Hz unit is used
  71. when the ``capability`` flag ``V4L2_TUNER_CAP_1HZ`` is set.
  72. * - __u32
  73. - ``modulation``
  74. - :cspan:`2` The supported modulation systems of this frequency
  75. band. See :ref:`band-modulation`.
  76. .. note::
  77. Currently only one modulation system per frequency band
  78. is supported. More work will need to be done if multiple
  79. modulation systems are possible. Contact the linux-media
  80. mailing list
  81. (`https://linuxtv.org/lists.php <https://linuxtv.org/lists.php>`__)
  82. if you need such functionality.
  83. * - __u32
  84. - ``reserved``\ [9]
  85. - Reserved for future extensions.
  86. Applications and drivers must set the array to zero.
  87. .. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
  88. .. _band-modulation:
  89. .. flat-table:: Band Modulation Systems
  90. :header-rows: 0
  91. :stub-columns: 0
  92. :widths: 3 1 4
  93. * - ``V4L2_BAND_MODULATION_VSB``
  94. - 0x02
  95. - Vestigial Sideband modulation, used for analog TV.
  96. * - ``V4L2_BAND_MODULATION_FM``
  97. - 0x04
  98. - Frequency Modulation, commonly used for analog radio.
  99. * - ``V4L2_BAND_MODULATION_AM``
  100. - 0x08
  101. - Amplitude Modulation, commonly used for analog radio.
  102. Return Value
  103. ============
  104. On success 0 is returned, on error -1 and the ``errno`` variable is set
  105. appropriately. The generic error codes are described at the
  106. :ref:`Generic Error Codes <gen-errors>` chapter.
  107. EINVAL
  108. The ``tuner`` or ``index`` is out of bounds or the ``type`` field is
  109. wrong.