1.同步连拍拖影问题;2.同步IQ

This commit is contained in:
payton 2023-06-07 14:25:34 +08:00
parent e8ce0f9fc5
commit b1d2ac8131
7 changed files with 245 additions and 99 deletions

View File

@ -935,8 +935,15 @@ int flow_preview(void)
if (strlen(pSenCfg->iq_path.path) != 0) { if (strlen(pSenCfg->iq_path.path) != 0) {
IQT_DTSI_INFO iq_dtsi_info; IQT_DTSI_INFO iq_dtsi_info;
iq_dtsi_info.id = pSenCfg->iq_path.id; iq_dtsi_info.id = pSenCfg->iq_path.id;
strncpy(iq_dtsi_info.node_path, pSenCfg->iq_path.path, 31);
if(sf_is_night_mode(0) ==TRUE)
strncpy(iq_dtsi_info.node_path, "/isp/iq/os05b10_iq_0", 31);
else
strncpy(iq_dtsi_info.node_path, "/isp/iq/os05b10_iq_0_cap", 31);
strncpy(iq_dtsi_info.file_path, "null", DTSI_NAME_LENGTH); strncpy(iq_dtsi_info.file_path, "null", DTSI_NAME_LENGTH);
//DBG_ERR("vendor_isp_set_iq %s\r\n",iq_dtsi_info.node_path);
iq_dtsi_info.buf_addr = (UINT8 *)pSenCfg->iq_path.addr; iq_dtsi_info.buf_addr = (UINT8 *)pSenCfg->iq_path.addr;
if ((hd_ret = vendor_isp_set_iq(IQT_ITEM_RLD_DTSI, &iq_dtsi_info)) != HD_OK) { if ((hd_ret = vendor_isp_set_iq(IQT_ITEM_RLD_DTSI, &iq_dtsi_info)) != HD_OK) {
DBG_ERR("vendor_isp_set_iq fail(%d)\r\n", hd_ret); DBG_ERR("vendor_isp_set_iq fail(%d)\r\n", hd_ret);
@ -1120,31 +1127,31 @@ static UINT32 ae_adc_tbl[57][3] = {
{480, 16666, 2310}, {480, 16666, 2310},
{458, 16666, 2310}, {458, 16666, 2310},
{421, 16666, 2310}, {421, 16666, 2310},
{399, 16666, 2310}, {399, 16666, 4000},
{363, 16666, 2310}, {363, 16666, 6000},
{322, 16666, 2310},// 12190}, {322, 16666, 8000},// 12190},
{288, 16666, 2310},// 26600}, {288, 16666, 10000},// 26600},
{246, 16666, 2310}, //45770}, {246, 16666, 14000}, //45770},
{216, 16666, 2310}, {216, 16666, 14000},
{188, 16666, 1000}, {188, 16666, 16000},
{162, 16666, 1000}, {162, 16666, 16000},
{151, 16666, 1000}, {151, 16666, 16000},
{138, 16666, 1000}, {138, 16666, 16000},
{118, 16666, 1000}, {118, 16666, 16000},
{96, 16666, 1280}, {96, 16666, 16000},
{80, 16666, 2000}, {80, 16666, 16000},
{62, 16666, 2000}, {62, 16666, 16000},
{48, 20000, 2000}, {48, 16666, 16000},
{35, 20000, 2000}, {35, 16666, 16000},
{26, 33333, 1100}, {26, 16666, 16000},
{19, 33333, 1100}, {19, 16666, 16000},
{13, 33333, 1100}, {13, 16666, 16000},
{10, 33333, 1100}, {10, 16666, 16000},
{8, 33333, 2100}, {8, 16666, 16000},
{4, 33333, 3100}, {4, 16666, 16000},
{2, 33333, 3400}, {2, 16666, 16000},
//{1, 33333, 3500}, //{1, 33333, 3500},
{0, 33333, 4000}, {0, 16666, 16000},
#else // 1K RSS #else // 1K RSS
{980, 120, 1000}, {980, 120, 1000},
@ -1244,7 +1251,12 @@ void ae_adc_get_exp_photo(UINT16 adc_value, UINT32 *exptime, UINT32 *isogain)
*isogain = (adc_ev / exptime0); *isogain = (adc_ev / exptime0);
}else{ }else{
*exptime = 16666; *exptime = 16666;
#if HUNTING_IR_LED_940 == ENABLE
*isogain = 16000;
#else
*isogain = 7000; *isogain = 7000;
#endif
} }
} }
DBG_WRN("idx = %d, %d, adc = %d, fast open preset exp = %d, %d\r\n", idx0, idx1, adc_value, *exptime, *isogain); DBG_WRN("idx = %d, %d, adc = %d, fast open preset exp = %d, %d\r\n", idx0, idx1, adc_value, *exptime, *isogain);

View File

@ -888,6 +888,8 @@ THREAD_RETTYPE MovieFast_InitMovieModeThread(void *arg)
UINT32 i; UINT32 i;
MOVIEMULTI_MAX_LINK_INFO MaxLinkInfo = {1, 0, 0, 1, 0}; //Img, Disp, Wifi, AudCap, EthCam MOVIEMULTI_MAX_LINK_INFO MaxLinkInfo = {1, 0, 0, 1, 0}; //Img, Disp, Wifi, AudCap, EthCam
MOVIE_SENSOR_INFO sen_cfg = {0}; MOVIE_SENSOR_INFO sen_cfg = {0};
MOVIE_SENSOR_INFO *pSenCfg = &sen_cfg;
HD_RESULT hd_ret;
DBG_FUNC("\r\n"); DBG_FUNC("\r\n");
@ -944,6 +946,28 @@ THREAD_RETTYPE MovieFast_InitMovieModeThread(void *arg)
ImageApp_MovieMulti_SetParam(_CFG_REC_ID_1, MOVIEMULTI_PARAM_VCAP_PAT_GEN, HD_VIDEOCAP_SEN_PAT_COLORBAR); ImageApp_MovieMulti_SetParam(_CFG_REC_ID_1, MOVIEMULTI_PARAM_VCAP_PAT_GEN, HD_VIDEOCAP_SEN_PAT_COLORBAR);
#endif #endif
} }
if ((hd_ret = vendor_isp_init()) != HD_OK) {
DBG_ERR("vendor_isp_init fail(%d)\n", hd_ret);
}
if (strlen(pSenCfg->iq_path.path) != 0) {
IQT_DTSI_INFO iq_dtsi_info;
iq_dtsi_info.id = pSenCfg->iq_path.id;
strncpy(iq_dtsi_info.node_path, "/isp/iq/os05b10_iq_0_vid", 31);
strncpy(iq_dtsi_info.file_path, "null", DTSI_NAME_LENGTH);
//DBG_ERR("vendor_isp_set_iq %s\r\n",iq_dtsi_info.node_path);
iq_dtsi_info.buf_addr = (UINT8 *)pSenCfg->iq_path.addr;
if ((hd_ret = vendor_isp_set_iq(IQT_ITEM_RLD_DTSI, &iq_dtsi_info)) != HD_OK) {
DBG_ERR("vendor_isp_set_iq fail(%d)\r\n", hd_ret);
}
}
if ((hd_ret = vendor_isp_uninit()) != HD_OK) {
DBG_ERR("vendor_isp_uninit fail(%d)\n", hd_ret);
}
MovieMapping_GetStreamInfo(UI_GetData(FL_MOVIE_SIZE), (UINT32)&gMovie_Strm_Info); MovieMapping_GetStreamInfo(UI_GetData(FL_MOVIE_SIZE), (UINT32)&gMovie_Strm_Info);
ImageApp_MovieMulti_Config(MOVIE_CONFIG_STREAM_INFO, (UINT32)&gMovie_Strm_Info); ImageApp_MovieMulti_Config(MOVIE_CONFIG_STREAM_INFO, (UINT32)&gMovie_Strm_Info);
ImageApp_MovieMulti_Config(MOVIE_CONFIG_AUDIO_INFO, (UINT32)&gMovie_Audio_Info); ImageApp_MovieMulti_Config(MOVIE_CONFIG_AUDIO_INFO, (UINT32)&gMovie_Audio_Info);

