1<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>struct v4l2_ctrl_handler</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="Linux Device Drivers"><link rel="up" href="mediadev.html#id-1.8.2" title="Video2Linux devices"><link rel="prev" href="API-struct-v4l2-ctrl-ref.html" title="struct v4l2_ctrl_ref"><link rel="next" href="API-struct-v4l2-ctrl-config.html" title="struct v4l2_ctrl_config"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"><span class="phrase">struct v4l2_ctrl_handler</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-struct-v4l2-ctrl-ref.html">Prev</a> </td><th width="60%" align="center">Video2Linux devices</th><td width="20%" align="right"> <a accesskey="n" href="API-struct-v4l2-ctrl-config.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-struct-v4l2-ctrl-handler"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>struct v4l2_ctrl_handler — 2 The control handler keeps track of all the 3 </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="programlisting"> 4struct v4l2_ctrl_handler { 5 struct mutex _lock; 6 struct mutex * lock; 7 struct list_head ctrls; 8 struct list_head ctrl_refs; 9 struct v4l2_ctrl_ref * cached; 10 struct v4l2_ctrl_ref ** buckets; 11 v4l2_ctrl_notify_fnc notify; 12 void * notify_priv; 13 u16 nr_of_buckets; 14 int error; 15}; </pre></div><div class="refsect1"><a name="id-1.8.2.18.5"></a><h2>Members</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term">_lock</span></dt><dd><p> 16 Default for <span class="quote">“<span class="quote">lock</span>”</span>. 17 </p></dd><dt><span class="term">lock</span></dt><dd><p> 18 Lock to control access to this handler and its controls. 19 May be replaced by the user right after init. 20 </p></dd><dt><span class="term">ctrls</span></dt><dd><p> 21 The list of controls owned by this handler. 22 </p></dd><dt><span class="term">ctrl_refs</span></dt><dd><p> 23 The list of control references. 24 </p></dd><dt><span class="term">cached</span></dt><dd><p> 25 The last found control reference. It is common that the same 26 control is needed multiple times, so this is a simple 27 optimization. 28 </p></dd><dt><span class="term">buckets</span></dt><dd><p> 29 Buckets for the hashing. Allows for quick control lookup. 30 </p></dd><dt><span class="term">notify</span></dt><dd><p> 31 A notify callback that is called whenever the control changes value. 32 Note that the handler's lock is held when the notify function 33 is called! 34 </p></dd><dt><span class="term">notify_priv</span></dt><dd><p> 35 Passed as argument to the v4l2_ctrl notify callback. 36 </p></dd><dt><span class="term">nr_of_buckets</span></dt><dd><p> 37 Total number of buckets in the array. 38 </p></dd><dt><span class="term">error</span></dt><dd><p> 39 The error code of the first failed control addition. 40 </p></dd></dl></div></div><div class="refsect1"><a name="id-1.8.2.18.6"></a><h2>controls</h2><p> 41 both the controls owned by the handler and those inherited 42 from other handlers. 43</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-struct-v4l2-ctrl-ref.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="mediadev.html#id-1.8.2">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="API-struct-v4l2-ctrl-config.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">struct v4l2_ctrl_ref</span> </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> <span class="phrase">struct v4l2_ctrl_config</span></td></tr></table></div></body></html> 44