vidioc-g-enc-index.xml 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. <refentry id="vidioc-g-enc-index">
  2. <refmeta>
  3. <refentrytitle>ioctl VIDIOC_G_ENC_INDEX</refentrytitle>
  4. &manvol;
  5. </refmeta>
  6. <refnamediv>
  7. <refname>VIDIOC_G_ENC_INDEX</refname>
  8. <refpurpose>Get meta data about a compressed video stream</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_enc_idx *<parameter>argp</parameter></paramdef>
  17. </funcprototype>
  18. </funcsynopsis>
  19. </refsynopsisdiv>
  20. <refsect1>
  21. <title>Arguments</title>
  22. <variablelist>
  23. <varlistentry>
  24. <term><parameter>fd</parameter></term>
  25. <listitem>
  26. <para>&fd;</para>
  27. </listitem>
  28. </varlistentry>
  29. <varlistentry>
  30. <term><parameter>request</parameter></term>
  31. <listitem>
  32. <para>VIDIOC_G_ENC_INDEX</para>
  33. </listitem>
  34. </varlistentry>
  35. <varlistentry>
  36. <term><parameter>argp</parameter></term>
  37. <listitem>
  38. <para></para>
  39. </listitem>
  40. </varlistentry>
  41. </variablelist>
  42. </refsect1>
  43. <refsect1>
  44. <title>Description</title>
  45. <note>
  46. <title>Experimental</title>
  47. <para>This is an <link linkend="experimental">experimental</link>
  48. interface and may change in the future.</para>
  49. </note>
  50. <para>The <constant>VIDIOC_G_ENC_INDEX</constant> ioctl provides
  51. meta data about a compressed video stream the same or another
  52. application currently reads from the driver, which is useful for
  53. random access into the stream without decoding it.</para>
  54. <para>To read the data applications must call
  55. <constant>VIDIOC_G_ENC_INDEX</constant> with a pointer to a
  56. &v4l2-enc-idx;. On success the driver fills the
  57. <structfield>entry</structfield> array, stores the number of elements
  58. written in the <structfield>entries</structfield> field, and
  59. initializes the <structfield>entries_cap</structfield> field.</para>
  60. <para>Each element of the <structfield>entry</structfield> array
  61. contains meta data about one picture. A
  62. <constant>VIDIOC_G_ENC_INDEX</constant> call reads up to
  63. <constant>V4L2_ENC_IDX_ENTRIES</constant> entries from a driver
  64. buffer, which can hold up to <structfield>entries_cap</structfield>
  65. entries. This number can be lower or higher than
  66. <constant>V4L2_ENC_IDX_ENTRIES</constant>, but not zero. When the
  67. application fails to read the meta data in time the oldest entries
  68. will be lost. When the buffer is empty or no capturing/encoding is in
  69. progress, <structfield>entries</structfield> will be zero.</para>
  70. <para>Currently this ioctl is only defined for MPEG-2 program
  71. streams and video elementary streams.</para>
  72. <table pgwide="1" frame="none" id="v4l2-enc-idx">
  73. <title>struct <structname>v4l2_enc_idx</structname></title>
  74. <tgroup cols="3">
  75. &cs-str;
  76. <tbody valign="top">
  77. <row>
  78. <entry>__u32</entry>
  79. <entry><structfield>entries</structfield></entry>
  80. <entry>The number of entries the driver stored in the
  81. <structfield>entry</structfield> array.</entry>
  82. </row>
  83. <row>
  84. <entry>__u32</entry>
  85. <entry><structfield>entries_cap</structfield></entry>
  86. <entry>The number of entries the driver can
  87. buffer. Must be greater than zero.</entry>
  88. </row>
  89. <row>
  90. <entry>__u32</entry>
  91. <entry><structfield>reserved</structfield>[4]</entry>
  92. <entry spanname="hspan">Reserved for future extensions.
  93. Drivers must set the array to zero.</entry>
  94. </row>
  95. <row>
  96. <entry>&v4l2-enc-idx-entry;</entry>
  97. <entry><structfield>entry</structfield>[<constant>V4L2_ENC_IDX_ENTRIES</constant>]</entry>
  98. <entry>Meta data about a compressed video stream. Each
  99. element of the array corresponds to one picture, sorted in ascending
  100. order by their <structfield>offset</structfield>.</entry>
  101. </row>
  102. </tbody>
  103. </tgroup>
  104. </table>
  105. <table pgwide="1" frame="none" id="v4l2-enc-idx-entry">
  106. <title>struct <structname>v4l2_enc_idx_entry</structname></title>
  107. <tgroup cols="3">
  108. &cs-str;
  109. <tbody valign="top">
  110. <row>
  111. <entry>__u64</entry>
  112. <entry><structfield>offset</structfield></entry>
  113. <entry>The offset in bytes from the beginning of the
  114. compressed video stream to the beginning of this picture, that is a
  115. <wordasword>PES packet header</wordasword> as defined in <xref
  116. linkend="mpeg2part1" /> or a <wordasword>picture
  117. header</wordasword> as defined in <xref linkend="mpeg2part2" />. When
  118. the encoder is stopped, the driver resets the offset to zero.</entry>
  119. </row>
  120. <row>
  121. <entry>__u64</entry>
  122. <entry><structfield>pts</structfield></entry>
  123. <entry>The 33 bit <wordasword>Presentation Time
  124. Stamp</wordasword> of this picture as defined in <xref
  125. linkend="mpeg2part1" />.</entry>
  126. </row>
  127. <row>
  128. <entry>__u32</entry>
  129. <entry><structfield>length</structfield></entry>
  130. <entry>The length of this picture in bytes.</entry>
  131. </row>
  132. <row>
  133. <entry>__u32</entry>
  134. <entry><structfield>flags</structfield></entry>
  135. <entry>Flags containing the coding type of this picture, see <xref
  136. linkend="enc-idx-flags" />.</entry>
  137. </row>
  138. <row>
  139. <entry>__u32</entry>
  140. <entry><structfield>reserved</structfield>[2]</entry>
  141. <entry>Reserved for future extensions.
  142. Drivers must set the array to zero.</entry>
  143. </row>
  144. </tbody>
  145. </tgroup>
  146. </table>
  147. <table pgwide="1" frame="none" id="enc-idx-flags">
  148. <title>Index Entry Flags</title>
  149. <tgroup cols="3">
  150. &cs-def;
  151. <tbody valign="top">
  152. <row>
  153. <entry><constant>V4L2_ENC_IDX_FRAME_I</constant></entry>
  154. <entry>0x00</entry>
  155. <entry>This is an Intra-coded picture.</entry>
  156. </row>
  157. <row>
  158. <entry><constant>V4L2_ENC_IDX_FRAME_P</constant></entry>
  159. <entry>0x01</entry>
  160. <entry>This is a Predictive-coded picture.</entry>
  161. </row>
  162. <row>
  163. <entry><constant>V4L2_ENC_IDX_FRAME_B</constant></entry>
  164. <entry>0x02</entry>
  165. <entry>This is a Bidirectionally predictive-coded
  166. picture.</entry>
  167. </row>
  168. <row>
  169. <entry><constant>V4L2_ENC_IDX_FRAME_MASK</constant></entry>
  170. <entry>0x0F</entry>
  171. <entry><wordasword>AND</wordasword> the flags field with
  172. this mask to obtain the picture coding type.</entry>
  173. </row>
  174. </tbody>
  175. </tgroup>
  176. </table>
  177. </refsect1>
  178. <refsect1>
  179. &return-value;
  180. <variablelist>
  181. <varlistentry>
  182. <term><errorcode>EINVAL</errorcode></term>
  183. <listitem>
  184. <para>The driver does not support this ioctl.</para>
  185. </listitem>
  186. </varlistentry>
  187. </variablelist>
  188. </refsect1>
  189. </refentry>
  190. <!--
  191. Local Variables:
  192. mode: sgml
  193. sgml-parent-document: "v4l2.sgml"
  194. indent-tabs-mode: nil
  195. End:
  196. -->