View File

@ -1368,7 +1368,7 @@ extern INT32 PhotoFast_SliceEncode_Dump_Frame(const HD_VIDEO_FRAME video_frame,
THREAD_RETTYPE PhotoFast_FlowPreviewThread(void *arg) THREAD_RETTYPE PhotoFast_FlowPreviewThread(void *arg)
{ {
HD_RESULT hd_ret; HD_RESULT hd_ret = HD_OK;
HD_VIDEO_FRAME video_cap_frame = {0}; HD_VIDEO_FRAME video_cap_frame = {0};
HD_VIDEO_FRAME video_frame = {0}; HD_VIDEO_FRAME video_frame = {0};
HD_PATH_ID vprc_path = 0, vout_path = 0, vcap_path = 0; HD_PATH_ID vprc_path = 0, vout_path = 0, vcap_path = 0;
@ -1433,6 +1433,8 @@ THREAD_RETTYPE PhotoFast_FlowPreviewThread(void *arg)
period = 1000 / max_cnt; period = 1000 / max_cnt;
#endif #endif
DBG_DUMP("period = %lu ms\n", period);
PhotoFast_SliceEncode2_Open(vprc_path, max_cnt); PhotoFast_SliceEncode2_Open(vprc_path, max_cnt);
nvt_cmdsys_runcmd("ae set_speed 0 128 600 600 100 "); nvt_cmdsys_runcmd("ae set_speed 0 128 600 600 100 ");
@ -1488,45 +1490,139 @@ THREAD_RETTYPE PhotoFast_FlowPreviewThread(void *arg)
#if POWERON_FAST_SLICE_ENC_VER2 == ENABLE #if POWERON_FAST_SLICE_ENC_VER2 == ENABLE
if(start_cap == TRUE){ if(start_cap == TRUE){
vos_util_delay_ms((((period-200) <= 0) ? 1 : (period-200)));
#if HUNTING_CAMERA_MCU == ENABLE VOS_TICK t1, t2;
if(sf_is_night_mode(0) ==TRUE){ UINT32 duration;
//DrvGPIO_IRLed_Turn_Onoff(1); UINT32 led_delay = 170;
sf_ir_led_set(((2 == puiPara->NightMode) ? 2 : 1),puiPara->FlashLed, puiPara->NightMode,0);
vos_perf_mark(&t1);
/**************************************************
* Keep pushing frame to vprc
**************************************************/
do{
vos_perf_mark(&t2);
duration = vos_perf_duration(t1, t2) / 1000;
/**************************************************
* IR LED , 60 fps, 16.66 = 17
**************************************************/
#if HUNTING_CAMERA_MCU == ENABLE
if((duration >= period) ||((period - duration) <= (led_delay + 17))
){
if(sf_is_night_mode(0) ==TRUE){
sf_ir_led_set(((2 == puiPara->NightMode) ? 2 : 1),puiPara->FlashLed, puiPara->NightMode,0);
}
}
#endif
if((hd_ret = hd_videocap_pull_out_buf(vcap_path, &video_cap_frame, PHOTOFAST_HD_PUSH_PULL_TIMEOUT_MS)) != HD_OK){
DBG_ERR("failed to hd_videocap_pull_out_buf, er=%d\n", (int)hd_ret);
goto exit;
}
g_vcap_frm_cnt = video_cap_frame.count;
if((hd_ret = hd_videoproc_push_in_buf(vprc_path, &video_cap_frame, NULL, PHOTOFAST_HD_PUSH_PULL_TIMEOUT_MS)) != HD_OK){
hd_videocap_release_out_buf(vcap_path, &video_cap_frame);
DBG_ERR("failed to hd_videoproc_push_in_buf, er=%d\n", (int)hd_ret);
goto exit;
}
if((hd_ret = hd_videocap_release_out_buf(vcap_path, &video_cap_frame)) != HD_OK){
DBG_ERR("failed to hd_videocap_release_out_buf, er=%d\n", (int)hd_ret);
goto exit;
}
if ((hd_ret = hd_videoproc_pull_out_buf(vprc_path, &video_frame, PHOTOFAST_HD_PUSH_PULL_TIMEOUT_MS)) != HD_OK) {
DBG_ERR("failed to hd_videoproc_pull_out_buf, er=%d\n", (int)hd_ret);
goto exit;
}
DBG_DUMP("vcap:%lu vprc:%lu vprc_ae_preset:%lu\n", g_vcap_frm_cnt, g_vprc_frm_cnt, g_vprc_frm_cnt_ae_preset);
++g_vprc_frm_cnt;
if(duration >= period){
break;
}
else{
if ((hd_ret = hd_videoproc_release_out_buf(vprc_path, &video_frame))!= HD_OK) {
DBG_ERR("failed to hd_videoproc_release_out_buf, er=%d\n", (int)hd_ret);
goto exit;
}
continue;
}
} while(1);
}
else{
if((hd_ret = hd_videocap_pull_out_buf(vcap_path, &video_cap_frame, PHOTOFAST_HD_PUSH_PULL_TIMEOUT_MS)) != HD_OK){
DBG_ERR("failed to hd_videocap_pull_out_buf, er=%d\n", (int)hd_ret);
goto exit;
} }
#endif
vos_util_delay_ms(170); g_vcap_frm_cnt = video_cap_frame.count;
if((hd_ret = hd_videoproc_push_in_buf(vprc_path, &video_cap_frame, NULL, PHOTOFAST_HD_PUSH_PULL_TIMEOUT_MS)) != HD_OK){
hd_videocap_release_out_buf(vcap_path, &video_cap_frame);
DBG_ERR("failed to hd_videoproc_push_in_buf, er=%d\n", (int)hd_ret);
goto exit;
}
if((hd_ret = hd_videocap_release_out_buf(vcap_path, &video_cap_frame)) != HD_OK){
DBG_ERR("failed to hd_videocap_release_out_buf, er=%d\n", (int)hd_ret);
goto exit;
}
if ((hd_ret = hd_videoproc_pull_out_buf(vprc_path, &video_frame, PHOTOFAST_HD_PUSH_PULL_TIMEOUT_MS)) != HD_OK) {
DBG_ERR("failed to hd_videoproc_pull_out_buf, er=%d\n", (int)hd_ret);
goto exit;
}
DBG_DUMP("vcap:%lu vprc:%lu vprc_ae_preset:%lu\n", g_vcap_frm_cnt, g_vprc_frm_cnt, g_vprc_frm_cnt_ae_preset);
++g_vprc_frm_cnt;
} }
#endif #endif
#if HUNTING_PHOTO_FAST_AE_60_FPS == ENABLE //#if HUNTING_PHOTO_FAST_AE_60_FPS == ENABLE
if((hd_ret = hd_videocap_pull_out_buf(vcap_path, &video_cap_frame, PHOTOFAST_HD_PUSH_PULL_TIMEOUT_MS)) != HD_OK){ // if((hd_ret = hd_videocap_pull_out_buf(vcap_path, &video_cap_frame, PHOTOFAST_HD_PUSH_PULL_TIMEOUT_MS)) != HD_OK){
DBG_ERR("failed to hd_videocap_pull_out_buf, er=%d\n", (int)hd_ret); // DBG_ERR("failed to hd_videocap_pull_out_buf, er=%d\n", (int)hd_ret);
goto exit; // goto exit;
} // }
//
// g_vcap_frm_cnt = video_cap_frame.count;
//
// if((hd_ret = hd_videoproc_push_in_buf(vprc_path, &video_cap_frame, NULL, PHOTOFAST_HD_PUSH_PULL_TIMEOUT_MS)) != HD_OK){
// hd_videocap_release_out_buf(vcap_path, &video_cap_frame);
// DBG_ERR("failed to hd_videoproc_push_in_buf, er=%d\n", (int)hd_ret);
// goto exit;
// }
//
// if((hd_ret = hd_videocap_release_out_buf(vcap_path, &video_cap_frame)) != HD_OK){
// DBG_ERR("failed to hd_videocap_release_out_buf, er=%d\n", (int)hd_ret);
// goto exit;
// }
//#else
// (void) vcap_path;
// (void) video_cap_frame;
//#endif
// if ((hd_ret = hd_videoproc_pull_out_buf(vprc_path, &video_frame, PHOTOFAST_HD_PUSH_PULL_TIMEOUT_MS)) != HD_OK) {
// DBG_ERR("failed to hd_videoproc_pull_out_buf, er=%d\n", (int)hd_ret);
// goto exit;
// }
g_vcap_frm_cnt = video_cap_frame.count; // DBG_DUMP("vcap:%lu vprc:%lu vprc_ae_preset:%lu\n", g_vcap_frm_cnt, g_vprc_frm_cnt, g_vprc_frm_cnt_ae_preset);
if((hd_ret = hd_videoproc_push_in_buf(vprc_path, &video_cap_frame, NULL, PHOTOFAST_HD_PUSH_PULL_TIMEOUT_MS)) != HD_OK){
hd_videocap_release_out_buf(vcap_path, &video_cap_frame);
DBG_ERR("failed to hd_videoproc_push_in_buf, er=%d\n", (int)hd_ret);
goto exit;
}
if((hd_ret = hd_videocap_release_out_buf(vcap_path, &video_cap_frame)) != HD_OK){
DBG_ERR("failed to hd_videocap_release_out_buf, er=%d\n", (int)hd_ret);
goto exit;
}
#else
(void) vcap_path;
(void) video_cap_frame;
#endif
if ((hd_ret = hd_videoproc_pull_out_buf(vprc_path, &video_frame, PHOTOFAST_HD_PUSH_PULL_TIMEOUT_MS)) != HD_OK) {
DBG_ERR("failed to hd_videoproc_pull_out_buf, er=%d\n", (int)hd_ret);
goto exit;
}
DBG_DUMP("vcap:%lu vprc:%lu vprc_ae_preset:%lu\n", g_vcap_frm_cnt, g_vprc_frm_cnt, g_vprc_frm_cnt_ae_preset);
/***************************************************************************************** /*****************************************************************************************
* trigger rule: * trigger rule:
@ -1544,25 +1640,23 @@ THREAD_RETTYPE PhotoFast_FlowPreviewThread(void *arg)
DBG_DUMP("triggered by AE preset\n"); DBG_DUMP("triggered by AE preset\n");
} }
//#if HUNTING_PHOTO_FAST_AE_60_FPS == ENABLE
#if HUNTING_PHOTO_FAST_AE_60_FPS == ENABLE
PhotoFast_SetTriggerFrmCnt(video_cap_frame.count); /* unbind mode , use vcap frame count */ PhotoFast_SetTriggerFrmCnt(video_cap_frame.count); /* unbind mode , use vcap frame count */
#else //#else
PhotoFast_SetTriggerFrmCnt(video_frame.count); /* bind mode , vprc frame count = vcap frame count */ // PhotoFast_SetTriggerFrmCnt(video_frame.count); /* bind mode , vprc frame count = vcap frame count */
#endif //#endif
start_cap = TRUE; start_cap = TRUE;
DBG_DUMP("*** trigger frame count = %llu (start from 1)\n", video_cap_frame.count); /* UINT64, use %llu */ DBG_DUMP("*** trigger frame count = %llu (start from 1)\n", video_cap_frame.count); /* UINT64, use %llu */
//Set_AEMODE(1); //Set_AEMODE(1);
} }
#if HUNTING_PHOTO_FAST_AE_60_FPS == DISABLE //#if HUNTING_PHOTO_FAST_AE_60_FPS == DISABLE
g_vprc_frm_cnt = video_frame.count; // g_vprc_frm_cnt = video_frame.count;
g_vcap_frm_cnt = g_vprc_frm_cnt; // g_vcap_frm_cnt = g_vprc_frm_cnt;
#else //#else
++g_vprc_frm_cnt;
#endif //#endif
switch (DrvGPIO_GetPhotoMovieModeFromMonitor()) { switch (DrvGPIO_GetPhotoMovieModeFromMonitor()) {
case DX_HUNTING_MODE_PHOTO: case DX_HUNTING_MODE_PHOTO:

View File

@ -7,7 +7,7 @@
version-info = [00 01 00 01]; version-info = [00 01 00 01];
ae_expect_lum { ae_expect_lum {
size = [b0 00 00 00]; size = [b0 00 00 00];
data = [3c 00 00 00 3c 00 00 00 26 00 00 00 26 00 00 00 26 00 00 00 26 00 00 00 26 00 00 00 26 00 00 00 27 00 00 00 2c 00 00 00 32 00 00 00 3a 00 00 00 44 00 00 00 50 00 00 00 50 00 00 00 50 00 00 00 50 00 00 00 50 00 00 00 50 00 00 00 50 00 00 00 50 00 00 00 50 00 00 00 50 00 00 00 32 00 00 00 32 00 00 00 32 00 00 00 32 00 00 00 32 00 00 00 32 00 00 00 32 00 00 00 32 00 00 00 3c 00 00 00 46 00 00 00 5a 00 00 00 5a 00 00 00 5a 00 00 00 5a 00 00 00 5a 00 00 00 5a 00 00 00 5a 00 00 00 5a 00 00 00 5a 00 00 00 5a 00 00 00 5a 00 00 00]; data = [3c 00 00 00 3c 00 00 00 3a 00 00 00 3a 00 00 00 3a 00 00 00 3a 00 00 00 3a 00 00 00 3a 00 00 00 3a 00 00 00 3a 00 00 00 44 00 00 00 44 00 00 00 44 00 00 00 50 00 00 00 50 00 00 00 50 00 00 00 50 00 00 00 50 00 00 00 50 00 00 00 50 00 00 00 50 00 00 00 50 00 00 00 50 00 00 00 32 00 00 00 32 00 00 00 32 00 00 00 32 00 00 00 32 00 00 00 32 00 00 00 32 00 00 00 32 00 00 00 3c 00 00 00 46 00 00 00 5a 00 00 00 5a 00 00 00 5a 00 00 00 5a 00 00 00 5a 00 00 00 5a 00 00 00 5a 00 00 00 5a 00 00 00 5a 00 00 00 5a 00 00 00 5a 00 00 00];
}; };
ae_la_clamp { ae_la_clamp {
size = [50 01 00 00]; size = [50 01 00 00];

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long