22
33#include "i6_common.h"
44
5+ typedef struct {
6+ unsigned int minShutterUs ;
7+ unsigned int maxShutterUs ;
8+ unsigned int minApertX10 ;
9+ unsigned int maxApertX10 ;
10+ unsigned int minSensorGain ;
11+ unsigned int minIspGain ;
12+ unsigned int maxSensorGain ;
13+ unsigned int maxIspGain ;
14+ } i6_isp_exp ;
15+
16+ typedef struct {
17+ int params [13 ];
18+ } i6_isp_p3a ;
19+
520typedef struct {
621 void * handle , * handleCus3a , * handleIspAlgo ;
722
23+ int (* fnDisableUserspace3A )(int channel );
24+ int (* fnEnableUserspace3A )(int channel , i6_isp_p3a * params );
825 int (* fnLoadChannelConfig )(int channel , char * path , unsigned int key );
926 int (* fnSetColorToGray )(int channel , char * enable );
27+ int (* fnGetExposureLimit )(int channel , i6_isp_exp * config );
28+ int (* fnSetExposureLimit )(int channel , i6_isp_exp * config );
1029} i6_isp_impl ;
1130
1231static int i6_isp_load (i6_isp_impl * isp_lib ) {
@@ -17,6 +36,14 @@ static int i6_isp_load(i6_isp_impl *isp_lib) {
1736 if (!(isp_lib -> handle = dlopen ("libmi_isp.so" , RTLD_LAZY | RTLD_GLOBAL )))
1837 HAL_ERROR ("i6_isp" , "Failed to load library!\nError: %s\n" , dlerror ());
1938
39+ if (!(isp_lib -> fnDisableUserspace3A = (int (* )(int channel ))
40+ hal_symbol_load ("i6_isp" , isp_lib -> handle , "MI_ISP_DisableUserspace3A" )))
41+ return EXIT_FAILURE ;
42+
43+ if (!(isp_lib -> fnEnableUserspace3A = (int (* )(int channel , i6_isp_p3a * params ))
44+ hal_symbol_load ("i6_isp" , isp_lib -> handle , "MI_ISP_CUS3A_Enable" )))
45+ return EXIT_FAILURE ;
46+
2047 if (!(isp_lib -> fnLoadChannelConfig = (int (* )(int channel , char * path , unsigned int key ))
2148 hal_symbol_load ("i6_isp" , isp_lib -> handle , "MI_ISP_API_CmdLoadBinFile" )))
2249 return EXIT_FAILURE ;
@@ -25,6 +52,14 @@ static int i6_isp_load(i6_isp_impl *isp_lib) {
2552 hal_symbol_load ("i6_isp" , isp_lib -> handle , "MI_ISP_IQ_SetColorToGray" )))
2653 return EXIT_FAILURE ;
2754
55+ if (!(isp_lib -> fnGetExposureLimit = (int (* )(int channel , i6_isp_exp * config ))
56+ hal_symbol_load ("i6_isp" , isp_lib -> handle , "MI_ISP_AE_GetExposureLimit" )))
57+ return EXIT_FAILURE ;
58+
59+ if (!(isp_lib -> fnSetExposureLimit = (int (* )(int channel , i6_isp_exp * config ))
60+ hal_symbol_load ("i6_isp" , isp_lib -> handle , "MI_ISP_AE_SetExposureLimit" )))
61+ return EXIT_FAILURE ;
62+
2863 return EXIT_SUCCESS ;
2964}
3065
0 commit comments