summaryrefslogtreecommitdiff
path: root/src/libcamera/control_validator.cpp
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-09-28 02:42:49 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-10-05 20:02:51 +0300
commitaae2b5d6665f7878f234d4ce19de04e81154354e (patch)
tree11555b2adeb710653fa2b872a29c0b84c4ca9352 /src/libcamera/control_validator.cpp
parent28535ea1a2dd421f9ebafc056c7632674d0c70a8 (diff)
libcamera: Add ControlValidator
The new abstract ControlValidator class defines an interface that will be used by the ControlList class to validate controls. This will allow controls to the validated against different object types, such as Camera and V4L2Device. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Diffstat (limited to 'src/libcamera/control_validator.cpp')
-rw-r--r--src/libcamera/control_validator.cpp45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/libcamera/control_validator.cpp b/src/libcamera/control_validator.cpp
new file mode 100644
index 00000000..8e5cf3c3
--- /dev/null
+++ b/src/libcamera/control_validator.cpp
@@ -0,0 +1,45 @@
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+/*
+ * Copyright (C) 2019, Google Inc.
+ *
+ * control_validator.cpp - Control validator
+ */
+
+#include "control_validator.h"
+
+/**
+ * \file control_validator.h
+ * \brief Abstract control validator
+ */
+
+namespace libcamera {
+
+/**
+ * \class ControlValidator
+ * \brief Interface for the control validator
+ *
+ * The ControlValidator class is used by the ControlList class to validate
+ * controls added to the list. It is an abstract class providing an interface
+ * for object-specific control validation, such a Camera controls and V4L2
+ * controls.
+ */
+
+/**
+ * \fn ControlValidator::name()
+ * \brief Retrieve the name of the object associated with the validator
+ * \return The name of the object associated with the validator
+ */
+
+/**
+ * \fn ControlValidator::validate()
+ * \brief Validate a control
+ * \param[in] id The control ID
+ *
+ * This method validates the control \a id against the object corresponding to
+ * the validator. It shall at least validate that the control is applicable to
+ * the object instance, and may perform additional checks.
+ *
+ * \return True if the control is valid, false otherwise
+ */
+
+} /* namespace libcamera */