| Laurent Pinchart | 333c8b9 | 2010-03-15 20:26:04 -0300 | [diff] [blame] | 1 | <refentry id="vidioc-subdev-enum-mbus-code"> | 
 | 2 |   <refmeta> | 
 | 3 |     <refentrytitle>ioctl VIDIOC_SUBDEV_ENUM_MBUS_CODE</refentrytitle> | 
 | 4 |     &manvol; | 
 | 5 |   </refmeta> | 
 | 6 |  | 
 | 7 |   <refnamediv> | 
 | 8 |     <refname>VIDIOC_SUBDEV_ENUM_MBUS_CODE</refname> | 
 | 9 |     <refpurpose>Enumerate media bus formats</refpurpose> | 
 | 10 |   </refnamediv> | 
 | 11 |  | 
 | 12 |   <refsynopsisdiv> | 
 | 13 |     <funcsynopsis> | 
 | 14 |       <funcprototype> | 
 | 15 | 	<funcdef>int <function>ioctl</function></funcdef> | 
 | 16 | 	<paramdef>int <parameter>fd</parameter></paramdef> | 
 | 17 | 	<paramdef>int <parameter>request</parameter></paramdef> | 
 | 18 | 	<paramdef>struct v4l2_subdev_mbus_code_enum * | 
 | 19 | 	<parameter>argp</parameter></paramdef> | 
 | 20 |       </funcprototype> | 
 | 21 |     </funcsynopsis> | 
 | 22 |   </refsynopsisdiv> | 
 | 23 |  | 
 | 24 |   <refsect1> | 
 | 25 |     <title>Arguments</title> | 
 | 26 |  | 
 | 27 |     <variablelist> | 
 | 28 |       <varlistentry> | 
 | 29 | 	<term><parameter>fd</parameter></term> | 
 | 30 | 	<listitem> | 
 | 31 | 	  <para>&fd;</para> | 
 | 32 | 	</listitem> | 
 | 33 |       </varlistentry> | 
 | 34 |       <varlistentry> | 
 | 35 | 	<term><parameter>request</parameter></term> | 
 | 36 | 	<listitem> | 
 | 37 | 	  <para>VIDIOC_SUBDEV_ENUM_MBUS_CODE</para> | 
 | 38 | 	</listitem> | 
 | 39 |       </varlistentry> | 
 | 40 |       <varlistentry> | 
 | 41 | 	<term><parameter>argp</parameter></term> | 
 | 42 | 	<listitem> | 
 | 43 | 	  <para></para> | 
 | 44 | 	</listitem> | 
 | 45 |       </varlistentry> | 
 | 46 |     </variablelist> | 
 | 47 |   </refsect1> | 
 | 48 |  | 
 | 49 |   <refsect1> | 
 | 50 |     <title>Description</title> | 
 | 51 |  | 
 | 52 |     <note> | 
 | 53 |       <title>Experimental</title> | 
 | 54 |       <para>This is an <link linkend="experimental">experimental</link> | 
 | 55 |       interface and may change in the future.</para> | 
 | 56 |     </note> | 
 | 57 |  | 
 | 58 |     <para>To enumerate media bus formats available at a given sub-device pad | 
 | 59 |     applications initialize the <structfield>pad</structfield> and | 
 | 60 |     <structfield>index</structfield> fields of &v4l2-subdev-mbus-code-enum; and | 
 | 61 |     call the <constant>VIDIOC_SUBDEV_ENUM_MBUS_CODE</constant> ioctl with a | 
 | 62 |     pointer to this structure. Drivers fill the rest of the structure or return | 
 | 63 |     an &EINVAL; if either the <structfield>pad</structfield> or | 
 | 64 |     <structfield>index</structfield> are invalid. All media bus formats are | 
 | 65 |     enumerable by beginning at index zero and incrementing by one until | 
 | 66 |     <errorcode>EINVAL</errorcode> is returned.</para> | 
 | 67 |  | 
 | 68 |     <para>Available media bus formats may depend on the current 'try' formats | 
 | 69 |     at other pads of the sub-device, as well as on the current active links. See | 
 | 70 |     &VIDIOC-SUBDEV-G-FMT; for more information about the try formats.</para> | 
 | 71 |  | 
 | 72 |     <table pgwide="1" frame="none" id="v4l2-subdev-mbus-code-enum"> | 
 | 73 |       <title>struct <structname>v4l2_subdev_mbus_code_enum</structname></title> | 
 | 74 |       <tgroup cols="3"> | 
 | 75 | 	&cs-str; | 
 | 76 | 	<tbody valign="top"> | 
 | 77 | 	  <row> | 
 | 78 | 	    <entry>__u32</entry> | 
 | 79 | 	    <entry><structfield>pad</structfield></entry> | 
 | 80 | 	    <entry>Pad number as reported by the media controller API.</entry> | 
 | 81 | 	  </row> | 
 | 82 | 	  <row> | 
 | 83 | 	    <entry>__u32</entry> | 
 | 84 | 	    <entry><structfield>index</structfield></entry> | 
 | 85 | 	    <entry>Number of the format in the enumeration, set by the | 
 | 86 | 	    application.</entry> | 
 | 87 | 	  </row> | 
 | 88 | 	  <row> | 
 | 89 | 	    <entry>__u32</entry> | 
 | 90 | 	    <entry><structfield>code</structfield></entry> | 
 | 91 | 	    <entry>The media bus format code, as defined in | 
 | 92 | 	    <xref linkend="v4l2-mbus-format" />.</entry> | 
 | 93 | 	  </row> | 
 | 94 | 	  <row> | 
 | 95 | 	    <entry>__u32</entry> | 
 | 96 | 	    <entry><structfield>reserved</structfield>[9]</entry> | 
 | 97 | 	    <entry>Reserved for future extensions. Applications and drivers must | 
 | 98 | 	    set the array to zero.</entry> | 
 | 99 | 	  </row> | 
 | 100 | 	</tbody> | 
 | 101 |       </tgroup> | 
 | 102 |     </table> | 
 | 103 |   </refsect1> | 
 | 104 |  | 
 | 105 |   <refsect1> | 
 | 106 |     &return-value; | 
 | 107 |  | 
 | 108 |     <variablelist> | 
 | 109 |       <varlistentry> | 
 | 110 | 	<term><errorcode>EINVAL</errorcode></term> | 
 | 111 | 	<listitem> | 
 | 112 | 	  <para>The &v4l2-subdev-mbus-code-enum; <structfield>pad</structfield> | 
 | 113 | 	  references a non-existing pad, or the <structfield>index</structfield> | 
 | 114 | 	  field is out of bounds.</para> | 
 | 115 | 	</listitem> | 
 | 116 |       </varlistentry> | 
 | 117 |     </variablelist> | 
 | 118 |   </refsect1> | 
 | 119 | </refentry> |