@@ -2333,6 +2333,15 @@ more information.</para>
</orderedlist>
</section>
</section>
+ <section>
+ <title>V4L2 in Linux 2.6.35</title>
+ <orderedlist>
+ <listitem>
+ <para>Added support for binary data controls via new type <constant>V4L2_CTRL_TYPE_BINARY</constant>.</para>
+ </listitem>
+ </orderedlist>
+ </section>
+ </section>
<section id="other">
<title>Relation of V4L2 to other Linux multimedia APIs</title>
@@ -169,6 +169,7 @@ enum <link linkend="v4l2-ctrl-type">v4l2_ctrl_type</link> {
V4L2_CTRL_TYPE_INTEGER64 = 5,
V4L2_CTRL_TYPE_CTRL_CLASS = 6,
V4L2_CTRL_TYPE_STRING = 7,
+ V4L2_CTRL_TYPE_BINARY = 8,
};
enum <link linkend="v4l2-tuner-type">v4l2_tuner_type</link> {
@@ -913,6 +914,7 @@ struct <link linkend="v4l2-ext-control">v4l2_ext_control</link> {
__s32 value;
__s64 value64;
char *string;
+ unsigned char *blob;
};
} __attribute__ ((packed));
@@ -170,6 +170,12 @@ applications must set the array to zero.</entry>
<entry><structfield>string</structfield></entry>
<entry>A pointer to a string.</entry>
</row>
+ <row>
+ <entry></entry>
+ <entry>unsigned char *</entry>
+ <entry><structfield>blob</structfield></entry>
+ <entry>A pointer to a blob.</entry>
+ </row>
</tbody>
</tgroup>
</table>
@@ -142,9 +142,10 @@ bound for <constant>V4L2_CTRL_TYPE_INTEGER</constant> controls and the
lowest valid index (always 0) for <constant>V4L2_CTRL_TYPE_MENU</constant> controls.
For <constant>V4L2_CTRL_TYPE_STRING</constant> controls the minimum value
gives the minimum length of the string. This length <emphasis>does not include the terminating
-zero</emphasis>. It may not be valid for any other type of control, including
-<constant>V4L2_CTRL_TYPE_INTEGER64</constant> controls. Note that this is a
-signed value.</entry>
+zero</emphasis>. For <constant>V4L2_CTRL_TYPE_BINARY</constant> controls this value
+gives the minimum length of the binary data. It may not be valid for any other type of
+ control, including <constant>V4L2_CTRL_TYPE_INTEGER64</constant> controls. Note that
+ this is a signed value.</entry>
</row>
<row>
<entry>__s32</entry>
@@ -155,7 +156,8 @@ highest valid index for <constant>V4L2_CTRL_TYPE_MENU</constant>
controls.
For <constant>V4L2_CTRL_TYPE_STRING</constant> controls the maximum value
gives the maximum length of the string. This length <emphasis>does not include the terminating
-zero</emphasis>. It may not be valid for any other type of control, including
+zero</emphasis>. For <constant>V4L2_CTRL_TYPE_BINARY</constant> controls this value
+gives the maximum length of the binary data. It may not be valid for any other type of control, including
<constant>V4L2_CTRL_TYPE_INTEGER64</constant> controls. Note that this is a
signed value.</entry>
</row>
@@ -166,8 +168,8 @@ signed value.</entry>
<constant>V4L2_CTRL_TYPE_INTEGER</constant> controls. For
<constant>V4L2_CTRL_TYPE_STRING</constant> controls this field refers to
the string length that has to be a multiple of this step size.
-It may not be valid for any other type of control, including
-<constant>V4L2_CTRL_TYPE_INTEGER64</constant>
+For <constant>V4L2_CTRL_TYPE_BINARY</constant> controls the size of the binary data has to be a multiple of this step size. It may not be valid for any other type of
+control, including <constant>V4L2_CTRL_TYPE_INTEGER64</constant>
controls.</para><para>Generally drivers should not scale hardware
control values. It may be necessary for example when the
<structfield>name</structfield> or <structfield>id</structfield> imply
@@ -319,6 +321,15 @@ Which character encoding is used will depend on the string control itself and
should be part of the control documentation.</entry>
</row>
<row>
+ <entry><constant>V4L2_CTRL_TYPE_BINARY</constant></entry>
+ <entry>≥ 0</entry>
+ <entry>≥ 1</entry>
+ <entry>≥ 0</entry>
+ <entry>The minimum and maximum of the binary data length. The step size
+means that the length must be (minimum + N * step) characters long for
+N ≥ 0. </entry>
+ </row>
+ <row>
<entry><constant>V4L2_CTRL_TYPE_CTRL_CLASS</constant></entry>
<entry>n/a</entry>
<entry>n/a</entry>
@@ -158,6 +158,8 @@ int v4l2_ctrl_check(struct v4l2_ext_control *ctrl, struct v4l2_queryctrl *qctrl,
return -EBUSY;
if (qctrl->type == V4L2_CTRL_TYPE_STRING)
return 0;
+ if (qctrl->type == V4L2_CTRL_TYPE_BINARY)
+ return 0;
if (qctrl->type == V4L2_CTRL_TYPE_BUTTON ||
qctrl->type == V4L2_CTRL_TYPE_INTEGER64 ||
qctrl->type == V4L2_CTRL_TYPE_CTRL_CLASS)
@@ -168,6 +168,7 @@ enum v4l2_ctrl_type {
V4L2_CTRL_TYPE_INTEGER64 = 5,
V4L2_CTRL_TYPE_CTRL_CLASS = 6,
V4L2_CTRL_TYPE_STRING = 7,
+ V4L2_CTRL_TYPE_BINARY = 8,
};
enum v4l2_tuner_type {
@@ -918,6 +919,7 @@ struct v4l2_ext_control {
__s32 value;
__s64 value64;
char *string;
+ unsigned char *blob;
};
} __attribute__ ((packed));