Skip to content

Commit

Permalink
hardcode ipa paths into libcamera (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
aler9 authored Aug 18, 2024
1 parent af7fff9 commit 01891a2
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 5 deletions.
5 changes: 0 additions & 5 deletions camera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,6 @@ bool camera_create(const parameters_t *params, camera_frame_cb frame_cb, camera_
// We make sure to set the environment variable before libcamera init
setenv("LIBCAMERA_RPI_TUNING_FILE", params->tuning_file, 1);

// TODO: move into embedded libcamera
setenv("LIBCAMERA_IPA_CONFIG_PATH", "./ipa_conf", 1);
setenv("LIBCAMERA_IPA_MODULE_PATH", "./ipa_module", 1);
setenv("LIBCAMERA_IPA_PROXY_PATH", "/dev/null", 1);

camp->camera_manager = std::make_unique<CameraManager>();
int ret = camp->camera_manager->start();
if (ret != 0) {
Expand Down
33 changes: 33 additions & 0 deletions libcamera.patch
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,25 @@ index 58bb9893..41fc661f 100644
default_options : [
'werror=true',
'warning_level=2',
diff --git a/src/ipa/meson.build b/src/ipa/meson.build
index 0ad4631d..101b41ad 100644
--- a/src/ipa/meson.build
+++ b/src/ipa/meson.build
@@ -8,12 +8,9 @@ ipa_install_dir = libcamera_libdir
ipa_data_dir = libcamera_datadir / 'ipa'
ipa_sysconf_dir = libcamera_sysconfdir / 'ipa'

-config_h.set('IPA_CONFIG_DIR',
- '"' + get_option('prefix') / ipa_sysconf_dir +
- ':' + get_option('prefix') / ipa_data_dir + '"')
+config_h.set('IPA_CONFIG_DIR', '"./ipa_conf"')

-config_h.set('IPA_MODULE_DIR',
- '"' + get_option('prefix') / ipa_install_dir + '"')
+config_h.set('IPA_MODULE_DIR', '"./ipa_module"')

summary({
'IPA_CONFIG_DIR' : config_h.get('IPA_CONFIG_DIR'),
diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build
index 89504cee..20c588cb 100644
--- a/src/libcamera/meson.build
Expand All @@ -24,3 +43,17 @@ index 89504cee..20c588cb 100644
libthreads = dependency('threads')

subdir('base')
diff --git a/src/libcamera/proxy/worker/meson.build b/src/libcamera/proxy/worker/meson.build
index aa4d9cd7..31b994a9 100644
--- a/src/libcamera/proxy/worker/meson.build
+++ b/src/libcamera/proxy/worker/meson.build
@@ -24,8 +24,7 @@ foreach mojom : ipa_mojoms
dependencies : libcamera_private)
endforeach

-config_h.set('IPA_PROXY_DIR',
- '"' + get_option('prefix') / proxy_install_dir + '"')
+config_h.set('IPA_PROXY_DIR', '"/dev/null"')

summary({
'IPA_PROXY_DIR' : config_h.get('IPA_PROXY_DIR'),

0 comments on commit 01891a2

Please sign in to comment.