]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
[media] media/Documentation: New flag EXECUTE_ON_WRITE
authorRicardo Ribalda <ricardo.ribalda@gmail.com>
Fri, 20 Mar 2015 14:13:14 +0000 (11:13 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Wed, 8 Apr 2015 09:35:16 +0000 (06:35 -0300)
Document new flag V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, and the new behavior
of CH_VALUE event on VOLATILE controls.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Documentation/DocBook/media/v4l/vidioc-dqevent.xml
Documentation/DocBook/media/v4l/vidioc-queryctrl.xml
Documentation/video4linux/v4l2-controls.txt

index a31eea07d4556577c2d3ae518c5ca39bcfa376c8..50ccd33948c1cbee6fb8bbd28864681780c1b833 100644 (file)
            <entry><constant>V4L2_EVENT_CTRL_CH_VALUE</constant></entry>
            <entry>0x0001</entry>
            <entry>This control event was triggered because the value of the control
-               changed. Special case: if a button control is pressed, then this
-               event is sent as well, even though there is not explicit value
-               associated with a button control.</entry>
+               changed. Special cases: Volatile controls do no generate this event;
+               If a control has the <constant>V4L2_CTRL_FLAG_EXECUTE_ON_WRITE</constant>
+               flag set, then this event is sent as well, regardless its value.</entry>
          </row>
          <row>
            <entry><constant>V4L2_EVENT_CTRL_CH_FLAGS</constant></entry>
index 2bd98fd7a4e51ac542d423ab74e335b8de0a9e7a..dc83ad70f8dc8ff30c1b31c4cb833df169de80b2 100644 (file)
@@ -600,7 +600,9 @@ writing a value will cause the device to carry out a given action
 changes continuously. A typical example would be the current gain value if the device
 is in auto-gain mode. In such a case the hardware calculates the gain value based on
 the lighting conditions which can change over time. Note that setting a new value for
-a volatile control will have no effect. The new value will just be ignored.</entry>
+a volatile control will have no effect and no <constant>V4L2_EVENT_CTRL_CH_VALUE</constant>
+will be sent, unless the <constant>V4L2_CTRL_FLAG_EXECUTE_ON_WRITE</constant> flag
+(see below) is also set. Otherwise the new value will just be ignored.</entry>
          </row>
          <row>
            <entry><constant>V4L2_CTRL_FLAG_HAS_PAYLOAD</constant></entry>
@@ -610,6 +612,14 @@ using one of the pointer fields of &v4l2-ext-control;. This flag is set for cont
 that are an array, string, or have a compound type. In all cases you have to set a
 pointer to memory containing the payload of the control.</entry>
          </row>
+         <row>
+           <entry><constant>V4L2_CTRL_FLAG_EXECUTE_ON_WRITE</constant></entry>
+           <entry>0x0200</entry>
+           <entry>The value provided to the control will be propagated to the driver
+even if remains constant. This is required when the control represents an action
+on the hardware. For example: clearing an error flag or triggering the flash. All the
+controls of the type <constant>V4L2_CTRL_TYPE_BUTTON</constant> have this flag set.</entry>
+         </row>
        </tbody>
       </tgroup>
     </table>
index 0f84ce8c9a7b1389c4c9b34fd9b5f427bdb22c40..5517db602f37b0d3f9a0939832a2494103c422de 100644 (file)
@@ -344,7 +344,9 @@ implement g_volatile_ctrl like this:
        }
 
 Note that you use the 'new value' union as well in g_volatile_ctrl. In general
-controls that need to implement g_volatile_ctrl are read-only controls.
+controls that need to implement g_volatile_ctrl are read-only controls. If they
+are not, a V4L2_EVENT_CTRL_CH_VALUE will not be generated when the control
+changes.
 
 To mark a control as volatile you have to set V4L2_CTRL_FLAG_VOLATILE: