vidioc-g-enc-index.xml 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  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. <para>The <constant>VIDIOC_G_ENC_INDEX</constant> ioctl provides
  46. meta data about a compressed video stream the same or another
  47. application currently reads from the driver, which is useful for
  48. random access into the stream without decoding it.</para>
  49. <para>To read the data applications must call
  50. <constant>VIDIOC_G_ENC_INDEX</constant> with a pointer to a
  51. &v4l2-enc-idx;. On success the driver fills the
  52. <structfield>entry</structfield> array, stores the number of elements
  53. written in the <structfield>entries</structfield> field, and
  54. initializes the <structfield>entries_cap</structfield> field.</para>
  55. <para>Each element of the <structfield>entry</structfield> array
  56. contains meta data about one picture. A
  57. <constant>VIDIOC_G_ENC_INDEX</constant> call reads up to
  58. <constant>V4L2_ENC_IDX_ENTRIES</constant> entries from a driver
  59. buffer, which can hold up to <structfield>entries_cap</structfield>
  60. entries. This number can be lower or higher than
  61. <constant>V4L2_ENC_IDX_ENTRIES</constant>, but not zero. When the
  62. application fails to read the meta data in time the oldest entries
  63. will be lost. When the buffer is empty or no capturing/encoding is in
  64. progress, <structfield>entries</structfield> will be zero.</para>
  65. <para>Currently this ioctl is only defined for MPEG-2 program
  66. streams and video elementary streams.</para>
  67. <table pgwide="1" frame="none" id="v4l2-enc-idx">
  68. <title>struct <structname>v4l2_enc_idx</structname></title>
  69. <tgroup cols="3">
  70. &cs-str;
  71. <tbody valign="top">
  72. <row>
  73. <entry>__u32</entry>
  74. <entry><structfield>entries</structfield></entry>
  75. <entry>The number of entries the driver stored in the
  76. <structfield>entry</structfield> array.</entry>
  77. </row>
  78. <row>
  79. <entry>__u32</entry>
  80. <entry><structfield>entries_cap</structfield></entry>
  81. <entry>The number of entries the driver can
  82. buffer. Must be greater than zero.</entry>
  83. </row>
  84. <row>
  85. <entry>__u32</entry>
  86. <entry><structfield>reserved</structfield>[4]</entry>
  87. <entry spanname="hspan">Reserved for future extensions.
  88. Drivers must set the array to zero.</entry>
  89. </row>
  90. <row>
  91. <entry>&v4l2-enc-idx-entry;</entry>
  92. <entry><structfield>entry</structfield>[<constant>V4L2_ENC_IDX_ENTRIES</constant>]</entry>
  93. <entry>Meta data about a compressed video stream. Each
  94. element of the array corresponds to one picture, sorted in ascending
  95. order by their <structfield>offset</structfield>.</entry>
  96. </row>
  97. </tbody>
  98. </tgroup>
  99. </table>
  100. <table pgwide="1" frame="none" id="v4l2-enc-idx-entry">
  101. <title>struct <structname>v4l2_enc_idx_entry</structname></title>
  102. <tgroup cols="3">
  103. &cs-str;
  104. <tbody valign="top">
  105. <row>
  106. <entry>__u64</entry>
  107. <entry><structfield>offset</structfield></entry>
  108. <entry>The offset in bytes from the beginning of the
  109. compressed video stream to the beginning of this picture, that is a
  110. <wordasword>PES packet header</wordasword> as defined in <xref
  111. linkend="mpeg2part1" /> or a <wordasword>picture
  112. header</wordasword> as defined in <xref linkend="mpeg2part2" />. When
  113. the encoder is stopped, the driver resets the offset to zero.</entry>
  114. </row>
  115. <row>
  116. <entry>__u64</entry>
  117. <entry><structfield>pts</structfield></entry>
  118. <entry>The 33 bit <wordasword>Presentation Time
  119. Stamp</wordasword> of this picture as defined in <xref
  120. linkend="mpeg2part1" />.</entry>
  121. </row>
  122. <row>
  123. <entry>__u32</entry>
  124. <entry><structfield>length</structfield></entry>
  125. <entry>The length of this picture in bytes.</entry>
  126. </row>
  127. <row>
  128. <entry>__u32</entry>
  129. <entry><structfield>flags</structfield></entry>
  130. <entry>Flags containing the coding type of this picture, see <xref
  131. linkend="enc-idx-flags" />.</entry>
  132. </row>
  133. <row>
  134. <entry>__u32</entry>
  135. <entry><structfield>reserved</structfield>[2]</entry>
  136. <entry>Reserved for future extensions.
  137. Drivers must set the array to zero.</entry>
  138. </row>
  139. </tbody>
  140. </tgroup>
  141. </table>
  142. <table pgwide="1" frame="none" id="enc-idx-flags">
  143. <title>Index Entry Flags</title>
  144. <tgroup cols="3">
  145. &cs-def;
  146. <tbody valign="top">
  147. <row>
  148. <entry><constant>V4L2_ENC_IDX_FRAME_I</constant></entry>
  149. <entry>0x00</entry>
  150. <entry>This is an Intra-coded picture.</entry>
  151. </row>
  152. <row>
  153. <entry><constant>V4L2_ENC_IDX_FRAME_P</constant></entry>
  154. <entry>0x01</entry>
  155. <entry>This is a Predictive-coded picture.</entry>
  156. </row>
  157. <row>
  158. <entry><constant>V4L2_ENC_IDX_FRAME_B</constant></entry>
  159. <entry>0x02</entry>
  160. <entry>This is a Bidirectionally predictive-coded
  161. picture.</entry>
  162. </row>
  163. <row>
  164. <entry><constant>V4L2_ENC_IDX_FRAME_MASK</constant></entry>
  165. <entry>0x0F</entry>
  166. <entry><wordasword>AND</wordasword> the flags field with
  167. this mask to obtain the picture coding type.</entry>
  168. </row>
  169. </tbody>
  170. </tgroup>
  171. </table>
  172. </refsect1>
  173. <refsect1>
  174. &return-value;
  175. </refsect1>
  176. </refentry>