diff options
author | Florian Klink <flokli@flokli.de> | 2024-01-30T09·43+0200 |
---|---|---|
committer | flokli <flokli@flokli.de> | 2024-01-30T09·54+0000 |
commit | af9a8d372b24710bf7fc27c8e81244e1ca6d1658 (patch) | |
tree | df8bee03b202ec5081b9bd7e7b5d7b6ecdd28e1b /users/flokli/ipu6-softisp/libcamera/0005-libcamera-internal-Document-the-SharedMemObject-clas.patch | |
parent | b38be028d96ce107439f3323026270228a871a13 (diff) |
feat(users/flokli/ipu6-softisp): init r/7454
This code adds support for the ipu6 webcams via libcamera, based on the work in https://copr.fedorainfracloud.org/coprs/jwrdegoede/ipu6-softisp/. It's supposed to be included in your NixOS configuration imports. Change-Id: Ifb71999ad61161fa23506b97cb449f73fb1270e3 Reviewed-on: https://cl.tvl.fyi/c/depot/+/10709 Tested-by: BuildkiteCI Reviewed-by: flokli <flokli@flokli.de> Autosubmit: flokli <flokli@flokli.de>
Diffstat (limited to 'users/flokli/ipu6-softisp/libcamera/0005-libcamera-internal-Document-the-SharedMemObject-clas.patch')
-rw-r--r-- | users/flokli/ipu6-softisp/libcamera/0005-libcamera-internal-Document-the-SharedMemObject-clas.patch | 139 |
1 files changed, 139 insertions, 0 deletions
diff --git a/users/flokli/ipu6-softisp/libcamera/0005-libcamera-internal-Document-the-SharedMemObject-clas.patch b/users/flokli/ipu6-softisp/libcamera/0005-libcamera-internal-Document-the-SharedMemObject-clas.patch new file mode 100644 index 000000000000..a20d27059db0 --- /dev/null +++ b/users/flokli/ipu6-softisp/libcamera/0005-libcamera-internal-Document-the-SharedMemObject-clas.patch @@ -0,0 +1,139 @@ +From cb9ff82efd82af8ae26b2aca4183928c74f7ef34 Mon Sep 17 00:00:00 2001 +From: Dennis Bonke <admin@dennisbonke.com> +Date: Wed, 20 Dec 2023 16:22:29 +0100 +Subject: [PATCH 05/25] libcamera: internal: Document the SharedMemObject class + +Document the SharedMemObject class. + +Signed-off-by: Dennis Bonke <admin@dennisbonke.com> +Signed-off-by: Hans de Goede <hdegoede@redhat.com> +Tested-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> # sc8280xp Lenovo x13s +Tested-by: Pavel Machek <pavel@ucw.cz> +--- + .../libcamera/internal/shared_mem_object.h | 53 +++++++++++++++++++ + 1 file changed, 53 insertions(+) + +diff --git a/include/libcamera/internal/shared_mem_object.h b/include/libcamera/internal/shared_mem_object.h +index bfb639ee..e862ce48 100644 +--- a/include/libcamera/internal/shared_mem_object.h ++++ b/include/libcamera/internal/shared_mem_object.h +@@ -19,10 +19,20 @@ + + namespace libcamera { + ++/** ++ * \class SharedMemObject ++ * \brief Helper class for shared memory allocations. ++ * ++ * Takes a template T which is used to indicate the ++ * data type of the object stored. ++ */ + template<class T> + class SharedMemObject + { + public: ++ /** ++ * \brief The size of the object that is going to be stored here. ++ */ + static constexpr std::size_t SIZE = sizeof(T); + + SharedMemObject() +@@ -30,6 +40,11 @@ public: + { + } + ++ /** ++ * \brief Contstructor for the SharedMemObject. ++ * \param[in] name The requested name. ++ * \param[in] args Any additional args. ++ */ + template<class... Args> + SharedMemObject(const std::string &name, Args &&...args) + : name_(name), obj_(nullptr) +@@ -57,6 +72,10 @@ public: + obj_ = new (mem) T(std::forward<Args>(args)...); + } + ++ /** ++ * \brief Move constructor for SharedMemObject. ++ * \param[in] rhs The object to move. ++ */ + SharedMemObject(SharedMemObject<T> &&rhs) + { + this->name_ = std::move(rhs.name_); +@@ -76,6 +95,10 @@ public: + /* Make SharedMemObject non-copyable for now. */ + LIBCAMERA_DISABLE_COPY(SharedMemObject) + ++ /** ++ * \brief Operator= for SharedMemObject. ++ * \param[in] rhs The SharedMemObject object to take the data from. ++ */ + SharedMemObject<T> &operator=(SharedMemObject<T> &&rhs) + { + this->name_ = std::move(rhs.name_); +@@ -85,31 +108,61 @@ public: + return *this; + } + ++ /** ++ * \brief Operator-> for SharedMemObject. ++ * ++ * \return the object. ++ */ + T *operator->() + { + return obj_; + } + ++ /** ++ * \brief Operator-> for SharedMemObject. ++ * ++ * \return the object. ++ */ + const T *operator->() const + { + return obj_; + } + ++ /** ++ * \brief Operator* for SharedMemObject. ++ * ++ * \return the object. ++ */ + T &operator*() + { + return *obj_; + } + ++ /** ++ * \brief Operator* for SharedMemObject. ++ * ++ * \return the object. ++ */ + const T &operator*() const + { + return *obj_; + } + ++ /** ++ * \brief Gets the file descriptor for the underlaying storage file. ++ * ++ * \return the file descriptor. ++ */ + const SharedFD &fd() const + { + return fd_; + } + ++ /** ++ * \brief Operator bool() for SharedMemObject. ++ * ++ * \return true if the object is not null, false otherwise. ++ */ + explicit operator bool() const + { + return !!obj_; +-- +2.43.0 + |