Skip to content

Commit

Permalink
(Continued)
Browse files Browse the repository at this point in the history
  • Loading branch information
wberube committed Aug 23, 2024
1 parent 013a76e commit 5cd82af
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ _* At the moment, only text, 24-bit and 32-bit RGB overlays are handled, matrici
[^9]: GK7202V300, GK7205V200/300 and GK7605V100
[^10]: Hi3516AV200 and Hi3519V101
[^11]: RV110\[3/7/8/9\] and RV1106\(G2/G3\)
[^12]: MSC313E, MSC316\[DC/Q\] and MSC318
[^12]: MSC313E, MSC316\[DC/DE/QE\] and MSC318
[^13]: SSC323, SSC325\(D/DE\) and SSC327\(D/DE/Q\)
[^14]: SSC33\[3/5/7\]\(DE\)
[^15]: SSC30K\[D/Q\], SSC336\[D/Q\], SSC338\[D/G/Q\] and SSC339G
Expand Down
31 changes: 31 additions & 0 deletions src/hal/star/i3_isp.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#pragma once

#include "i3_common.h"

typedef struct {
void *handle;

int (*fnLoadChannelConfig)(int channel, char *path, unsigned int key);
int (*fnSetColorToGray)(int channel, char *enable);
} i3_isp_impl;

static int i3_isp_load(i3_isp_impl *isp_lib) {
if (!(isp_lib->handle = dlopen("libmi_isp.so", RTLD_LAZY | RTLD_GLOBAL)))
HAL_ERROR("i3_isp", "Failed to load library!\nError: %s\n", dlerror());

if (!(isp_lib->fnLoadChannelConfig = (int(*)(int channel, char *path, unsigned int key))
hal_symbol_load("i3_isp", isp_lib->handle, "MI_ISP_Load_ISPCmdBinFile")))
return EXIT_FAILURE;

if (!(isp_lib->fnSetColorToGray = (int(*)(int channel, char *enable))
hal_symbol_load("i3_isp", isp_lib->handle, "MI_ISP_SetColorToGray")))
return EXIT_FAILURE;

return EXIT_SUCCESS;
}

static void i3_isp_unload(i3_isp_impl *isp_lib) {
if (isp_lib->handle) dlclose(isp_lib->handle);
isp_lib->handle = NULL;
memset(isp_lib, 0, sizeof(*isp_lib));
}

0 comments on commit 5cd82af

Please sign in to comment.