vidioc-subdev-enum-frame-size.xml 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. <refentry id="vidioc-subdev-enum-frame-size">
  2. <refmeta>
  3. <refentrytitle>ioctl VIDIOC_SUBDEV_ENUM_FRAME_SIZE</refentrytitle>
  4. &manvol;
  5. </refmeta>
  6. <refnamediv>
  7. <refname>VIDIOC_SUBDEV_ENUM_FRAME_SIZE</refname>
  8. <refpurpose>Enumerate media bus frame sizes</refpurpose>
  9. </refnamediv>
  10. <refsynopsisdiv>
  11. <funcsynopsis>
  12. <funcprototype>
  13. <funcdef>int <function>ioctl</function></funcdef>
  14. <paramdef>int <parameter>fd</parameter></paramdef>
  15. <paramdef>int <parameter>request</parameter></paramdef>
  16. <paramdef>struct v4l2_subdev_frame_size_enum *
  17. <parameter>argp</parameter></paramdef>
  18. </funcprototype>
  19. </funcsynopsis>
  20. </refsynopsisdiv>
  21. <refsect1>
  22. <title>Arguments</title>
  23. <variablelist>
  24. <varlistentry>
  25. <term><parameter>fd</parameter></term>
  26. <listitem>
  27. <para>&fd;</para>
  28. </listitem>
  29. </varlistentry>
  30. <varlistentry>
  31. <term><parameter>request</parameter></term>
  32. <listitem>
  33. <para>VIDIOC_SUBDEV_ENUM_FRAME_SIZE</para>
  34. </listitem>
  35. </varlistentry>
  36. <varlistentry>
  37. <term><parameter>argp</parameter></term>
  38. <listitem>
  39. <para></para>
  40. </listitem>
  41. </varlistentry>
  42. </variablelist>
  43. </refsect1>
  44. <refsect1>
  45. <title>Description</title>
  46. <note>
  47. <title>Experimental</title>
  48. <para>This is an <link linkend="experimental">experimental</link>
  49. interface and may change in the future.</para>
  50. </note>
  51. <para>This ioctl allows applications to enumerate all frame sizes
  52. supported by a sub-device on the given pad for the given media bus format.
  53. Supported formats can be retrieved with the &VIDIOC-SUBDEV-ENUM-MBUS-CODE;
  54. ioctl.</para>
  55. <para>To enumerate frame sizes applications initialize the
  56. <structfield>pad</structfield>, <structfield>which</structfield> ,
  57. <structfield>code</structfield> and <structfield>index</structfield>
  58. fields of the &v4l2-subdev-mbus-code-enum; and call the
  59. <constant>VIDIOC_SUBDEV_ENUM_FRAME_SIZE</constant> ioctl with a pointer to
  60. the structure. Drivers fill the minimum and maximum frame sizes or return
  61. an &EINVAL; if one of the input parameters is invalid.</para>
  62. <para>Sub-devices that only support discrete frame sizes (such as most
  63. sensors) will return one or more frame sizes with identical minimum and
  64. maximum values.</para>
  65. <para>Not all possible sizes in given [minimum, maximum] ranges need to be
  66. supported. For instance, a scaler that uses a fixed-point scaling ratio
  67. might not be able to produce every frame size between the minimum and
  68. maximum values. Applications must use the &VIDIOC-SUBDEV-S-FMT; ioctl to
  69. try the sub-device for an exact supported frame size.</para>
  70. <para>Available frame sizes may depend on the current 'try' formats at other
  71. pads of the sub-device, as well as on the current active links and the
  72. current values of V4L2 controls. See &VIDIOC-SUBDEV-G-FMT; for more
  73. information about try formats.</para>
  74. <table pgwide="1" frame="none" id="v4l2-subdev-frame-size-enum">
  75. <title>struct <structname>v4l2_subdev_frame_size_enum</structname></title>
  76. <tgroup cols="3">
  77. &cs-str;
  78. <tbody valign="top">
  79. <row>
  80. <entry>__u32</entry>
  81. <entry><structfield>index</structfield></entry>
  82. <entry>Number of the format in the enumeration, set by the
  83. application.</entry>
  84. </row>
  85. <row>
  86. <entry>__u32</entry>
  87. <entry><structfield>pad</structfield></entry>
  88. <entry>Pad number as reported by the media controller API.</entry>
  89. </row>
  90. <row>
  91. <entry>__u32</entry>
  92. <entry><structfield>code</structfield></entry>
  93. <entry>The media bus format code, as defined in
  94. <xref linkend="v4l2-mbus-format" />.</entry>
  95. </row>
  96. <row>
  97. <entry>__u32</entry>
  98. <entry><structfield>min_width</structfield></entry>
  99. <entry>Minimum frame width, in pixels.</entry>
  100. </row>
  101. <row>
  102. <entry>__u32</entry>
  103. <entry><structfield>max_width</structfield></entry>
  104. <entry>Maximum frame width, in pixels.</entry>
  105. </row>
  106. <row>
  107. <entry>__u32</entry>
  108. <entry><structfield>min_height</structfield></entry>
  109. <entry>Minimum frame height, in pixels.</entry>
  110. </row>
  111. <row>
  112. <entry>__u32</entry>
  113. <entry><structfield>max_height</structfield></entry>
  114. <entry>Maximum frame height, in pixels.</entry>
  115. </row>
  116. <row>
  117. <entry>__u32</entry>
  118. <entry><structfield>which</structfield></entry>
  119. <entry>Frame sizes to be enumerated, from &v4l2-subdev-format-whence;.</entry>
  120. </row>
  121. <row>
  122. <entry>__u32</entry>
  123. <entry><structfield>reserved</structfield>[8]</entry>
  124. <entry>Reserved for future extensions. Applications and drivers must
  125. set the array to zero.</entry>
  126. </row>
  127. </tbody>
  128. </tgroup>
  129. </table>
  130. </refsect1>
  131. <refsect1>
  132. &return-value;
  133. <variablelist>
  134. <varlistentry>
  135. <term><errorcode>EINVAL</errorcode></term>
  136. <listitem>
  137. <para>The &v4l2-subdev-frame-size-enum; <structfield>pad</structfield>
  138. references a non-existing pad, the <structfield>code</structfield> is
  139. invalid for the given pad or the <structfield>index</structfield>
  140. field is out of bounds.</para>
  141. </listitem>
  142. </varlistentry>
  143. </variablelist>
  144. </refsect1>
  145. </refentry>