Merge remote-tracking branch 'origin/Branch_S530' into branch_s530
This commit is contained in:
commit
03e75f19db
|
@ -1 +1 @@
|
|||
Subproject commit 16e808c3a97ba4c47dd683f1daa79b4459b20202
|
||||
Subproject commit 670d2f3fc39f4803f5a72bf125c0aea7a146a100
|
|
@ -501,6 +501,16 @@ void Load_MenuInfo(void)
|
|||
|
||||
if(Check_OTA() == TRUE){
|
||||
DBG_DUMP("OTA success, reset system param\n");
|
||||
|
||||
#if HUNTING_CAMERA_MCU == ENABLE
|
||||
if(sf_get_ui_para_flag())
|
||||
{
|
||||
memcpy(&origInfo, ¤tInfo, sizeof(currentInfo));
|
||||
memcpy(&origInfo_check, ¤tInfo, sizeof(currentInfo));
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
SysResetFlag();
|
||||
|
||||
#if HUNTING_CAMERA_MCU == ENABLE
|
||||
|
@ -515,7 +525,7 @@ void Load_MenuInfo(void)
|
|||
//origInfo_check = currentInfo;
|
||||
memcpy(&origInfo, ¤tInfo, sizeof(currentInfo));
|
||||
memcpy(&origInfo_check, ¤tInfo, sizeof(currentInfo));
|
||||
sf_share_mem_customer_down(0);
|
||||
//sf_share_mem_customer_down(0);
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
@ -698,14 +708,19 @@ EXIT:
|
|||
}
|
||||
|
||||
if(((UIMenuStoreInfo*)tmpInfo)->uhInfoSize == sizeof(currentInfo)){
|
||||
memcpy(¤tInfo, tmpInfo, sizeof(currentInfo));
|
||||
|
||||
#if HUNTING_CAMERA_MCU == ENABLE
|
||||
if(!sf_get_ui_para_flag())
|
||||
{
|
||||
memcpy(¤tInfo, tmpInfo, sizeof(currentInfo));
|
||||
}
|
||||
if(currentInfo.OtaFlag)
|
||||
{
|
||||
SysResetFlag();
|
||||
currentInfo.uhInfoSize = sizeof(currentInfo);
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
else{
|
||||
DBG_WRN("menu info size loaded from flash seems incorrect(old:%lu new:%lu), reset menu info\n",
|
||||
|
|
|
@ -62,7 +62,6 @@ SINT32 eg91_gps_search(SF_FN_PARAM_S *pfnParam,SF_PARA_TIME_S *pNowTime,UINT8 au
|
|||
|
||||
SINT32 eg91_gps_Isupdate(SF_FN_PARAM_S *pfnParam,UINT8 *pIsupdate,SF_PARA_TIME_S *pNowTime,UINT8 u8day);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
|
|
|
@ -66,7 +66,7 @@ UINT32 sf_auto_operation_adjust(void)
|
|||
}
|
||||
else if((SF_STRNCMP(puiPara->OperatorCode, "46003", 5) == 0) || (SF_STRNCMP(puiPara->OperatorCode, "46005", 5) == 0) || (SF_STRNCMP(puiPara->OperatorCode, "46011", 5) == 0))//china Telecom
|
||||
{
|
||||
SF_STRCPY(puiPara->Sim4gApn, "CTNET");
|
||||
SF_STRCPY(puiPara->Sim4gApn, "vzwinternet");
|
||||
SF_STRCPY(puiPara->Sim4gUsr, "\0");
|
||||
SF_STRCPY(puiPara->Sim4gPwd, "\0");
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
#include "sf_hal_ttyusb.h"
|
||||
#include "sf_eg91_server.h"
|
||||
#include "sf_eg91_gps.h"
|
||||
#include "sf_eg91_sim.h"
|
||||
#include "sf_param_common.h"
|
||||
#include "sf_module.h"
|
||||
|
||||
|
@ -63,6 +64,7 @@ static void gps_infor_convert(SF_CHAR *str)
|
|||
memcpy(str, strTemp, 4);
|
||||
}
|
||||
|
||||
|
||||
SINT32 eg91_gps_greendate_Get(SF_FN_PARAM_S *pfnParam,SF_PARA_TIME_S *pNowTime)
|
||||
{
|
||||
SINT32 ttyRet = SF_SUCCESS;
|
||||
|
@ -311,7 +313,6 @@ SINT32 eg91_gps_greendate_Get(SF_FN_PARAM_S *pfnParam,SF_PARA_TIME_S *pNowTime)
|
|||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
SINT32 eg91_gps_Isupdate(SF_FN_PARAM_S *pfnParam,UINT8 *pIsupdate,SF_PARA_TIME_S *pNowTime,UINT8 u8day)
|
||||
{
|
||||
|
||||
|
|
|
@ -3417,7 +3417,13 @@ SINT32 sf_net_regist_manual(void)
|
|||
}
|
||||
else
|
||||
{
|
||||
sprintf((char *)gsmPara, "AT+RSTSET\r");
|
||||
//sprintf((char *)gsmPara, "AT+RSTSET\r");
|
||||
//sprintf((char *)gsmPara, "AT+CGREG?\r");
|
||||
//eNetRegLocation = QUECTEL_NETREG_CGREG;
|
||||
//callTime = SF_QUECTEL_NET_REG_CALLTIME_MAX; /*4 min*/
|
||||
sprintf((char *)gsmPara, "%s", "AT+CGDCONT=1,\"IPV4V6\",\"\"\r");
|
||||
eNetRegLocation = QUECTEL_NETREG_CGDCONT;
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -3477,6 +3483,9 @@ SINT32 sf_net_regist_manual(void)
|
|||
if(ret == SF_SUCCESS)
|
||||
{
|
||||
eNetRegLocation = QUECTEL_NETREG_FRIST;
|
||||
//sprintf((char *)gsmPara, "AT+CGREG?\r");
|
||||
//eNetRegLocation = QUECTEL_NETREG_CGREG;
|
||||
//callTime = SF_QUECTEL_NET_REG_CALLTIME_MAX;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -3513,7 +3522,7 @@ SINT32 sf_net_regist_manual(void)
|
|||
#if SF_TEST_ERROR_CODE
|
||||
sf_test_code_err(eNetRegLocation, "+CGREG: 0,2");
|
||||
#endif
|
||||
|
||||
SF_DEBUG("Sim4gApn=%s", puiPara->Sim4gApn);
|
||||
if((strstr((const char *)gsmPara, "+CGREG: 2,1") != NULL) || (strstr((const char *)gsmPara, "+CGREG: 0,1") != NULL) || (strstr((const char *)gsmPara, "+CGREG: 0,5") != NULL))
|
||||
{
|
||||
if(PWR_ON_TIME_SYNC == sf_poweron_type_get())
|
||||
|
@ -4789,6 +4798,7 @@ SINT32 sf_get_ntp(SINT32 value, SF_PARA_TIME_S *current_time)
|
|||
UIMenuStoreInfo *pPara = sf_app_ui_para_get();
|
||||
SF_TTY_DATA_TYPE_S ttyData = { .waitMs = 2000, .len = 3, .lenMax = (GPRS_INFO_LINE_MAX-1), .cmp = "OK", .cmperr = "ERROR", .data = gsmPara};
|
||||
|
||||
SF_DEBUG("Sim4gApn=%s", pPara->Sim4gApn);
|
||||
sf_gsm_para_buff_clear();
|
||||
|
||||
pdpIndex = sf_get_pdp_index();
|
||||
|
@ -4997,6 +5007,7 @@ UINT8 sf_get_pdp_index(void)
|
|||
|
||||
UIMenuStoreInfo *pPara = sf_app_ui_para_get();
|
||||
|
||||
SF_DEBUG("Sim4gApn=%s", pPara->Sim4gApn);
|
||||
if(strstr((const char *)pPara->Sim4gApn, APN_4G_VERIZON))
|
||||
{
|
||||
pdpIndex = V_PDP_INDEX;
|
||||
|
|
|
@ -75,7 +75,7 @@ SINT32 sf_auto_operation_adaptation(SF_CHAR *operatorName, UIMenuStoreInfo *sim_
|
|||
}
|
||||
else if((strncmp(operatorName, "46003", 5) == 0) || (strncmp(operatorName, "46005", 5) == 0) || (strncmp(operatorName, "46011", 5) == 0))//china telcom
|
||||
{
|
||||
strcpy(sim_info_t->Sim4gApn, "CTNET");
|
||||
strcpy(sim_info_t->Sim4gApn, "vzwinternet");
|
||||
strcpy(sim_info_t->Sim4gUsr, "\0");
|
||||
strcpy(sim_info_t->Sim4gPwd, "\0");
|
||||
|
||||
|
|
|
@ -103,7 +103,7 @@ int main(int argc, char *argv[])
|
|||
{
|
||||
printf("*********************************************\n");
|
||||
printf("* *\n");
|
||||
printf("* sf_app-v3 *\n");
|
||||
printf("* sf_app-v5-0912 *\n");
|
||||
printf("* *\n");
|
||||
printf("*********************************************\n");
|
||||
//gpio_direction_input(C_GPIO(10));
|
||||
|
|
|
@ -122,6 +122,9 @@ UINT32 sf_cardv_cap_start(void);
|
|||
UINT32 sf_cardv_hd_cap_start(void);
|
||||
void sf_cardv_set_wait_shared_condition(int in);
|
||||
int sf_cardv_para_signaling_start(void);
|
||||
void sf_cardv_wifi_send(void);
|
||||
void sf_set_ui_para_flag(UINT8 flag);
|
||||
UINT8 sf_get_ui_para_flag(void);
|
||||
BOOL sf_cmd_ftp_ota(unsigned char argc, char **argv);
|
||||
BOOL sf_cmd_switch_esim(unsigned char argc, char **argv);
|
||||
|
||||
|
|
|
@ -89,6 +89,7 @@ static pthread_cond_t condition;
|
|||
static pthread_mutex_t Param_mutexLock;
|
||||
static int shared_condition = 1;
|
||||
static SINT32 WifiSocket = 0;
|
||||
static UINT8 UiparaFlag = 0;
|
||||
static SF_THREAD_S UpgradeTskParam =
|
||||
{
|
||||
.IsRun = 0,
|
||||
|
@ -1656,6 +1657,7 @@ static SINT32 sf_cardv_proccess_cmd_para_update(SF_MESSAGE_BUF_S *pMessageBuf)
|
|||
{
|
||||
case SF_PARA_CMD_UPDATE:
|
||||
//MLOGI("NeedTimeSyncStartUp = %d\n",puiPara->NeedTimeSyncStartUp);
|
||||
sf_set_ui_para_flag(1);
|
||||
sf_share_mem_customer_update();
|
||||
//MLOGI("NeedTimeSyncStartUp = %d\n",puiPara->NeedTimeSyncStartUp);
|
||||
break;
|
||||
|
@ -1709,7 +1711,7 @@ void sf_cardv_wifi_send()
|
|||
|
||||
if(SF_SUCCESS == sf_share_mem_hd_update())
|
||||
{
|
||||
SF_REPORT_WIFI_ATTR_S* wifiCfg = sf_wifi_cfg_get();
|
||||
//SF_REPORT_WIFI_ATTR_S* wifiCfg = sf_wifi_cfg_get();
|
||||
fd = sf_get_wifi_socket();
|
||||
|
||||
SF_CHAR filePath[64] = { 0 };
|
||||
|
@ -2681,3 +2683,13 @@ UINT32 sf_cardv_hd_cap_start(void)
|
|||
HdCapTskCfg.IsRun = 1;
|
||||
return SF_SUCCESS;
|
||||
}
|
||||
|
||||
UINT8 sf_get_ui_para_flag(void)
|
||||
{
|
||||
return UiparaFlag;
|
||||
}
|
||||
|
||||
void sf_set_ui_para_flag(UINT8 flag)
|
||||
{
|
||||
UiparaFlag = flag;
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
hdal-memory {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
media { reg = <0x03600000 0x04A00000>; };
|
||||
media { reg = <0x03700000 0x04900000>; };
|
||||
};
|
||||
|
||||
hdal-maxpath-cfg {
|
||||
|
|
|
@ -882,6 +882,12 @@ static int load_linux_from_flash(LINUXTMP_PARTITION *p_linuxtmp, FDT_INFO *p_fdt
|
|||
|
||||
LINUX_BOOT_MSG("*linuxtmp used size = %lx , linux compressed / uncompressed size = %lx / %lx ******\n", p_linuxtmp->tmp_curr - p_linuxtmp->tmp_begin, fastload.MemComp.size, fastload.MemUnComp.size);
|
||||
|
||||
if(p_linuxtmp->tmp_curr > p_fdt_info->hdal_addr){
|
||||
DBG_ERR("linux tmp buffer overflow(curr:%lx), hdal media buffer(%lx) may be corrupted!!\n", p_linuxtmp->tmp_curr, p_fdt_info->hdal_addr);
|
||||
vos_util_delay_ms(100); // add delay to show dbg_fatal message in linux
|
||||
vos_debug_halt();
|
||||
}
|
||||
|
||||
cmd.Idx = FWSRV_CMD_IDX_FASTLOAD;
|
||||
cmd.In.pData = &fastload;
|
||||
cmd.In.uiNumByte = sizeof(fastload);
|
||||
|
|
|
@ -16,7 +16,8 @@
|
|||
#include "PhotoFast.h"
|
||||
#include <kwrap/cmdsys.h>
|
||||
#include "DxHunting.h"
|
||||
|
||||
#include "UIAppPhoto_Param.h"
|
||||
#include "DCF.h"
|
||||
#if HUNTING_CAMERA_MCU == ENABLE
|
||||
#include <sf_mcu.h>
|
||||
#endif
|
||||
|
@ -109,7 +110,7 @@ static void PhotoFast_SliceEncode_Get_Src_Slice_Info(
|
|||
src_info->height = video_frame.dim.h;
|
||||
|
||||
if(src_info->slice_num > 1){
|
||||
src_info->slice_height = ALIGN_CEIL((src_info->width * dst_info->slice_height) / dst_info->width, 2);
|
||||
src_info->slice_height = ALIGN_CEIL((src_info->height) / src_info->slice_num, 2);
|
||||
src_info->last_slice_height = ALIGN_CEIL(src_info->height - src_info->slice_height * (src_info->slice_num - 1), 2);
|
||||
}
|
||||
else{
|
||||
|
@ -117,6 +118,14 @@ static void PhotoFast_SliceEncode_Get_Src_Slice_Info(
|
|||
src_info->last_slice_height = src_info->slice_height;
|
||||
}
|
||||
|
||||
if(src_info->slice_height * (src_info->slice_num - 1) >= src_info->height){
|
||||
DBG_ERR("aligned total slice height(%lu * %lu + %lu = %lu) exceed photo height(%lu)!\n",
|
||||
src_info->slice_height,
|
||||
src_info->slice_num - 1,
|
||||
src_info->last_slice_height,
|
||||
src_info->height);
|
||||
}
|
||||
|
||||
PHOTOFAST_SLICE_ENC_DUMP("Src Slice Info: size = {%lu,%lu} slice num = {%lu} slice height = {%lu} last slice height = {%lu}\r\n",
|
||||
src_info->width, src_info->height, src_info->slice_num, src_info->slice_height, src_info->last_slice_height);
|
||||
}
|
||||
|
@ -125,7 +134,7 @@ INT32 PhotoFast_SliceEncode_Get_Max_Dst_Slice_Buffer_Size(HD_VIDEO_PXLFMT pxl_fm
|
|||
{
|
||||
HD_DIM dim = PhotoFast_SliceEncode_Get_Encode_Max_Size();
|
||||
UINT32 reserved_buffer = 0;
|
||||
UINT32 max_buffer_size = VDO_YUV_BUFSIZE(dim.w, dim.h, pxl_fmt) + reserved_buffer;
|
||||
UINT32 max_buffer_size = VDO_YUV_BUFSIZE(ALIGN_CEIL(dim.w, 16), ALIGN_CEIL(dim.h, 16), pxl_fmt) + reserved_buffer;
|
||||
|
||||
return max_buffer_size;
|
||||
}
|
||||
|
@ -135,11 +144,17 @@ static INT32 PhotoFast_SliceEncode_Get_Dst_Slice_Info(PhotoFast_SliceSize_Info *
|
|||
info->width = cap_size_w;
|
||||
info->height = cap_size_h;
|
||||
info->slice_num = slice_num;
|
||||
|
||||
if(info->height == 1080 && slice_num == 1){
|
||||
info->slice_height = info->height;
|
||||
}
|
||||
else{
|
||||
info->slice_height = ALIGN_CEIL_16(info->height / info->slice_num);
|
||||
}
|
||||
|
||||
if(info->slice_height * (info->slice_num - 1) > info->height){
|
||||
|
||||
DBG_ERR("calculate last slice height error!\n");
|
||||
DBG_ERR("calculate last slice height error!(slice_height = %lu, slice_num = %lu, photo height = %lu)\n", info->slice_height, info->slice_num, info->height);
|
||||
return E_SYS;
|
||||
}
|
||||
|
||||
|
@ -151,33 +166,136 @@ static INT32 PhotoFast_SliceEncode_Get_Dst_Slice_Info(PhotoFast_SliceSize_Info *
|
|||
return E_OK;
|
||||
}
|
||||
|
||||
INT32 PhotoFast_SliceEncode_Get_Curr_Dst_Slice_Info(PhotoFast_SliceSize_Info *info)
|
||||
INT32 PhotoFast_SliceEncode_Get_Curr_Dst_Slice_Info(PhotoFast_SliceSize_Info *info, const HD_VIDEO_FRAME src_frame)
|
||||
{
|
||||
UINT32 cap_size_w = GetPhotoSizeWidth(SysGetFlag(FL_PHOTO_SIZE));
|
||||
UINT32 cap_size_h = GetPhotoSizeHeight(SysGetFlag(FL_PHOTO_SIZE));
|
||||
UINT32 max_slice_num;
|
||||
UINT32 slice_num;
|
||||
|
||||
unsigned int cap_size = cap_size_w * cap_size_h;
|
||||
unsigned int buf_size = CFG_PHOTOFAST_SLICE_ENC_PRIMARY_BUF_WIDTH * CFG_PHOTOFAST_SLICE_ENC_PRIMARY_BUF_HEIGHT;
|
||||
|
||||
if(buf_size > cap_size){
|
||||
max_slice_num = 1;
|
||||
slice_num = 1;
|
||||
}
|
||||
else{
|
||||
PHOTOFAST_SLICE_ENC_DUMP("cap_size = %lu buf_size = %lu\n", cap_size, buf_size);
|
||||
|
||||
UINT32 lines = (buf_size / cap_size_w);
|
||||
slice_num = cap_size_h / lines + (cap_size_h % lines ? 1 : 0);
|
||||
max_slice_num = cap_size_h / lines + (cap_size_h % lines ? 1 : 0);
|
||||
|
||||
UINT32 tmp_src_h = src_frame.dim.h / 2;
|
||||
UINT32 tmp_dst_h = cap_size_h / 16;
|
||||
UINT32 found_common_factor = 0;
|
||||
UINT32 i;
|
||||
|
||||
for (i = 1; i <= (tmp_src_h > tmp_dst_h ? tmp_dst_h : tmp_src_h) ; ++i)
|
||||
{
|
||||
if (tmp_src_h % i == 0 && tmp_dst_h % i == 0)
|
||||
{
|
||||
PHOTOFAST_SLICE_ENC_DUMP("common factor = %d\n", i);
|
||||
|
||||
if(max_slice_num < i){
|
||||
found_common_factor = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(found_common_factor){
|
||||
slice_num = found_common_factor;
|
||||
PHOTOFAST_SLICE_ENC_DUMP("use common factor %d\n ", slice_num);
|
||||
}
|
||||
else{
|
||||
slice_num = max_slice_num;
|
||||
PHOTOFAST_SLICE_ENC_DUMP("use max slice num %d\n ", slice_num);
|
||||
}
|
||||
}
|
||||
|
||||
return PhotoFast_SliceEncode_Get_Dst_Slice_Info(info, cap_size_w, cap_size_h, slice_num);
|
||||
}
|
||||
|
||||
static HD_DIM PhotoFast_SliceEncode_Get_Encode_Max_Size()
|
||||
static UINT32 PhotoFast_SliceEncode_Get_Max_Dst_Slice_Info(PhotoFast_SliceSize_Info *info)
|
||||
{
|
||||
static PhotoFast_SliceSize_Info max_slice_info = {0};
|
||||
UINT32 max_slice_num;
|
||||
UINT32 slice_num;
|
||||
INT32 ret = E_OK;
|
||||
UIAPP_PHOTO_SENSOR_INFO *sensor_info = UIAppPhoto_get_SensorInfo(0);
|
||||
unsigned int buf_size = CFG_PHOTOFAST_SLICE_ENC_PRIMARY_BUF_WIDTH * CFG_PHOTOFAST_SLICE_ENC_PRIMARY_BUF_HEIGHT;
|
||||
|
||||
/* search max slice (slice height * slice width) */
|
||||
if(!max_slice_info.slice_height || !max_slice_info.width){
|
||||
|
||||
UINT8 cap_idx = 0;
|
||||
|
||||
for(cap_idx = PHOTO_MAX_CAP_SIZE ; cap_idx <= PHOTO_SLICE_ENC_MIN_CAP_SIZE ; cap_idx++)
|
||||
{
|
||||
HD_DIM tmp_cap_size = {0};
|
||||
PhotoFast_SliceSize_Info tmp_slice_info = {0};
|
||||
|
||||
tmp_cap_size = (HD_DIM){GetPhotoSizeWidth(cap_idx), GetPhotoSizeHeight(cap_idx)};
|
||||
|
||||
if(buf_size > (tmp_cap_size.w * tmp_cap_size.h)){
|
||||
max_slice_num = 1;
|
||||
slice_num = 1;
|
||||
}
|
||||
else{
|
||||
PHOTOFAST_SLICE_ENC_DUMP("cap_size = %lu buf_size = %lu\n", tmp_cap_size.w * tmp_cap_size.h, buf_size);
|
||||
|
||||
UINT32 lines = (buf_size / tmp_cap_size.w);
|
||||
max_slice_num = tmp_cap_size.h / lines + (tmp_cap_size.h % lines ? 1 : 0);
|
||||
|
||||
UINT32 tmp_src_h = sensor_info->sSize.h / 2;
|
||||
UINT32 tmp_dst_h = tmp_cap_size.h / 16;
|
||||
UINT32 found_common_factor = 0;
|
||||
UINT32 i;
|
||||
|
||||
for (i = 1; i <= (tmp_src_h > tmp_dst_h ? tmp_dst_h : tmp_src_h) ; ++i)
|
||||
{
|
||||
if (tmp_src_h % i == 0 && tmp_dst_h % i == 0)
|
||||
{
|
||||
PHOTOFAST_SLICE_ENC_DUMP("common factor = %d\n", i);
|
||||
|
||||
if(max_slice_num < i){
|
||||
found_common_factor = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(found_common_factor){
|
||||
slice_num = found_common_factor;
|
||||
PHOTOFAST_SLICE_ENC_DUMP("use common factor %d\n ", slice_num);
|
||||
}
|
||||
else{
|
||||
slice_num = max_slice_num;
|
||||
PHOTOFAST_SLICE_ENC_DUMP("use max slice num %d\n ", slice_num);
|
||||
}
|
||||
}
|
||||
|
||||
ret = PhotoFast_SliceEncode_Get_Dst_Slice_Info(&tmp_slice_info, tmp_cap_size.w, tmp_cap_size.h, slice_num);
|
||||
|
||||
if((tmp_slice_info.slice_height * tmp_slice_info.width) > (max_slice_info.slice_height * max_slice_info.width)){
|
||||
max_slice_info = tmp_slice_info;
|
||||
}
|
||||
}
|
||||
|
||||
PHOTOFAST_SLICE_ENC_DUMP("max dst slice = {%lu, %lu}, cap idx = %lu\n", max_slice_info.width, max_slice_info.slice_height, cap_idx);
|
||||
}
|
||||
|
||||
*info = max_slice_info;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static HD_DIM PhotoFast_SliceEncode_Get_Encode_Max_Size(void)
|
||||
{
|
||||
PhotoFast_SliceSize_Info info;
|
||||
|
||||
if(PhotoFast_SliceEncode_Get_Curr_Dst_Slice_Info(&info) != E_OK)
|
||||
if(PhotoFast_SliceEncode_Get_Max_Dst_Slice_Info(&info) != E_OK)
|
||||
return (HD_DIM){0, 0};
|
||||
|
||||
HD_DIM dim_max_slice = {info.width, info.slice_height};
|
||||
|
@ -187,7 +305,7 @@ static HD_DIM PhotoFast_SliceEncode_Get_Encode_Max_Size()
|
|||
|
||||
static UINT32 PhotoFast_SliceEncode_Get_Encode_Max_Bitrate(HD_VIDEO_PXLFMT vproc_out_pxlfmt)
|
||||
{
|
||||
const UINT32 ratio = 4;
|
||||
const UINT32 ratio = CFG_PHOTOFAST_SLICE_ENC_BS_BUF_RATIO;
|
||||
UINT32 bitrate;
|
||||
HD_DIM dim = PhotoFast_SliceEncode_Get_Encode_Max_Size();
|
||||
|
||||
|
@ -307,7 +425,7 @@ INT32 PhotoFast_SliceEncode_Open(const HD_PATH_ID vproc_path_id)
|
|||
HD_OUT_ID out = HD_VIDEOENC_OUT(0, first_out_port);
|
||||
|
||||
/* calculate dst slice info */
|
||||
if(PhotoFast_SliceEncode_Get_Curr_Dst_Slice_Info(&dst_slice_info) != E_OK){
|
||||
if(PhotoFast_SliceEncode_Get_Max_Dst_Slice_Info(&dst_slice_info) != E_OK){
|
||||
goto EXIT;
|
||||
}
|
||||
|
||||
|
@ -317,13 +435,15 @@ INT32 PhotoFast_SliceEncode_Open(const HD_PATH_ID vproc_path_id)
|
|||
ret = hd_videoproc_get(vproc_path_id, HD_VIDEOPROC_PARAM_OUT, (VOID*)&vproc_out);
|
||||
if(ret != HD_OK){
|
||||
DBG_ERR("hd_videoproc_get HD_VIDEOPROC_PARAM_OUT failed(path_id=%lx, ret=%d)!", vproc_path_id, ret);
|
||||
goto EXIT;
|
||||
vproc_out_pxlfmt = HD_VIDEO_PXLFMT_YUV420;
|
||||
}
|
||||
|
||||
else{
|
||||
vproc_out_pxlfmt = vproc_out.pxlfmt;
|
||||
}
|
||||
}
|
||||
|
||||
if ((ret = hd_videoenc_init()) != HD_OK){
|
||||
ret = hd_videoenc_init();
|
||||
if (ret != HD_OK && ret != HD_ERR_UNINIT){
|
||||
DBG_ERR("hd_videoenc_init failed (%d)\r\n", ret);
|
||||
goto EXIT;
|
||||
}
|
||||
|
@ -350,7 +470,7 @@ INT32 PhotoFast_SliceEncode_Open(const HD_PATH_ID vproc_path_id)
|
|||
|
||||
/* calculate max buffer for slice */
|
||||
info->yuv_buf_mem_info.blk_size = PhotoFast_SliceEncode_Get_Max_Dst_Slice_Buffer_Size(vproc_out_pxlfmt);
|
||||
if(PhotoFast_SliceEncode_Get_Curr_Dst_Slice_Info(&max_info) != E_OK)
|
||||
if(PhotoFast_SliceEncode_Get_Max_Dst_Slice_Info(&max_info) != E_OK)
|
||||
goto EXIT;
|
||||
|
||||
bitrate = PhotoFast_SliceEncode_Get_Encode_Max_Bitrate(vproc_out_pxlfmt);
|
||||
|
@ -643,7 +763,9 @@ static INT32 PhotoFast_SliceEncode_Init_VF_GFX_Slice(
|
|||
addr_dst[0], addr_dst[1]
|
||||
);
|
||||
|
||||
if(slice_idx == (dst_slice_info.slice_num - 1)){
|
||||
if(slice_idx == (dst_slice_info.slice_num - 1) &&
|
||||
dst_scale_slice_height < dst_slice_info.last_slice_height
|
||||
){
|
||||
|
||||
HD_GFX_DRAW_RECT draw_rect = {0};
|
||||
|
||||
|
@ -1116,7 +1238,7 @@ EXIT:
|
|||
DBG_ERR("hd_videoenc_stop failed(%d)\r\n", ret);
|
||||
}
|
||||
|
||||
return (ret == HD_OK) ? E_OK : E_SYS;
|
||||
return (ret == HD_OK) ? E_OK : ret;
|
||||
|
||||
}
|
||||
|
||||
|
@ -1196,7 +1318,6 @@ static INT32 PhotoFast_SliceEncode_Encode_Primary(
|
|||
dst_slice_info,
|
||||
slice_idx);
|
||||
|
||||
|
||||
if(vf_gfx_scale(&vf_gfx_scale_param, 1) != HD_OK){
|
||||
goto EXIT;
|
||||
}
|
||||
|
@ -1427,15 +1548,18 @@ INT32 PhotoFast_SliceEncode(const HD_PATH_ID vproc_path_id, const HD_VIDEO_FRAME
|
|||
ret = hd_videoproc_get(vproc_path_id, HD_VIDEOPROC_PARAM_OUT, (VOID*)&vproc_out);
|
||||
if(ret != HD_OK){
|
||||
DBG_ERR("hd_videoproc_get HD_VIDEOPROC_PARAM_OUT failed(path_id=%lx, ret=%d)!", vproc_path_id, ret);
|
||||
goto EXIT;
|
||||
vproc_out_pxlfmt = HD_VIDEO_PXLFMT_YUV420;
|
||||
}
|
||||
else{
|
||||
vproc_out_pxlfmt = vproc_out.pxlfmt;
|
||||
}
|
||||
|
||||
vproc_out_pxlfmt = vproc_out.pxlfmt;
|
||||
|
||||
|
||||
/*******************************************************************
|
||||
* Calculate dst slice info
|
||||
******************************************************************/
|
||||
if(PhotoFast_SliceEncode_Get_Curr_Dst_Slice_Info(&dst_slice_info) != E_OK){
|
||||
if(PhotoFast_SliceEncode_Get_Curr_Dst_Slice_Info(&dst_slice_info, video_frame) != E_OK){
|
||||
return NVTEVT_CONSUME;
|
||||
}
|
||||
|
||||
|
@ -1482,11 +1606,12 @@ INT32 PhotoFast_SliceEncode(const HD_PATH_ID vproc_path_id, const HD_VIDEO_FRAME
|
|||
}
|
||||
|
||||
// slice_encode_primary_info->bs_buf_mem_info.blk_size = (VDO_YUV_BUFSIZE(dst_slice_info.width, dst_slice_info.height, video_frame.pxlfmt) / (CFG_PHOTOFAST_SLICE_ENC_BS_BUF_RATIO)) + CFG_JPG_HEADER_SIZE + PhotoFast_GetScreenNailSize() ;
|
||||
slice_encode_primary_info->bs_buf_mem_info.blk_size = ((PhotoFast_SliceEncode_Get_Encode_Max_Bitrate(HD_VIDEO_PXLFMT_YUV420)/ 8) * (dst_slice_info.slice_num + 2)) + CFG_JPG_HEADER_SIZE + PhotoFast_GetScreenNailSize() ;
|
||||
slice_encode_primary_info->bs_buf_mem_info.blk_size = ((PhotoFast_SliceEncode_Get_Encode_Max_Bitrate(HD_VIDEO_PXLFMT_YUV420)/ 8) * (dst_slice_info.slice_num + 1)) + CFG_JPG_HEADER_SIZE + PhotoFast_GetScreenNailSize() ;
|
||||
if(PhotoFast_SliceEncode_Alloc_Buffer(&slice_encode_primary_info->bs_buf_mem_info, "slice_enc_primary") != E_OK){
|
||||
goto EXIT;
|
||||
}
|
||||
|
||||
PhotoFastCapDateImprint_GenYuvData(&video_frame);
|
||||
/* check free mem */
|
||||
#if POWERON_FAST_BOOT_MSG == ENABLE
|
||||
nvt_cmdsys_runcmd("nvtmpp info");
|
||||
|
@ -1617,7 +1742,7 @@ INT32 PhotoFast_SliceEncode(const HD_PATH_ID vproc_path_id, const HD_VIDEO_FRAME
|
|||
|
||||
DBG_DUMP("elapsed time of slice encode without write file = %lu us\n", tick_end - tick_start);
|
||||
|
||||
extern INT32 PhotoFast_WriteFile(UINT32 Addr, UINT32 Size, UINT32 Fmt, UINT32 uiPathId);
|
||||
extern INT32 PhotoFast_WriteFile(UINT32 Addr, UINT32 Size, UINT32 Fmt, UINT32 uiPathId, char* path);
|
||||
|
||||
|
||||
if(fastboot_wait_done_timeout(BOOT_INIT_FILESYSOK, FASTBOOT_WAIT_FILESYS_TIMEOUT_MS) != E_OK){
|
||||
|
@ -1632,6 +1757,7 @@ INT32 PhotoFast_SliceEncode(const HD_PATH_ID vproc_path_id, const HD_VIDEO_FRAME
|
|||
dst_jpg_file.addr,
|
||||
dst_jpg_file.size,
|
||||
NAMERULE_FMT_JPG,
|
||||
0,
|
||||
0);
|
||||
|
||||
EXIT:
|
||||
|
@ -1740,6 +1866,12 @@ typedef struct {
|
|||
PhotoFast_MEM_Info mem_info_combined;
|
||||
PhotoFast_MEM_Info mem_info_thumb;
|
||||
PhotoFast_SliceEncode_Queue_Comm_Param comm;
|
||||
|
||||
#if PHOTOFAST_FAST_CLOSE
|
||||
char file_path[NMC_TOTALFILEPATH_MAX_LEN];
|
||||
UINT32 nextFolderID;
|
||||
UINT32 nextFileID;
|
||||
#endif
|
||||
} PhotoFast_SliceEncode_Queue23_Param;
|
||||
|
||||
typedef struct {
|
||||
|
@ -1841,16 +1973,10 @@ INT32 PhotoFast_SliceEncode_CB2(void* user_data)
|
|||
hd_ret = hd_videoproc_get(vproc_path_id, HD_VIDEOPROC_PARAM_OUT, (VOID*)&vproc_out);
|
||||
if(hd_ret != HD_OK){
|
||||
DBG_ERR("hd_videoproc_get HD_VIDEOPROC_PARAM_OUT failed(path_id=%lx, ret=%d)!", vproc_path_id, ret);
|
||||
goto EXIT;
|
||||
vproc_out_pxlfmt = HD_VIDEO_PXLFMT_YUV420;
|
||||
}
|
||||
|
||||
else{
|
||||
vproc_out_pxlfmt = vproc_out.pxlfmt;
|
||||
|
||||
/*******************************************************************
|
||||
* Calculate dst slice info
|
||||
******************************************************************/
|
||||
if(PhotoFast_SliceEncode_Get_Curr_Dst_Slice_Info(&dst_slice_info) != E_OK){
|
||||
return NVTEVT_CONSUME;
|
||||
}
|
||||
|
||||
/* pull out vprc frame is in the CB1 */
|
||||
|
@ -1894,7 +2020,21 @@ INT32 PhotoFast_SliceEncode_CB2(void* user_data)
|
|||
goto EXIT;
|
||||
}
|
||||
|
||||
DBG_IND("process frame %lu\n", param->cnt);
|
||||
DBG_DUMP("process frame %lu\n", param->cnt);
|
||||
|
||||
/*******************************************************************
|
||||
* Fast Stamp (higher speed, lower quality)
|
||||
******************************************************************/
|
||||
#if PHOTOFAST_FAST_STAMP
|
||||
PhotoFastCapDateImprint_GenYuvData(&queue_ele_in->frame);
|
||||
#endif
|
||||
|
||||
/*******************************************************************
|
||||
* Calculate dst slice info
|
||||
******************************************************************/
|
||||
if(PhotoFast_SliceEncode_Get_Curr_Dst_Slice_Info(&dst_slice_info, queue_ele_in->frame) != E_OK){
|
||||
goto EXIT;
|
||||
}
|
||||
|
||||
/*******************************************************************
|
||||
* Calculate src slice info
|
||||
|
@ -1921,13 +2061,6 @@ INT32 PhotoFast_SliceEncode_CB2(void* user_data)
|
|||
goto EXIT;
|
||||
}
|
||||
|
||||
/*******************************************************************
|
||||
* Fast Stamp (higher speed, lower quality)
|
||||
******************************************************************/
|
||||
#if PHOTOFAST_FAST_STAMP
|
||||
PhotoFastCapDateImprint_GenYuvData(&queue_ele_in->frame);
|
||||
#endif
|
||||
|
||||
/*******************************************************************
|
||||
* Screennail & Thumbnail Scale
|
||||
******************************************************************/
|
||||
|
@ -2041,6 +2174,16 @@ INT32 PhotoFast_SliceEncode_CB2(void* user_data)
|
|||
queue_ele_out->mem_info_combined = slice_encode_primary_info->bs_buf_mem_info;
|
||||
queue_ele_out->mem_info_thumb = slice_encode_screennail_info->bs_buf_mem_info;
|
||||
|
||||
#if PHOTOFAST_FAST_CLOSE
|
||||
UINT32 nextFolderID = 0, nextFileID = 0;
|
||||
DCF_GetNextID(&nextFolderID,&nextFileID);
|
||||
queue_ele_out->nextFolderID = nextFolderID;
|
||||
queue_ele_out->nextFileID = nextFileID;
|
||||
DCF_MakeObjPath(nextFolderID, nextFileID, DCF_FILE_TYPE_JPG, queue_ele_out->file_path);
|
||||
DCF_AddDBfile(queue_ele_out->file_path);
|
||||
DBG_DUMP("%s added to DCF\r\n", queue_ele_out->file_path);
|
||||
#endif
|
||||
|
||||
while (lfqueue_enq(param->queue23, (void*) queue_ele_out) == -1)
|
||||
{
|
||||
DBG_ERR("ENQ Full ?\r\n");
|
||||
|
@ -2125,7 +2268,7 @@ INT32 PhotoFast_SliceEncode_CB3(void* user_data)
|
|||
/*******************************************************************
|
||||
* Output jpg file
|
||||
******************************************************************/
|
||||
extern INT32 PhotoFast_WriteFile(UINT32 Addr, UINT32 Size, UINT32 Fmt, UINT32 uiPathId);
|
||||
extern INT32 PhotoFast_WriteFile(UINT32 Addr, UINT32 Size, UINT32 Fmt, UINT32 uiPathId, char* Path);
|
||||
|
||||
if(fastboot_wait_done_timeout(BOOT_INIT_FILESYSOK, FASTBOOT_WAIT_FILESYS_TIMEOUT_MS) != E_OK){
|
||||
goto EXIT;
|
||||
|
@ -2135,17 +2278,40 @@ INT32 PhotoFast_SliceEncode_CB3(void* user_data)
|
|||
goto EXIT;
|
||||
}
|
||||
|
||||
#if !PHOTOFAST_FAST_CLOSE
|
||||
PhotoFast_WriteFile(
|
||||
(UINT32)queue_ele_in->jpg_combined_addr,
|
||||
queue_ele_in->jpg_combined_size,
|
||||
NAMERULE_FMT_JPG,
|
||||
0,
|
||||
0);
|
||||
|
||||
#else
|
||||
PhotoFast_WriteFile(
|
||||
(UINT32)queue_ele_in->jpg_combined_addr,
|
||||
queue_ele_in->jpg_combined_size,
|
||||
NAMERULE_FMT_JPG,
|
||||
0,
|
||||
queue_ele_in->file_path);
|
||||
#endif
|
||||
|
||||
{
|
||||
char tmp[NMC_TOTALFILEPATH_MAX_LEN] = {'\0'};
|
||||
|
||||
#if !PHOTOFAST_FAST_CLOSE
|
||||
extern CHAR* PhotoFast_GetLastWriteFilePath(void);
|
||||
char* file_path = PhotoFast_GetLastWriteFilePath();
|
||||
char tmp[256] = {'\0'};
|
||||
#else
|
||||
char file_path[NMC_TOTALFILEPATH_MAX_LEN];
|
||||
|
||||
#if HUNTING_CAMERA_MCU == ENABLE
|
||||
sprintf(tmp, "W%03ld%04ld.JPG", queue_ele_in->nextFolderID, queue_ele_in->nextFileID);
|
||||
strncpy(file_path, tmp, strlen(queue_ele_in->file_path) - 1);
|
||||
DBG_IND("last send file:%s\r\n", file_path);
|
||||
#else
|
||||
strncpy(file_path, FilePath, strlen(queue_ele_in->file_path) - 1);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if HUNTING_CAMERA_MCU == ENABLE
|
||||
char tmp2[64] = {'\0'};
|
||||
#endif
|
||||
|
|
|
@ -31,7 +31,7 @@ typedef struct
|
|||
INT32 PhotoFast_SliceEncode_Open(const HD_PATH_ID vproc_path_id);
|
||||
INT32 PhotoFast_SliceEncode_Close(void);
|
||||
INT32 PhotoFast_SliceEncode(const HD_PATH_ID vproc_path_id, const HD_VIDEO_FRAME *p_video_frame);
|
||||
INT32 PhotoFast_SliceEncode_Get_Curr_Dst_Slice_Info(PhotoFast_SliceSize_Info *info);
|
||||
INT32 PhotoFast_SliceEncode_Get_Curr_Dst_Slice_Info(PhotoFast_SliceSize_Info *info, const HD_VIDEO_FRAME src_frame);
|
||||
INT32 PhotoFast_SliceEncode_Get_Max_Dst_Slice_Buffer_Size(HD_VIDEO_PXLFMT pxl_fmt);
|
||||
|
||||
#if POWERON_FAST_SLICE_ENC_VER2 == ENABLE
|
||||
|
|
Loading…
Reference in New Issue
Block a user