Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support attribute page function 1110 #381

Merged
merged 3 commits into from
Nov 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
BR2_VERSION = 2020.02.11


RED=\e[1;31m
NC=\e[0m

Expand Down
6 changes: 3 additions & 3 deletions package/mediactl_lib/src/3a_ctl/ae_cfg_param.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
static AE_CTL_INIT_CFG_T ae_ctl_init_cfg_param_dual_imx219 =
{
/* can modify */
.bDualCameraSync = 1,
.bDualCameraSync = 0,
.nSingleSensorETDelayFrame = {1, 1}, // [0]: f2k, [1]: r2k
.nSingleSensorSetMode = {0, 0}, // [0]: f2k, [1]: r2k
.nSingleSensorSetMode = {1, 1}, // [0]: f2k, [1]: r2k
.nDualSensorETDelayFrame = {1, 1}, // [0]: f2k, [1]: r2k
.nDualSensorSetMode = {1, 1}, // [0]: f2k, [1]: r2k
.nFrameRate = {30, 30}, // [0]: sensor0, [1]: sensor1
Expand All @@ -45,7 +45,7 @@ static AE_CTL_INIT_CFG_T ae_ctl_init_cfg_param_dual_imx385 =
.bDualCameraSync = 0,
.nSingleSensorETDelayFrame = {1, 1}, // [0]: f2k, [1]: r2k
.nSingleSensorSetMode = {0, 0}, // [0]: f2k, [1]: r2k
.nDualSensorETDelayFrame = {1, 1}, // [0]: f2k, [1]: r2k
.nDualSensorETDelayFrame = {0, 0}, // [0]: f2k, [1]: r2k
.nDualSensorSetMode = {0, 0}, // [0]: f2k, [1]: r2k
.nFrameRate = {30, 30}, // [0]: sensor0, [1]: sensor1

Expand Down
52 changes: 49 additions & 3 deletions package/mediactl_lib/src/3a_ctl/ae_ctl.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
#ifndef __3A_AE_CTL_H__
#define __3A_AE_CTL_H__

#define AE_CTL_MANUAL_SET_EXP_MODE 0
#define AE_CTL_MANUAL_SET_GAIN_MODE 1
#define AE_CTL_MANUAL_SET_TARGET_MODE 2
#define AE_CTL_MANUAL_SET_TARGET_RANGE_MODE 3
#define AE_CTL_MANUAL_SET_FROM_USER 4
enum ae_ctl_isp_pipeline_e
{
AE_CTL_ISP_F2K_PIPELINE,
Expand All @@ -17,7 +22,7 @@ enum ISP_AE_Mode
enum ISP_AE_Anti_Flicker_Mode
{
Anti_flicker_50Hz_auto,
Anti_ficker_60Hz_auto,
Anti_flicker_60Hz_auto,
Anti_flicker_50Hz_force,
Anti_flicker_60Hz_force,
Anti_flicker_None,
Expand All @@ -38,6 +43,14 @@ enum anti_flicker_scl_e
ANTI_FLICKER_ALL2K_ENABLE,
};

enum ae_attr_page_stat_e
{
AE_ATTR_PAGE_WAIT,
AE_ATTR_PAGE_ON,
AE_ATTR_PAGE_OFF,
AE_ATTR_PAGE_ON_TO_OFF,
};

struct ISP_AE_Parameters {
enum ISP_AE_Mode AE_Mode;
enum ISP_AE_Anti_Flicker_Mode AE_AntiFlicker; //Anti-flicker mode
Expand Down Expand Up @@ -73,6 +86,7 @@ struct ISP_AE_Parameters {
int Anti_60Hz_Lines; //1/120s ET lines
int ready_to_write_et; // need write exp time current frame
int ready_to_write_gain; // need write gain current frame
int user_re_init; // re init when param is changed
};

typedef struct {
Expand Down Expand Up @@ -104,11 +118,32 @@ typedef struct {
AE_CTL_SENSOR_NAME_T * tAeCtlSensorName;
} AE_CTL_SENSOR_NAME_S_T;

typedef struct {
int nAttePageEn;
int nAeModeSwitch;
} AE_CTL_ATTR_PARAM;

typedef struct {
int nAeTarBright;
int nAeTarBrightRange;
int nAeExValueMax;
int nAeGainValueMax;
int nAeExValueMin;
int nAeGainValueMin;
int nAeEnterLsSel;
int nAeLExTime;
int nAeAgc;
int nTotalHeight;
} AE_CTL_ISP_INIT_PARAM;

extern bool Sensor1_Sync;
extern int AESmoothSteps; //将AE收敛分为9步完成,可设置, >=7
extern int ETDelayFrameNumber[2]; //Sensor ET设置生效所需帧数
extern struct ISP_AE_Parameters AE_Para_Inf[2];

/* callback */
typedef int (* manual_set_callback)(enum ae_ctl_isp_pipeline_e pipeline, int value);

/* main functions */
int Anti_Flicker_ETL(enum ae_ctl_isp_pipeline_e pipeline);
int Set_AE_Value(enum ae_ctl_isp_pipeline_e pipeline, struct media_entity * pipe, AE_CTL_AE_STAT_T * ae_stat_callback);
Expand All @@ -118,11 +153,22 @@ int anti_flicker_scl(int scl);

/* user init */
int ae_ctl_cfg_init(int pipeline_en_f2k, int pipeline_en_r2k, AE_CTL_SENSOR_NAME_S_T ae_ctl_sensor_name_s, char * sensor0_name, char * sensor1_name);
int ae_ctl_init(enum ae_ctl_isp_pipeline_e pipeline, struct isp_core_cfg_info isp_core_cfg);
int ae_ctl_init(enum ae_ctl_isp_pipeline_e pipeline, struct isp_core_cfg_info * isp_core_cfg);
// re init when param change online
int ae_ctl_reinit(enum ae_ctl_isp_pipeline_e pipeline);
// n: number of devices, ... &(struct media_entity) f2k r2k sensor0 sensor1
int ae_ctl_device_init(int n, ...);

/* user functions */
int ae_ctl_calc(enum ae_ctl_isp_pipeline_e pipeline, struct k510isp_ae_stats ae_stats, struct media_entity * pipe, AE_CTL_AE_STAT_T * ae_stat_callback);
int ae_ctl_get_max_et(enum ae_ctl_isp_pipeline_e pipeline);
int ae_ctl_limit_range(enum ae_ctl_isp_pipeline_e pipeline, int min_et, int max_et, int max_gain);
int ae_ctl_manual_set(int set_mode, manual_set_callback userfunc, enum ae_ctl_isp_pipeline_e pipeline, int value, AE_CTL_AE_STAT_T * ae_stat_callback);
int et_line_time_convert(enum ae_ctl_isp_pipeline_e pipeline, int exp_time);
int line_time_et_convert(enum ae_ctl_isp_pipeline_e pipeline, int et);
int anti_flicker_switch(enum ae_ctl_isp_pipeline_e pipeline, int scl);
int ae_ctl_sync_setting(enum ae_ctl_isp_pipeline_e pipeline, int ae_sync);
int ae_ctl_attr_page_stat_set_v2(enum ae_ctl_isp_pipeline_e pipeline, int stat);
int ae_ctl_attr_page_param_set(enum ae_ctl_isp_pipeline_e pipeline, AE_CTL_ATTR_PARAM page_attr);

/* user get version */
char * ae_ctl_get_version();
Expand Down
Loading