[libcamera-devel,RFC,02/10] libcamera: ipa_module: add path getter

Message ID 20190605221817.966-3-paul.elder@ideasonboard.com
State Superseded
Headers show
Series
  • Add IPA process isolation
Related show

Commit Message

Paul Elder June 5, 2019, 10:18 p.m. UTC
Add a method to IPAModule to get the path of the IPA module shared
object that the IPAModule was constructed from.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
---
 src/libcamera/include/ipa_module.h |  1 +
 src/libcamera/ipa_module.cpp       | 13 +++++++++++++
 2 files changed, 14 insertions(+)

Comments

Laurent Pinchart June 6, 2019, 9:38 a.m. UTC | #1
Hi Paul,

Thank you for the patch.

On Wed, Jun 05, 2019 at 06:18:09PM -0400, Paul Elder wrote:
> Add a method to IPAModule to get the path of the IPA module shared
> object that the IPAModule was constructed from.
> 
> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
> ---
>  src/libcamera/include/ipa_module.h |  1 +
>  src/libcamera/ipa_module.cpp       | 13 +++++++++++++
>  2 files changed, 14 insertions(+)
> 
> diff --git a/src/libcamera/include/ipa_module.h b/src/libcamera/include/ipa_module.h
> index fec4237..f6904fa 100644
> --- a/src/libcamera/include/ipa_module.h
> +++ b/src/libcamera/include/ipa_module.h
> @@ -26,6 +26,7 @@ public:
>  	bool isValid() const;
>  
>  	const struct IPAModuleInfo &info() const;
> +	const char *path() const;

You can return a const std::string & as we have an std::string
internally already.

>  
>  	bool load();
>  
> diff --git a/src/libcamera/ipa_module.cpp b/src/libcamera/ipa_module.cpp
> index 2663b9e..e1d4b27 100644
> --- a/src/libcamera/ipa_module.cpp
> +++ b/src/libcamera/ipa_module.cpp
> @@ -321,6 +321,19 @@ const struct IPAModuleInfo &IPAModule::info() const
>  	return info_;
>  }
>  
> +/**
> + * \brief Retrieve the IPA module path
> + *
> + * The IPA module path is the file name and path of the IPA module shared
> + * object from which the IPA module was created.
> + *
> + * \return the IPA module path

s/the/The/

With these small issues fixed,

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> + */
> +const char *IPAModule::path() const
> +{
> +	return libPath_.c_str();
> +}
> +
>  /**
>   * \brief Load the IPA implementation factory from the shared object
>   *

Patch

diff --git a/src/libcamera/include/ipa_module.h b/src/libcamera/include/ipa_module.h
index fec4237..f6904fa 100644
--- a/src/libcamera/include/ipa_module.h
+++ b/src/libcamera/include/ipa_module.h
@@ -26,6 +26,7 @@  public:
 	bool isValid() const;
 
 	const struct IPAModuleInfo &info() const;
+	const char *path() const;
 
 	bool load();
 
diff --git a/src/libcamera/ipa_module.cpp b/src/libcamera/ipa_module.cpp
index 2663b9e..e1d4b27 100644
--- a/src/libcamera/ipa_module.cpp
+++ b/src/libcamera/ipa_module.cpp
@@ -321,6 +321,19 @@  const struct IPAModuleInfo &IPAModule::info() const
 	return info_;
 }
 
+/**
+ * \brief Retrieve the IPA module path
+ *
+ * The IPA module path is the file name and path of the IPA module shared
+ * object from which the IPA module was created.
+ *
+ * \return the IPA module path
+ */
+const char *IPAModule::path() const
+{
+	return libPath_.c_str();
+}
+
 /**
  * \brief Load the IPA implementation factory from the shared object
  *