summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKieran Bingham <kieran.bingham@ideasonboard.com>2020-02-20 14:47:08 +0000
committerKieran Bingham <kieran.bingham@ideasonboard.com>2020-02-24 09:36:04 +0000
commit7860977710f4365557f35aa19f2dc5f150030de3 (patch)
treeada0fc33a2b5efc3ee5e005ed30b65588a70c950 /src
parenta15e8d92ea2ebc20abd54a7ecaa406f8e0de0c66 (diff)
libcamera: ipa_manager: Re-arrange IPA precedence
Setting a user environment path in LIBCAMERA_IPA_MODULE_PATH should take precedence over the system loading locations. Adjust the IPA search orders accordingly. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src')
-rw-r--r--src/libcamera/ipa_manager.cpp34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/libcamera/ipa_manager.cpp b/src/libcamera/ipa_manager.cpp
index 4ffbdd71..7f0a5d58 100644
--- a/src/libcamera/ipa_manager.cpp
+++ b/src/libcamera/ipa_manager.cpp
@@ -98,31 +98,31 @@ IPAManager::IPAManager()
unsigned int ipaCount = 0;
int ret;
- ret = addDir(IPA_MODULE_DIR);
- if (ret > 0)
- ipaCount += ret;
-
+ /* User-specified paths take precedence. */
const char *modulePaths = utils::secure_getenv("LIBCAMERA_IPA_MODULE_PATH");
- if (!modulePaths) {
+ if (modulePaths) {
+ for (const auto &dir : utils::split(modulePaths, ":")) {
+ if (dir.empty())
+ continue;
+
+ int ret = addDir(dir.c_str());
+ if (ret > 0)
+ ipaCount += ret;
+ }
+
if (!ipaCount)
LOG(IPAManager, Warning)
- << "No IPA found in '" IPA_MODULE_DIR "'";
- return;
+ << "No IPA found in '" << modulePaths << "'";
}
- for (const auto &dir : utils::split(modulePaths, ":")) {
- if (dir.empty())
- continue;
-
- int ret = addDir(dir.c_str());
- if (ret > 0)
- ipaCount += ret;
- }
+ /* Load IPAs from the installed system path. */
+ ret = addDir(IPA_MODULE_DIR);
+ if (ret > 0)
+ ipaCount += ret;
if (!ipaCount)
LOG(IPAManager, Warning)
- << "No IPA found in '" IPA_MODULE_DIR "' and '"
- << modulePaths << "'";
+ << "No IPA found in '" IPA_MODULE_DIR "'";
}
IPAManager::~IPAManager()