From 816bdf31a456cb6e3bb777623efd78642855dd58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?William=20B=C3=A9rub=C3=A9?= Date: Sun, 14 Jul 2024 14:32:14 -0400 Subject: [PATCH] Starting to fix a couple broken things on infinity6 --- src/hal/star/i6_isp.h | 10 ++++------ src/hal/star/i6_sys.h | 5 ++--- src/hal/star/i6_venc.h | 5 ++--- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/hal/star/i6_isp.h b/src/hal/star/i6_isp.h index 6f58d12..2ae5ff8 100644 --- a/src/hal/star/i6_isp.h +++ b/src/hal/star/i6_isp.h @@ -10,14 +10,12 @@ typedef struct { } i6_isp_impl; static int i6_isp_load(i6_isp_impl *isp_lib) { - if (!(isp_lib->handleIspAlgo = dlopen("libispalgo.so", RTLD_LAZY | RTLD_GLOBAL))) - HAL_ERROR("i6_isp", "Failed to load dependency library!\nError: %s\n", dlerror()); + isp_lib->handleIspAlgo = dlopen("libispalgo.so", RTLD_LAZY | RTLD_GLOBAL); - if (!(isp_lib->handleCus3a = dlopen("libcus3a.so", RTLD_LAZY | RTLD_GLOBAL))) - return EXIT_FAILURE; + isp_lib->handleCus3a = dlopen("libcus3a.so", RTLD_LAZY | RTLD_GLOBAL); if (!(isp_lib->handle = dlopen("libmi_isp.so", RTLD_LAZY | RTLD_GLOBAL))) - return EXIT_FAILURE; + HAL_ERROR("i6_isp", "Failed to load library!\nError: %s\n", dlerror()); if (!(isp_lib->fnLoadChannelConfig = (int(*)(int channel, char *path, unsigned int key)) hal_symbol_load("i6_isp", isp_lib->handle, "MI_ISP_API_CmdLoadBinFile"))) @@ -25,7 +23,7 @@ static int i6_isp_load(i6_isp_impl *isp_lib) { if (!(isp_lib->fnSetColorToGray = (int(*)(int channel, char *enable)) hal_symbol_load("i6_isp", isp_lib->handle, "MI_ISP_IQ_SetColorToGray"))) - return EXIT_FAILURE; + return EXIT_FAILURE; return EXIT_SUCCESS; } diff --git a/src/hal/star/i6_sys.h b/src/hal/star/i6_sys.h index f90718a..993e5ee 100644 --- a/src/hal/star/i6_sys.h +++ b/src/hal/star/i6_sys.h @@ -84,11 +84,10 @@ typedef struct { } i6_sys_impl; static int i6_sys_load(i6_sys_impl *sys_lib) { - if (!(sys_lib->handleCamOsWrapper = dlopen("libcam_os_wrapper.so", RTLD_LAZY | RTLD_GLOBAL))) - HAL_ERROR("i6_sys", "Failed to load dependency library!\nError: %s\n", dlerror()); + sys_lib->handleCamOsWrapper = dlopen("libcam_os_wrapper.so", RTLD_LAZY | RTLD_GLOBAL); if (!(sys_lib->handle = dlopen("libmi_sys.so", RTLD_LAZY | RTLD_GLOBAL))) - return EXIT_FAILURE; + HAL_ERROR("i6c_sys", "Failed to load library!\nError: %s\n", dlerror()); if (!(sys_lib->fnExit = (int(*)(void)) hal_symbol_load("i6_sys", sys_lib->handle, "MI_SYS_Exit"))) diff --git a/src/hal/star/i6_venc.h b/src/hal/star/i6_venc.h index 3634782..b170880 100644 --- a/src/hal/star/i6_venc.h +++ b/src/hal/star/i6_venc.h @@ -345,9 +345,8 @@ static int i6_venc_load(i6_venc_impl *venc_lib) { hal_symbol_load("i6_venc", venc_lib->handle, "MI_VENC_Query"))) return EXIT_FAILURE; - if (!(venc_lib->fnSetSourceConfig = (int(*)(int channel, i6_venc_src_conf *config)) - hal_symbol_load("i6_venc", venc_lib->handle, "MI_VENC_SetInputSourceConfig"))) - return EXIT_FAILURE; + venc_lib->fnSetSourceConfig = (int(*)(int channel, i6_venc_src_conf *config)) + hal_symbol_load("i6_venc", venc_lib->handle, "MI_VENC_SetInputSourceConfig"); if (!(venc_lib->fnRequestIdr = (int(*)(int channel, char instant)) hal_symbol_load("i6_venc", venc_lib->handle, "MI_VENC_RequestIdr")))