aboutsummaryrefslogtreecommitdiffstats
path: root/include/media/v4l2-ctrls.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/media/v4l2-ctrls.h')
-rw-r--r--include/media/v4l2-ctrls.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/include/media/v4l2-ctrls.h b/include/media/v4l2-ctrls.h
index f00d42bc01a6..d8f5aab21d4a 100644
--- a/include/media/v4l2-ctrls.h
+++ b/include/media/v4l2-ctrls.h
@@ -81,6 +81,8 @@ typedef void (*v4l2_ctrl_notify_fnc)(struct v4l2_ctrl *ctrl, void *priv);
* manual mode. So if the value of the auto control equals this
* value, then the whole cluster is in manual mode. Drivers should
* never set this flag directly.
+ * @is_enabled: If 0, then this control is disabled and will be hidden for
+ * applications. Controls are always enabled by default.
* @ops: The control ops.
* @id: The control ID.
* @name: The control name.
@@ -122,6 +124,7 @@ struct v4l2_ctrl {
unsigned int is_new:1;
unsigned int is_private:1;
unsigned int is_auto:1;
+ unsigned int is_enabled:1;
unsigned int has_volatiles:1;
unsigned int call_notify:1;
unsigned int manual_mode_value:8;
@@ -538,6 +541,37 @@ void v4l2_ctrl_grab(struct v4l2_ctrl *ctrl, bool grabbed);
int v4l2_ctrl_modify_range(struct v4l2_ctrl *ctrl,
s32 min, s32 max, u32 step, s32 def);
+/** v4l2_ctrl_enable() - Mark the control as enabled or disabled.
+ * @ctrl: The control to en/disable.
+ * @enabled: True if the control should become enabled.
+ *
+ * Enable/disable a control.
+ * Does nothing if @ctrl == NULL.
+ * Usually called if controls are to be enabled or disabled when changing
+ * to a different input or output.
+ *
+ * When a control is disabled, then it will no longer show up in the
+ * application.
+ *
+ * This function can be called regardless of whether the control handler
+ * is locked or not.
+ */
+void v4l2_ctrl_enable(struct v4l2_ctrl *ctrl, bool enabled);
+
+/** v4l2_ctrl_handler_enable() - Mark the controls in the handler as enabled or disabled.
+ * @hdl: The control handler.
+ * @enabled: True if the controls should become enabled.
+ *
+ * Enable/disable the controls owned by the handler.
+ * Does nothing if @hdl == NULL.
+ * Usually called if controls are to be enabled or disabled when changing
+ * to a different input or output.
+ *
+ * When a control is disabled, then it will no longer show up in the
+ * application.
+ */
+void v4l2_ctrl_handler_enable(struct v4l2_ctrl_handler *hdl, bool enabled);
+
/** v4l2_ctrl_lock() - Helper function to lock the handler
* associated with the control.
* @ctrl: The control to lock.

Privacy Policy