From 4b5dadc827305687e9d9a7733608e23849297a38 Mon Sep 17 00:00:00 2001 From: "sober.song" Date: Fri, 5 Jan 2024 20:32:39 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=90=8D=EF=BC=8C=E5=A2=9E=E5=8A=A0=E5=AD=98=E5=82=A8=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E7=9B=98=E7=AC=A6=E6=A0=87=E8=AF=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cardv/SrcCode/PrjCfg_HUNTING_S550.h | 2 +- .../SrcCode/UIApp/Movie/UIAppMovie_Exe.c | 7 ++-- .../SrcCode/UIApp/Photo/UIAppPhoto_Exe.c | 9 +++-- .../source/sf_app/code/source/4gMng/sf_ftp.c | 15 ++++--- .../source/sf_app/code/source/4gMng/sf_sms.c | 7 +++- .../sf_app/code/source/storeMng/sf_storeMng.c | 14 ++++--- .../sf_app/code/source/wifi/sf_wifi_svr.c | 17 +++++--- .../sifar/code/source/common/sf_common.c | 9 ++++- .../cardv/SrcCode/UIApp/MovieFast/MovieFast.c | 40 ++++++++++++++++++- .../cardv/SrcCode/UIApp/PhotoFast/PhotoFast.c | 20 +++++++++- .../UIApp/PhotoFast/PhotoFastSliceEncode.c | 7 +++- 11 files changed, 114 insertions(+), 33 deletions(-) diff --git a/code/application/source/cardv/SrcCode/PrjCfg_HUNTING_S550.h b/code/application/source/cardv/SrcCode/PrjCfg_HUNTING_S550.h index f8f257ab6..44ceda96b 100755 --- a/code/application/source/cardv/SrcCode/PrjCfg_HUNTING_S550.h +++ b/code/application/source/cardv/SrcCode/PrjCfg_HUNTING_S550.h @@ -927,7 +927,7 @@ #define SF_BASE_VERSION "7MR5RCw4102" #define HW_S530 DISABLE #define DCF_DIR_NAME "MEDIA" /* 100MEDIA */ -#define DCF_FILE_NAME "SYGW" /* SYFW0001.JPG */ +#define DCF_FILE_NAME "SY" /* SYFW0001.JPG */ #define PHOTO_THUMB_PATH ":\\THUMB\\" #define MOVIE_THUMB_PATH ":\\THUMB\\" diff --git a/code/application/source/cardv/SrcCode/UIApp/Movie/UIAppMovie_Exe.c b/code/application/source/cardv/SrcCode/UIApp/Movie/UIAppMovie_Exe.c index 67d0b568f..d4523784b 100755 --- a/code/application/source/cardv/SrcCode/UIApp/Movie/UIAppMovie_Exe.c +++ b/code/application/source/cardv/SrcCode/UIApp/Movie/UIAppMovie_Exe.c @@ -1224,10 +1224,11 @@ BOOL MovieExe_CheckSNFull(void) static void MovieExe_FileNamingCB(MOVIE_CFG_REC_ID id, char *pFileName) { + UINT32 dcf_handle = (UINT32)System_Get_DCF_Handle(); /* 0:emmc 1:sd */ + char font = System_Get_DCF_Disk_Drive(dcf_handle) == 'B' ? 'B' : 'E'; #if USE_FILEDB static struct tm CurDateTime = {0}; - g_FileSerialNum++; if (g_FileSerialNum > FILE_SN_MAX) { @@ -1256,7 +1257,7 @@ static void MovieExe_FileNamingCB(MOVIE_CFG_REC_ID id, char *pFileName) #endif #elif USE_DCF - UINT32 dcf_handle = (UINT32) System_Get_DCF_Handle(); + //UINT32 dcf_handle = (UINT32) System_Get_DCF_Handle(); UINT32 nextFolderID = 0, nextFileID = 0; if (DCF_GetDBInfoEx(dcf_handle, DCF_INFO_IS_9999)) { @@ -1269,7 +1270,7 @@ static void MovieExe_FileNamingCB(MOVIE_CFG_REC_ID id, char *pFileName) DBG_DUMP("%s added to DCF Path%lu\r\n", pFileName, dcf_handle); #if HUNTING_CAMERA_MCU == ENABLE char tmp[NMC_TOTALFILEPATH_MAX_LEN] = {'\0'}; - sprintf(tmp, "S%03d%04d.JPG", nextFolderID, nextFileID); + sprintf(tmp, "S%c%03d%04d.JPG", font, nextFolderID, nextFileID); if(id == _CFG_REC_ID_1){ snprintf(thumb_current_path_main, sizeof(thumb_current_path_main), "%s", tmp); } diff --git a/code/application/source/cardv/SrcCode/UIApp/Photo/UIAppPhoto_Exe.c b/code/application/source/cardv/SrcCode/UIApp/Photo/UIAppPhoto_Exe.c index c4947f9c4..3db23be68 100755 --- a/code/application/source/cardv/SrcCode/UIApp/Photo/UIAppPhoto_Exe.c +++ b/code/application/source/cardv/SrcCode/UIApp/Photo/UIAppPhoto_Exe.c @@ -6884,6 +6884,7 @@ INT32 PhotoExe_Preview_SliceEncode_CB3(void* user_data) char* file_path = ImageApp_Photo_GetLastWriteFilePath(); char tmp[256] = {'\0'}; UINT32 length = strlen(file_path); + char font = System_Get_DCF_Disk_Drive(dcf_handle) == 'B' ? 'B' : 'E'; #if HUNTING_CAMERA_MCU == ENABLE char folder[4], number[5]; @@ -6893,7 +6894,7 @@ INT32 PhotoExe_Preview_SliceEncode_CB3(void* user_data) strncpy(number, file_path + length - 8, 4); number[4] = '\0'; - snprintf(tmp, sizeof(tmp), "%c%sW%s%s.JPG", System_Get_DCF_Disk_Drive(dcf_handle), PHOTO_THUMB_PATH, folder, number); /* DCF 8.3 naming rule */ + snprintf(tmp, sizeof(tmp), "%c%sW%c%s%s.JPG", System_Get_DCF_Disk_Drive(dcf_handle), PHOTO_THUMB_PATH, font, SF_SEND_LIST_DIR, folder, number); /* DCF 8.3 naming rule */ #else @@ -6919,8 +6920,10 @@ INT32 PhotoExe_Preview_SliceEncode_CB3(void* user_data) else if(SF_CAM_MODE_VIDEO2 == sf_get_cammode_statu()){ enFileType = SF_FILE_TYPE_PIC_VIDEO; } - snprintf(tmp, sizeof(tmp), "%s%sW%s%s.JPG", System_Get_DCF_Disk_Drive(dcf_handle) == 'B' ? SF_EMMC_ROOT : SF_SD_ROOT, SF_SEND_LIST_DIR, folder, number); /* DCF 8.3 naming rule */ - snprintf(tmp2, sizeof(tmp2), "W%s%s.JPG", folder, number); /* DCF 8.3 naming rule */ + snprintf(tmp, sizeof(tmp), "%s%sW%c%s%s.JPG", System_Get_DCF_Disk_Drive(dcf_handle) == 'B' ? SF_EMMC_ROOT : SF_SD_ROOT, SF_SEND_LIST_DIR, + font, folder, number); /* DCF 8.3 naming rule */ + + snprintf(tmp2, sizeof(tmp2), "W%c%s%s.JPG", font, folder, number); /* DCF 8.3 naming rule */ DBG_DUMP("PHOTO THUMB2 %s \n %s\n", tmp, tmp2); sf_file_thumb_cfg_fill(tmp, tmp2, queue_ele_in->jpg_thumb_size, enFileType); if((!sf_get_mode_flag()) || ((FALSE == sf_check_net_work_flag()) && (0 < sf_cardv_get_cq_signal()) && (SF_CAM_MODE_PHOTO == sf_get_cammode_statu()))) diff --git a/code/application/source/sf_app/code/source/4gMng/sf_ftp.c b/code/application/source/sf_app/code/source/4gMng/sf_ftp.c index caa751cc5..1133b1c2a 100755 --- a/code/application/source/sf_app/code/source/4gMng/sf_ftp.c +++ b/code/application/source/sf_app/code/source/4gMng/sf_ftp.c @@ -1806,6 +1806,8 @@ SINT32 sf_hd_ftp_send(void) return SF_FAILURE; } + char font = sf_get_strg_dev() == MMC_DEV_EMMC ? 'B' : 'E'; + sf_set_send_hd(0); sf_custom_str_get(CamNameStr); sf_4G_signal_level_get(sf_get_net_generation(),sf_get_cq_signal(),&csqlevel); @@ -1819,7 +1821,7 @@ SINT32 sf_hd_ftp_send(void) { while((sf_app_while_flag()) && (((piccount) < SendFileTotal)) && ((pPara->GprsMode == 1) || ((pSifarPara->subscribeSendCnt < SUBSCRIBE_SEND_MAX_NUM) && (pPara->GprsMode != 1)))) { - snprintf((char *)ftpFileName, sizeof(ftpFileName), "W%03d%04d.JPG", fileCfg->stfileattr[piccount].dirKey, fileCfg->stfileattr[piccount].fileKey); + snprintf((char *)ftpFileName, sizeof(ftpFileName), "W%c%03d%04d.JPG", font, fileCfg->stfileattr[piccount].dirKey, fileCfg->stfileattr[piccount].fileKey); snprintf((char *)filePath, sizeof(filePath), "%s%s/%s", strg_path, SF_HD_DIR, ftpFileName); free(strg_path); sf_set_del_flag(FALSE); @@ -1841,7 +1843,7 @@ SINT32 sf_hd_ftp_send(void) //memset(filePath, '\0', sizeof(filePath)); snprintf(cameraID, sizeof(cameraID), "%s-%d-%d-%s-", pPara->ModuleImei, battery, csqlevel, CamNameStr); - snprintf((char *)ftpFileName, sizeof(ftpFileName), "%sHD-W%03d%04d.JPG", cameraID, fileCfg->stfileattr[piccount].dirKey, fileCfg->stfileattr[piccount].fileKey); + snprintf((char *)ftpFileName, sizeof(ftpFileName), "%sHD-W%c%03d%04d.JPG", cameraID, font, fileCfg->stfileattr[piccount].dirKey, fileCfg->stfileattr[piccount].fileKey); //snprintf((char *)filePath, sizeof(filePath), "UFS:/W%03d%04d.JPG", fileCfg->stfileattr[piccount].dirKey, fileCfg->stfileattr[piccount].fileKey); @@ -1966,6 +1968,7 @@ UINT32 sf_video_find_file(UINT16 dirKey, UINT16 fileKey, UINT8 *destFname) //UINT8 srcFname[50] = {0}; char *strg_path = sf_get_root_path(); + char *font_str = sf_get_strg_dev() == MMC_DEV_EMMC ? "BX" : "EX"; if(strg_path == NULL) { free(strg_path); @@ -1978,7 +1981,7 @@ UINT32 sf_video_find_file(UINT16 dirKey, UINT16 fileKey, UINT8 *destFname) { dirKey = fileIndex / 10000; fileKey = fileIndex % 10000; - SF_SPRINTF(fname, "%s%s/%03dMEDIA/%s%04d.MP4", strg_path, SF_DCIM_DIR, dirKey, DCF_FILE_NAME, fileKey); + SF_SPRINTF(fname, "%s%s/%03dMEDIA/%s%s%04d.MP4", strg_path, SF_DCIM_DIR, dirKey, DCF_FILE_NAME, font_str, fileKey); //fileSize = sf_get_file_size(fname); sf_file_size_get(fname,&fileSize); @@ -2036,6 +2039,8 @@ SINT32 sf_video_ftp_send(void) double elapsed_time = 0; SINT64 sendEndTime = 0; UINT32 size = 0; + + char font = sf_get_strg_dev() == MMC_DEV_EMMC ? 'B' : 'E'; sf_set_send_video(0); sf_custom_str_get(CamNameStr); @@ -2050,7 +2055,7 @@ SINT32 sf_video_ftp_send(void) { while((sf_app_while_flag()) && (((piccount) < SendFileTotal)) && ((pPara->GprsMode == 1) || ((pSifarPara->subscribeVideoSendCnt < SUBSCRIBE_VIDEO_SEND_MAX_NUM) && (pPara->GprsMode != 1)))) { - snprintf((char *)ftpFileName, sizeof(ftpFileName), "W%03d%04d.MP4", fileCfg->stfileattr[piccount].dirKey, fileCfg->stfileattr[piccount].fileKey); + snprintf((char *)ftpFileName, sizeof(ftpFileName), "W%c%03d%04d.MP4", font, fileCfg->stfileattr[piccount].dirKey, fileCfg->stfileattr[piccount].fileKey); //snprintf((char *)filePath, sizeof(filePath), "%s/%s", SF_HD_DIR, ftpFileName); printf("[%s:%d] piccount:%d dirKey:%d fileKey:%d\n", __FUNCTION__, __LINE__, piccount, fileCfg->stfileattr[piccount].dirKey, fileCfg->stfileattr[piccount].fileKey); @@ -2080,7 +2085,7 @@ SINT32 sf_video_ftp_send(void) //memset(filePath, '\0', sizeof(filePath)); snprintf(cameraID, sizeof(cameraID), "%s-%d-%d-%s-", pPara->ModuleImei, battery, csqlevel, CamNameStr); - snprintf((char *)ftpFileName, sizeof(ftpFileName), "%sW%03d%04d.MP4", cameraID, fileCfg->stfileattr[piccount].dirKey, fileCfg->stfileattr[piccount].fileKey); + snprintf((char *)ftpFileName, sizeof(ftpFileName), "%sW%c%03d%04d.MP4", cameraID, font, fileCfg->stfileattr[piccount].dirKey, fileCfg->stfileattr[piccount].fileKey); //snprintf((char *)filePath, sizeof(filePath), "UFS:/W%03d%04d.MP4", fileCfg->stfileattr[piccount].dirKey, fileCfg->stfileattr[piccount].fileKey); diff --git a/code/application/source/sf_app/code/source/4gMng/sf_sms.c b/code/application/source/sf_app/code/source/4gMng/sf_sms.c index c364e7940..bc2a4da64 100755 --- a/code/application/source/sf_app/code/source/4gMng/sf_sms.c +++ b/code/application/source/sf_app/code/source/4gMng/sf_sms.c @@ -1976,7 +1976,9 @@ void sf_hd_pic_add_to_list(UINT8 *fileName) SubImgList_t *pList = pSubImgListHead; SubImgList_t *qList = pSubImgListHead; char fname[50] = {0}; + char *font = sf_get_strg_dev() == MMC_DEV_EMMC ? "BX" : "EX"; printf("[%s:%d] add to list:%s\n", __FUNCTION__, __LINE__, fileName); + SF_STRNCPY(tempStr, fileName+1, 3); dirKey = atoi((const char *)tempStr); fileKey = atoi((const char *)fileName+4); @@ -1986,7 +1988,7 @@ void sf_hd_pic_add_to_list(UINT8 *fileName) free(strg_path); return; } - SF_SPRINTF(fname, "%s%s/%03dMEDIA/%s%04d.JPG", strg_path, SF_DCIM_DIR, dirKey, DCF_FILE_NAME, fileKey); + SF_SPRINTF(fname, "%s%s/%03dMEDIA/%s%s%04d.JPG", strg_path, SF_DCIM_DIR, dirKey, DCF_FILE_NAME, font, fileKey); free(strg_path); if(sf_file_IsExsit(fname) != SF_TRUE) { @@ -2117,6 +2119,7 @@ void sf_video_add_to_list(UINT8 *fileName) UINT8 i = 0; UINT16 dirKeytmp = 0; UINT16 fileKeytmp = 0; + char *font_str = sf_get_strg_dev() == MMC_DEV_EMMC ? "BX" : "EX"; printf("add to list:%s\n", fileName); char *strg_path = sf_get_root_path(); @@ -2136,7 +2139,7 @@ void sf_video_add_to_list(UINT8 *fileName) { dirKeytmp = fileIndex / 10000; fileKeytmp = fileIndex % 10000; - SF_SPRINTF(fname, "%s%s/%03dMEDIA/%s%04d.MP4", strg_path, SF_DCIM_DIR, dirKeytmp, DCF_FILE_NAME, fileKeytmp); + SF_SPRINTF(fname, "%s%s/%03dMEDIA/%s%s%04d.MP4", strg_path, SF_DCIM_DIR, dirKeytmp, DCF_FILE_NAME, font_str, fileKeytmp); free(strg_path); sf_file_size_get(fname,&fileSize); printf("find video:%s size=%d\n", fname, fileSize); diff --git a/code/application/source/sf_app/code/source/storeMng/sf_storeMng.c b/code/application/source/sf_app/code/source/storeMng/sf_storeMng.c index fd46d4763..188febbcb 100644 --- a/code/application/source/sf_app/code/source/storeMng/sf_storeMng.c +++ b/code/application/source/sf_app/code/source/storeMng/sf_storeMng.c @@ -290,7 +290,7 @@ SINT32 sf_sd_loopremove(const char *path) SLOGE("open [%s] error!!!\n",path); return -1; } - + while(index < dircnt) { MLOGD("d_name: %s\n",namelist[index]->d_name); @@ -878,12 +878,14 @@ int sf_app_sd_loop(void) free(strg_path); return SF_FAILURE; } - + char font = sf_get_strg_dev() == MMC_DEV_EMMC ? 'B' : 'E'; + char *font_str = sf_get_strg_dev() == MMC_DEV_EMMC ? "BX" : "EX"; + while((nloop) && (dircount < 5)) { sprintf(cPathTmp,"%s%s/%03d%s", strg_path, SF_DCF_ROOT_DIR_NAME, nDirKey, DCF_DIR_NAME); // ""/mnt/sd/DCIM/100MEDIA" //Not Empty,Record File Name - sprintf(cFileTmp, "%s/%s%04d.%s",cPathTmp, DCF_FILE_NAME, nFileKey, SF_DCF_EXT_PHOTO); + sprintf(cFileTmp, "%s/%s%s%04d.%s",cPathTmp, DCF_FILE_NAME, font_str, nFileKey, SF_DCF_EXT_PHOTO); if(access(cFileTmp,R_OK) == 0) { @@ -893,7 +895,7 @@ int sf_app_sd_loop(void) } else { - sprintf(cFileTmp, "%s/%s%04d.%s", cPathTmp, DCF_FILE_NAME, nFileKey, SF_DCF_EXT_MOV); + sprintf(cFileTmp, "%s/%s%s%04d.%s", cPathTmp, DCF_FILE_NAME, font_str, nFileKey, SF_DCF_EXT_MOV); if(access(cFileTmp,R_OK) == 0) { MLOGD("Will Delete File Name:%s\n", cFileTmp); @@ -919,7 +921,7 @@ int sf_app_sd_loop(void) } } - sprintf(cFileTmp,"%s%s/W%03d%04d.JPG", strg_path, SF_DCF_THM_DIR_NAME, nDirKey, nFileKey); + sprintf(cFileTmp,"%s%s/W%c%03d%04d.JPG", strg_path, SF_DCF_THM_DIR_NAME, font, nDirKey, nFileKey); //MLOGD("Thumb Filename:%s\n", cFileTmp); if(access(cFileTmp,R_OK) == 0) { @@ -927,7 +929,7 @@ int sf_app_sd_loop(void) remove(cFileTmp); } - sprintf(cFileTmp,"%s%s/S%03d%04d.JPG", strg_path, SF_DCF_THM_DIR_NAME, nDirKey, nFileKey); + sprintf(cFileTmp,"%s%s/S%c%03d%04d.JPG", strg_path, SF_DCF_THM_DIR_NAME, font, nDirKey, nFileKey); //MLOGD("Thumb Filename:%s\n", cFileTmp); if(access(cFileTmp,R_OK) == 0) { diff --git a/code/application/source/sf_app/code/source/wifi/sf_wifi_svr.c b/code/application/source/sf_app/code/source/wifi/sf_wifi_svr.c index 6929ac9b4..a214f865e 100755 --- a/code/application/source/sf_app/code/source/wifi/sf_wifi_svr.c +++ b/code/application/source/sf_app/code/source/wifi/sf_wifi_svr.c @@ -431,6 +431,8 @@ S8 *appThumbKeyToName(thumbSize_t imgSize, thumbType_t fileType, UINT16 dirKey, return SF_FAILURE; } + char font =sf_get_strg_dev() == MMC_DEV_EMMC ? 'B' : 'E'; + if(imgSize == THUMB_320x240) { sprintf((char *)tempPath, "%s%s/small", strg_path, THUMB_PATH); @@ -472,7 +474,7 @@ S8 *appThumbKeyToName(thumbSize_t imgSize, thumbType_t fileType, UINT16 dirKey, #endif /****check floder and creat it if that is not exist***end****/ - sprintf((char *)fileName, "%s/%03d%1d%04d.JPG", path, dirKey, fileType, fileKey); + sprintf((char *)fileName, "%s/%03d%1d%c%04d.JPG", path, dirKey, fileType, font, fileKey); MLOGI("ThumbName:%s", fileName); return fileName; } @@ -1141,7 +1143,8 @@ SINT32 sf_svr_packet_proc(SINT32 fd, UINT8 *pAppData, UINT16 dataLen) return SF_FAILURE; } - + char *font_str = sf_get_strg_dev() == MMC_DEV_EMMC ? "BX" : "EX"; + //printf("[sf_svr_packet_proc]dataLen: %d\n",dataLen); if(poweroff_mode == POWEROFF_COUNTDOWN) @@ -1355,11 +1358,12 @@ SINT32 sf_svr_packet_proc(SINT32 fd, UINT8 *pAppData, UINT16 dataLen) strcpy((char *)tempbuf, (char *)pMsgStruct->msgBuf.getHdFile.dirName); strncpy((char *)tempbuf2, (char *)tempbuf, 3); tempbuf[8] = '\0'; - sprintf((char *)gFileName, "%sDCIM/%s%s/%s%s%s", + sprintf((char *)gFileName, "%sDCIM/%s%s/%s%s%s%s", strg_path, tempbuf2, DCF_DIR_NAME, DCF_FILE_NAME, + font_str, tempbuf+4, (tempbuf[3] == '0' ? ".JPG" : (tempbuf[3] == '1' ? ".MP4" : ".MP4"))); } @@ -1896,11 +1900,12 @@ SINT32 sf_svr_packet_proc(SINT32 fd, UINT8 *pAppData, UINT16 dataLen) strncpy((char *)tempbuf2, (char *)pMsgStruct->msgBuf.ctrlFileTransfer.fileName +1, 3); tempbuf[8] = '\0'; - sprintf((char *)fileName, "%sDCIM/%s%s/%s%s%s", + sprintf((char *)fileName, "%sDCIM/%s%s/%s%s%s%s", strg_path, tempbuf2, DCF_DIR_NAME, DCF_FILE_NAME, + font_str, tempbuf+4, (tempbuf[0] == 'W' ? ".JPG" : (tempbuf[0] == 'S' ? ".MP4" : ".MP4"))); } @@ -2003,9 +2008,9 @@ SINT32 sf_svr_packet_proc(SINT32 fd, UINT8 *pAppData, UINT16 dataLen) ret = remove((char *)fileName); MLOGI("delete thumb name=%s ret=%d\n",fileName,ret); if(fileType == STILL_THUMB) - sprintf((char *)fileName,"./%3dMEDIA/%s%04d.JPG", dirKey, DCF_FILE_NAME, fileKey); + sprintf((char *)fileName,"./%3dMEDIA/%s%s%04d.JPG", dirKey, DCF_FILE_NAME, font_str, fileKey); else - sprintf((char *)fileName,"./%3dMEDIA/%s%04d.MP4", dirKey, DCF_FILE_NAME, fileKey); + sprintf((char *)fileName,"./%3dMEDIA/%s%s%04d.MP4", dirKey, DCF_FILE_NAME, font_str, fileKey); ret = remove((char *)fileName); } diff --git a/code/lib/source/sifar/code/source/common/sf_common.c b/code/lib/source/sifar/code/source/common/sf_common.c index 64812fc8e..d61c88752 100755 --- a/code/lib/source/sifar/code/source/common/sf_common.c +++ b/code/lib/source/sifar/code/source/common/sf_common.c @@ -65,6 +65,8 @@ #include "sf_4g_lpa.h" #include #include +#include + BOOL isGoing2PowerOff = FALSE; UINT16 AutoOfftime = 0; @@ -2913,6 +2915,9 @@ void* sf_cardv_hd_cap_thread(void *arg) { UINT8 PowerOnMode = sf_cardv_convert_power_on_mode(); MLOGD(" HD start PowerOnMode:%d\n", PowerOnMode); + + char font = sf_get_strg_dev() == MMC_DEV_EMMC ? 'B' : 'E'; + char *font_str = sf_get_strg_dev() == MMC_DEV_EMMC ? "BX" : "EX"; if((PWR_ON_SMS == PowerOnMode) || (PWR_ON_TIME_SYNC == PowerOnMode)) { //if(TRUE != sf_is_preview()) @@ -2939,8 +2944,8 @@ void* sf_cardv_hd_cap_thread(void *arg) //HdflieName memset(HdflieName, '\0', sizeof(HdflieName)); sf_hd_flag_clear_done(0); - snprintf(HdflieName, sizeof(HdflieName), "W%03d%04d.JPG", fileCfg->stfileattr[fileIndex].dirKey, fileCfg->stfileattr[fileIndex].fileKey); - snprintf(str, 64, "A:\\DCIM\\%03d%s\\%s%04d.JPG", fileCfg->stfileattr[fileIndex].dirKey, DCF_DIR_NAME, DCF_FILE_NAME, fileCfg->stfileattr[fileIndex].fileKey); + snprintf(HdflieName, sizeof(HdflieName), "W%c%03d%04d.JPG", font, fileCfg->stfileattr[fileIndex].dirKey, fileCfg->stfileattr[fileIndex].fileKey); + snprintf(str, 64, "A:\\DCIM\\%03d%s\\%s%s%04d.JPG", fileCfg->stfileattr[fileIndex].dirKey, DCF_DIR_NAME, DCF_FILE_NAME, font_str, fileCfg->stfileattr[fileIndex].fileKey); printf("%s\n", str); arg[0] = str; sf_cmd_transcode_start(arg); diff --git a/rtos/code/application/source/cardv/SrcCode/UIApp/MovieFast/MovieFast.c b/rtos/code/application/source/cardv/SrcCode/UIApp/MovieFast/MovieFast.c index 6becb00d9..08fcb492c 100644 --- a/rtos/code/application/source/cardv/SrcCode/UIApp/MovieFast/MovieFast.c +++ b/rtos/code/application/source/cardv/SrcCode/UIApp/MovieFast/MovieFast.c @@ -939,12 +939,28 @@ static void MovieFast_FileNamingCB(MOVIE_CFG_REC_ID id, char *pFileName) //3. If the working mode is normal and it is cyclic recording, please judge the DirID and FileID by yourself before enering next new file recording. UINT32 nextFolderID = 0, nextFileID = 0; UINT32 max_cnt = 0; + +#if USE_RTOS_MMC_CHECK + SF_RTOS_ST_MMC_DEV *mmc_dev = SF_RtosStrgCheckWorkableDev(); + if(mmc_dev ==NULL) + { + DBG_ERR("No MMC_Dev Can use!\n"); + return; + } + if(mmc_dev->dcf_handle < 0) + { + DBG_ERR("dcf_handle err\n"); + return; + } +#endif + if (DCF_GetDBInfo(DCF_INFO_IS_9999)) { DBG_ERR("Exceed max dcf file!\r\n"); pFileName[0] = '\0'; } else { DBG_DUMP("%s\n", __FUNCTION__); DCF_HANDLE handle = MovieFast_Get_DCF_Handle(); + char font = mmc_dev->dev_type == MMC_DEV_EMMC ? 'B' : 'E'; DCF_GetNextIDEx(handle, &nextFolderID,&nextFileID); if(DrvGPIO_GetPhotoMovieModeFromMonitor() == DX_HUNTING_MODE_MOVIE2) { @@ -987,7 +1003,7 @@ static void MovieFast_FileNamingCB(MOVIE_CFG_REC_ID id, char *pFileName) DBG_DUMP("%s added to DCF\r\n", pFileName); #if HUNTING_CAMERA_MCU == ENABLE char tmp[NMC_TOTALFILEPATH_MAX_LEN] = {'\0'}; - sprintf(tmp, "S%03ld%04ld.JPG", nextFolderID, nextFileID); + sprintf(tmp, "S%c%03ld%04ld.JPG", font, nextFolderID, nextFileID); if(id == _CFG_REC_ID_1){ snprintf(thumb_current_path_main, sizeof(thumb_current_path_main), "%s", tmp); } @@ -1277,6 +1293,26 @@ int MovieFast_GetWaterLogoSource(const UINT32 recWidth,WATERLOGO_BUFFER *waterSr static void MovieFast_FileNaming_Init(void) { static UINT8 is_init = 0; + +#if USE_RTOS_MMC_CHECK + SF_RTOS_ST_MMC_DEV *mmc_dev = SF_RtosStrgCheckWorkableDev(); + if(mmc_dev ==NULL) + { + DBG_ERR("No MMC_Dev Can use!\n"); + return; + } + if(mmc_dev->dcf_handle < 0) + { + DBG_ERR("dcf_handle err\n"); + return; + } + +#endif + + char *font_str = mmc_dev->dev_type == MMC_DEV_EMMC ? "BX" : "EX"; + char file_name[64] = {'\0'}; + + snprintf(file_name, sizeof(file_name), "%s%s", DCF_FILE_NAME, font_str); /* DCF 8.3 naming rule */ if(is_init == 1) return; @@ -1289,7 +1325,7 @@ static void MovieFast_FileNaming_Init(void) DCF_SetParm(DCF_PRMID_SET_VALID_FILE_FMT, DCF_FILE_TYPE_JPG|DCF_FILE_TYPE_MP4|DCF_FILE_TYPE_MOV); DCF_SetParm(DCF_PRMID_SET_DEP_FILE_FMT, DCF_FILE_TYPE_JPG|DCF_FILE_TYPE_WAV|DCF_FILE_TYPE_MPO); DCF_SetDirFreeChars(DCF_DIR_NAME); - DCF_SetFileFreeChars(DCF_FILE_TYPE_ANYFORMAT, DCF_FILE_NAME); + DCF_SetFileFreeChars(DCF_FILE_TYPE_ANYFORMAT, file_name); } THREAD_RETTYPE MovieFast_InitFileNamingThread(void *arg) diff --git a/rtos/code/application/source/cardv/SrcCode/UIApp/PhotoFast/PhotoFast.c b/rtos/code/application/source/cardv/SrcCode/UIApp/PhotoFast/PhotoFast.c index d50543ea2..62557004d 100644 --- a/rtos/code/application/source/cardv/SrcCode/UIApp/PhotoFast/PhotoFast.c +++ b/rtos/code/application/source/cardv/SrcCode/UIApp/PhotoFast/PhotoFast.c @@ -715,6 +715,24 @@ HD_RESULT PhotoFast_get_hd_common_buf(PPHOTOFAST_HD_COM_BUF p_hd_comm_buf) static void PhotoFast_FileNaming_Init(void) { static UINT8 is_init = 0; +#if USE_RTOS_MMC_CHECK + SF_RTOS_ST_MMC_DEV *mmc_dev = SF_RtosStrgCheckWorkableDev(); + if(mmc_dev ==NULL) + { + DBG_ERR("No MMC_Dev Can use!\n"); + return; + } + if(mmc_dev->dcf_handle < 0) + { + DBG_ERR("dcf_handle err\n"); + return; + } + +#endif + char *font_str = mmc_dev->dev_type == MMC_DEV_EMMC ? "BX" : "EX"; + char file_name[64] = {'\0'}; + + snprintf(file_name, sizeof(file_name), "%s%s", DCF_FILE_NAME, font_str); /* DCF 8.3 naming rule */ if(is_init == 1) return; @@ -727,7 +745,7 @@ static void PhotoFast_FileNaming_Init(void) DCF_SetParm(DCF_PRMID_SET_VALID_FILE_FMT, DCF_FILE_TYPE_JPG|DCF_FILE_TYPE_MP4|DCF_FILE_TYPE_MOV); DCF_SetParm(DCF_PRMID_SET_DEP_FILE_FMT, DCF_FILE_TYPE_JPG|DCF_FILE_TYPE_WAV|DCF_FILE_TYPE_MPO); DCF_SetDirFreeChars(DCF_DIR_NAME); - DCF_SetFileFreeChars(DCF_FILE_TYPE_ANYFORMAT, DCF_FILE_NAME); + DCF_SetFileFreeChars(DCF_FILE_TYPE_ANYFORMAT, file_name); } INT32 PhotoFast_FileNaming_Open(void) diff --git a/rtos/code/application/source/cardv/SrcCode/UIApp/PhotoFast/PhotoFastSliceEncode.c b/rtos/code/application/source/cardv/SrcCode/UIApp/PhotoFast/PhotoFastSliceEncode.c index 7815d000b..24bb1f57c 100644 --- a/rtos/code/application/source/cardv/SrcCode/UIApp/PhotoFast/PhotoFastSliceEncode.c +++ b/rtos/code/application/source/cardv/SrcCode/UIApp/PhotoFast/PhotoFastSliceEncode.c @@ -2369,15 +2369,18 @@ INT32 PhotoFast_SliceEncode_CB3(void* user_data) { char tmp[NMC_TOTALFILEPATH_MAX_LEN] = {'\0'}; + SF_RTOS_ST_MMC_DEV *mmc_dev = SF_RtosStrgCheckWorkableDev(); #if !PHOTOFAST_FAST_CLOSE extern CHAR* PhotoFast_GetLastWriteFilePath(void); char* file_path = PhotoFast_GetLastWriteFilePath(); #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); + char font = mmc_dev->dev_type == MMC_DEV_EMMC ? 'B' : 'E'; + sprintf(tmp, "W%c%03ld%04ld.JPG", font, 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 @@ -2391,7 +2394,7 @@ INT32 PhotoFast_SliceEncode_CB3(void* user_data) #if HUNTING_CAMERA_MCU == ENABLE #if USE_RTOS_MMC_CHECK - SF_RTOS_ST_MMC_DEV *mmc_dev = SF_RtosStrgCheckWorkableDev(); + if(mmc_dev != NULL) { if(mmc_dev->dcf_handle < 0) From 642167b25e4aae1381db6f9c63c84aa029fab790 Mon Sep 17 00:00:00 2001 From: "sober.song" Date: Sat, 6 Jan 2024 17:06:21 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=90=8D=E4=B8=8D=E7=94=9F=E6=95=88=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cardv/SrcCode/PrjCfg_HUNTING_S550.h | 2 +- .../cardv/SrcCode/System/SF_SysStrgMng.c | 2 +- .../source/cardv/SrcCode/System/SysStrg_Exe.c | 4 +- .../SrcCode/UIApp/Movie/UIAppMovie_Exe.c | 12 ++++-- .../SrcCode/UIApp/Photo/UIAppPhoto_Exe.c | 4 +- .../source/sf_app/code/source/4gMng/sf_ftp.c | 4 +- .../source/sf_app/code/source/4gMng/sf_sms.c | 8 ++-- .../sf_app/code/source/app/sf_service.c | 3 +- .../sf_app/code/source/fileMng/sf_fileMng.c | 9 +++-- .../sf_app/code/source/storeMng/sf_storeMng.c | 8 ++-- .../sf_app/code/source/wifi/sf_wifi_svr.c | 18 ++++----- .../source/cardv/SrcCode/System/SysStrg_Exe.c | 2 +- .../cardv/SrcCode/UIApp/MovieFast/MovieFast.c | 15 ++++--- .../cardv/SrcCode/UIApp/PhotoFast/PhotoFast.c | 39 +++++++++---------- 14 files changed, 69 insertions(+), 61 deletions(-) diff --git a/code/application/source/cardv/SrcCode/PrjCfg_HUNTING_S550.h b/code/application/source/cardv/SrcCode/PrjCfg_HUNTING_S550.h index 44ceda96b..f8f257ab6 100755 --- a/code/application/source/cardv/SrcCode/PrjCfg_HUNTING_S550.h +++ b/code/application/source/cardv/SrcCode/PrjCfg_HUNTING_S550.h @@ -927,7 +927,7 @@ #define SF_BASE_VERSION "7MR5RCw4102" #define HW_S530 DISABLE #define DCF_DIR_NAME "MEDIA" /* 100MEDIA */ -#define DCF_FILE_NAME "SY" /* SYFW0001.JPG */ +#define DCF_FILE_NAME "SYGW" /* SYFW0001.JPG */ #define PHOTO_THUMB_PATH ":\\THUMB\\" #define MOVIE_THUMB_PATH ":\\THUMB\\" diff --git a/code/application/source/cardv/SrcCode/System/SF_SysStrgMng.c b/code/application/source/cardv/SrcCode/System/SF_SysStrgMng.c index 2be1cab1f..7a363e3de 100755 --- a/code/application/source/cardv/SrcCode/System/SF_SysStrgMng.c +++ b/code/application/source/cardv/SrcCode/System/SF_SysStrgMng.c @@ -38,7 +38,7 @@ SF_THREAD_S MMCMonitorTskCfg = .TskId = -1, }; -#define MIN_DISK_FREE_SIZE_MB 30 +#define MIN_DISK_FREE_SIZE_MB 300 SF_ST_MMC_DEV *sf_mmc_dev[MMC_DEV_MAX_NUM] = {NULL}; diff --git a/code/application/source/cardv/SrcCode/System/SysStrg_Exe.c b/code/application/source/cardv/SrcCode/System/SysStrg_Exe.c index 1291047c4..05c0620e9 100644 --- a/code/application/source/cardv/SrcCode/System/SysStrg_Exe.c +++ b/code/application/source/cardv/SrcCode/System/SysStrg_Exe.c @@ -478,7 +478,7 @@ void System_OnStrgInit_FS(void) DCF_SetParm(DCF_PRMID_SET_VALID_FILE_FMT, DCF_FILE_TYPE_JPG|DCF_FILE_TYPE_MP4|DCF_FILE_TYPE_MOV); DCF_SetParm(DCF_PRMID_SET_DEP_FILE_FMT, DCF_FILE_TYPE_JPG|DCF_FILE_TYPE_WAV|DCF_FILE_TYPE_MPO); DCF_SetDirFreeChars(DCF_DIR_NAME); - DCF_SetFileFreeChars(DCF_FILE_TYPE_ANYFORMAT, DCF_FILE_NAME); + //DCF_SetFileFreeChars(DCF_FILE_TYPE_ANYFORMAT, DCF_FILE_NAME); #endif } @@ -983,9 +983,11 @@ INT32 System_OnStrgInsert(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray) if(strg_id == STRG_ID_SD){ DBG_WRN("sd act\n"); System_Set_Storage_Act_Drive(g_strg_mapping_table[strg_id].drive); + DCF_SetFileFreeChars(DCF_FILE_TYPE_ANYFORMAT, "SYEX"); } else if(strg_id == STRG_ID_EMMC){ DBG_WRN("emmc act\n"); + DCF_SetFileFreeChars(DCF_FILE_TYPE_ANYFORMAT, "SYBX"); System_Set_Storage_Act_Drive(g_strg_mapping_table[strg_id].drive); } #if USE_MMC_DEV_CHECK diff --git a/code/application/source/cardv/SrcCode/UIApp/Movie/UIAppMovie_Exe.c b/code/application/source/cardv/SrcCode/UIApp/Movie/UIAppMovie_Exe.c index d4523784b..8a61e7e67 100755 --- a/code/application/source/cardv/SrcCode/UIApp/Movie/UIAppMovie_Exe.c +++ b/code/application/source/cardv/SrcCode/UIApp/Movie/UIAppMovie_Exe.c @@ -1226,7 +1226,7 @@ static void MovieExe_FileNamingCB(MOVIE_CFG_REC_ID id, char *pFileName) { UINT32 dcf_handle = (UINT32)System_Get_DCF_Handle(); /* 0:emmc 1:sd */ char font = System_Get_DCF_Disk_Drive(dcf_handle) == 'B' ? 'B' : 'E'; - + char *dcf_file = System_Get_DCF_Disk_Drive(dcf_handle) == 'B' ? "SYBX" : "SYEX"; #if USE_FILEDB static struct tm CurDateTime = {0}; g_FileSerialNum++; @@ -1264,10 +1264,12 @@ static void MovieExe_FileNamingCB(MOVIE_CFG_REC_ID id, char *pFileName) DBG_ERR("Exceed max dcf file!\r\n"); pFileName[0] = '\0'; } else { + + DCF_SetFileFreeChars(DCF_FILE_TYPE_ANYFORMAT, dcf_file); DCF_GetNextIDEx(dcf_handle, &nextFolderID,&nextFileID); DCF_MakeObjPathEx(dcf_handle, nextFolderID, nextFileID, DCF_FILE_TYPE_MP4, pFileName); DCF_AddDBfileEx(dcf_handle, pFileName); - DBG_DUMP("%s added to DCF Path%lu\r\n", pFileName, dcf_handle); + DBG_DUMP("MovieExe %s added to DCF Path%lu\r\n", pFileName, dcf_handle); #if HUNTING_CAMERA_MCU == ENABLE char tmp[NMC_TOTALFILEPATH_MAX_LEN] = {'\0'}; sprintf(tmp, "S%c%03d%04d.JPG", font, nextFolderID, nextFileID); @@ -1297,6 +1299,8 @@ static void MovieExe_FileNamingCB(MOVIE_CFG_REC_ID id, char *pFileName) static void MovieExe_RawEncodeFileNamingCB(MOVIE_CFG_REC_ID id, char *pFileName) { + UINT32 dcf_handle = (UINT32)System_Get_DCF_Handle(); /* 0:emmc 1:sd */ + char *dcf_file = System_Get_DCF_Disk_Drive(dcf_handle) == 'B' ? "SYBX" : "SYEX"; #if USE_FILEDB static struct tm CurDateTime = {0}; @@ -1328,12 +1332,14 @@ static void MovieExe_RawEncodeFileNamingCB(MOVIE_CFG_REC_ID id, char *pFileName) #elif USE_DCF UINT32 nextFolderID = 0, nextFileID = 0; - UINT32 dcf_handle = (UINT32) System_Get_DCF_Handle(); + //UINT32 dcf_handle = (UINT32) System_Get_DCF_Handle(); if (DCF_GetDBInfoEx(dcf_handle, DCF_INFO_IS_9999)) { DBG_ERR("Exceed max dcf file!\r\n"); pFileName[0] = '\0'; } else { + DBG_DUMP("JPG %s added to DCF Path%lu\r\n", pFileName, dcf_handle); + DCF_SetFileFreeChars(DCF_FILE_TYPE_ANYFORMAT, dcf_file); DCF_GetNextIDEx(dcf_handle, &nextFolderID,&nextFileID); DCF_MakeObjPathEx(dcf_handle, nextFolderID, nextFileID, DCF_FILE_TYPE_JPG, pFileName); } diff --git a/code/application/source/cardv/SrcCode/UIApp/Photo/UIAppPhoto_Exe.c b/code/application/source/cardv/SrcCode/UIApp/Photo/UIAppPhoto_Exe.c index 3db23be68..4d9a10e82 100755 --- a/code/application/source/cardv/SrcCode/UIApp/Photo/UIAppPhoto_Exe.c +++ b/code/application/source/cardv/SrcCode/UIApp/Photo/UIAppPhoto_Exe.c @@ -6894,14 +6894,14 @@ INT32 PhotoExe_Preview_SliceEncode_CB3(void* user_data) strncpy(number, file_path + length - 8, 4); number[4] = '\0'; - snprintf(tmp, sizeof(tmp), "%c%sW%c%s%s.JPG", System_Get_DCF_Disk_Drive(dcf_handle), PHOTO_THUMB_PATH, font, SF_SEND_LIST_DIR, folder, number); /* DCF 8.3 naming rule */ + snprintf(tmp, sizeof(tmp), "%c%sW%c%s%s.JPG", System_Get_DCF_Disk_Drive(dcf_handle), PHOTO_THUMB_PATH, font, folder, number); /* DCF 8.3 naming rule */ #else snprintf(tmp, sizeof(tmp), "%c%s%s", System_Get_DCF_Disk_Drive(dcf_handle), PHOTO_THUMB_PATH, file_path + length - 12); /* DCF 8.3 naming rule */ snprintf(tmp + strlen(tmp) - 3, sizeof(tmp), "%s", "JPG"); #endif - DBG_IND("PHOTO THUMB %s\n", tmp); + DBG_DUMP("PHOTO THUMB %s\n", tmp); FST_FILE fp = FileSys_OpenFile(tmp, FST_OPEN_ALWAYS | FST_OPEN_WRITE); diff --git a/code/application/source/sf_app/code/source/4gMng/sf_ftp.c b/code/application/source/sf_app/code/source/4gMng/sf_ftp.c index 1133b1c2a..57a1c3340 100755 --- a/code/application/source/sf_app/code/source/4gMng/sf_ftp.c +++ b/code/application/source/sf_app/code/source/4gMng/sf_ftp.c @@ -1968,7 +1968,7 @@ UINT32 sf_video_find_file(UINT16 dirKey, UINT16 fileKey, UINT8 *destFname) //UINT8 srcFname[50] = {0}; char *strg_path = sf_get_root_path(); - char *font_str = sf_get_strg_dev() == MMC_DEV_EMMC ? "BX" : "EX"; + char *dcf_file = sf_get_strg_dev() == MMC_DEV_EMMC ? "SYBX" : "SYEX"; if(strg_path == NULL) { free(strg_path); @@ -1981,7 +1981,7 @@ UINT32 sf_video_find_file(UINT16 dirKey, UINT16 fileKey, UINT8 *destFname) { dirKey = fileIndex / 10000; fileKey = fileIndex % 10000; - SF_SPRINTF(fname, "%s%s/%03dMEDIA/%s%s%04d.MP4", strg_path, SF_DCIM_DIR, dirKey, DCF_FILE_NAME, font_str, fileKey); + SF_SPRINTF(fname, "%s%s/%03dMEDIA/%s%04d.MP4", strg_path, SF_DCIM_DIR, dirKey, dcf_file, fileKey); //fileSize = sf_get_file_size(fname); sf_file_size_get(fname,&fileSize); diff --git a/code/application/source/sf_app/code/source/4gMng/sf_sms.c b/code/application/source/sf_app/code/source/4gMng/sf_sms.c index bc2a4da64..c065b0e67 100755 --- a/code/application/source/sf_app/code/source/4gMng/sf_sms.c +++ b/code/application/source/sf_app/code/source/4gMng/sf_sms.c @@ -1976,7 +1976,7 @@ void sf_hd_pic_add_to_list(UINT8 *fileName) SubImgList_t *pList = pSubImgListHead; SubImgList_t *qList = pSubImgListHead; char fname[50] = {0}; - char *font = sf_get_strg_dev() == MMC_DEV_EMMC ? "BX" : "EX"; + char *dcf_file = sf_get_strg_dev() == MMC_DEV_EMMC ? "SYBX" : "SYEX"; printf("[%s:%d] add to list:%s\n", __FUNCTION__, __LINE__, fileName); SF_STRNCPY(tempStr, fileName+1, 3); @@ -1988,7 +1988,7 @@ void sf_hd_pic_add_to_list(UINT8 *fileName) free(strg_path); return; } - SF_SPRINTF(fname, "%s%s/%03dMEDIA/%s%s%04d.JPG", strg_path, SF_DCIM_DIR, dirKey, DCF_FILE_NAME, font, fileKey); + SF_SPRINTF(fname, "%s%s/%03dMEDIA/%s%04d.JPG", strg_path, SF_DCIM_DIR, dirKey, dcf_file, fileKey); free(strg_path); if(sf_file_IsExsit(fname) != SF_TRUE) { @@ -2119,7 +2119,7 @@ void sf_video_add_to_list(UINT8 *fileName) UINT8 i = 0; UINT16 dirKeytmp = 0; UINT16 fileKeytmp = 0; - char *font_str = sf_get_strg_dev() == MMC_DEV_EMMC ? "BX" : "EX"; + char *dcf_file = sf_get_strg_dev() == MMC_DEV_EMMC ? "SYBX" : "SYEX"; printf("add to list:%s\n", fileName); char *strg_path = sf_get_root_path(); @@ -2139,7 +2139,7 @@ void sf_video_add_to_list(UINT8 *fileName) { dirKeytmp = fileIndex / 10000; fileKeytmp = fileIndex % 10000; - SF_SPRINTF(fname, "%s%s/%03dMEDIA/%s%s%04d.MP4", strg_path, SF_DCIM_DIR, dirKeytmp, DCF_FILE_NAME, font_str, fileKeytmp); + SF_SPRINTF(fname, "%s%s/%03dMEDIA/%s%04d.MP4", strg_path, SF_DCIM_DIR, dirKeytmp, dcf_file, fileKeytmp); free(strg_path); sf_file_size_get(fname,&fileSize); printf("find video:%s size=%d\n", fname, fileSize); diff --git a/code/application/source/sf_app/code/source/app/sf_service.c b/code/application/source/sf_app/code/source/app/sf_service.c index 0604af114..78846b3c3 100755 --- a/code/application/source/sf_app/code/source/app/sf_service.c +++ b/code/application/source/sf_app/code/source/app/sf_service.c @@ -885,6 +885,7 @@ SINT16 sf_thumb_file_creat(void) { free(strg_path); return SF_FAILURE; } + char *dcf_file = sf_get_strg_dev() == MMC_DEV_EMMC ? "SYBX" : "SYEX"; SF_SRCFILE_ATTR_S *fileCfg = sf_file_thumb_cfg_get(); for (fileIndex = 0; fileIndex < fileCfg->filecnt; fileIndex++) { @@ -894,7 +895,7 @@ SINT16 sf_thumb_file_creat(void) { strncpy(fileKeyStr, fileCfg->stfileattr[fileIndex].thumbfileName + 4, 8); MLOGD("dirKeyStr:%s, fileKeyStr:%s\n", dirKeyStr, fileKeyStr); sprintf(filePathStr, "%s%s/%s%s/%s%s", strg_path, SF_DCF_ROOT_DIR_NAME, - dirKeyStr, SF_DCF_DIR_NAME_SUFFIX, SF_DCF_FILE_NAME_PREFIX, + dirKeyStr, dcf_file, SF_DCF_FILE_NAME_PREFIX, fileKeyStr); MLOGD("fileKeyStr:%s\n", filePathStr); // check if pic exist diff --git a/code/application/source/sf_app/code/source/fileMng/sf_fileMng.c b/code/application/source/sf_app/code/source/fileMng/sf_fileMng.c index f4071f149..bdb719ad4 100755 --- a/code/application/source/sf_app/code/source/fileMng/sf_fileMng.c +++ b/code/application/source/sf_app/code/source/fileMng/sf_fileMng.c @@ -312,6 +312,8 @@ SINT32 sf_file_subscribe_check(SF_FILE_ATTR_S *pstfileAttr, SF_SUBSCRIBE_ATTR_S memset(pstfileAttr->txtfileName, '\0', sizeof(pstfileAttr->txtfileName)); memset(pstfileAttr->txtfilePath, '\0', sizeof(pstfileAttr->txtfilePath)); + char *dcf_file = sf_get_strg_dev() == MMC_DEV_EMMC ? "SYBX" : "SYEX"; + char *strg_path = sf_get_root_path(); if(strg_path == NULL) { @@ -353,7 +355,7 @@ SINT32 sf_file_subscribe_check(SF_FILE_ATTR_S *pstfileAttr, SF_SUBSCRIBE_ATTR_S strncpy(fileName, pSubscribe->subscribeFileName + (strlen(pSubscribe->subscribeFileName) - 12), 12); fileKey = atoi(fileName+4); MLOGD("FileName:%s, fileKey:%d\n", fileName, fileKey); - sprintf(filePath, "%s%s/%03d%s/%s%s", strg_path, SF_DCF_ROOT_DIR_NAME,dirKey, SF_DCF_DIR_NAME_SUFFIX, SF_DCF_FILE_NAME_PREFIX,fileName+4); + sprintf(filePath, "%s%s/%03d%s/%s%s", strg_path, SF_DCF_ROOT_DIR_NAME,dirKey, dcf_file, SF_DCF_FILE_NAME_PREFIX,fileName+4); MLOGD("srcFile:%s\n", filePath); ret = sf_file_IsExsit((CHAR*)filePath); @@ -554,6 +556,7 @@ SINT32 sf_file_subscribe_check(SF_FILE_ATTR_S *pstfileAttr, SF_SEND_FILE_ATTR_S* free(strg_path); return SF_FAILURE; } + char *dcf_file = sf_get_strg_dev() == MMC_DEV_EMMC ? "SYBX" : "SYEX"; switch(pSendFileAttr->enFileTye) { @@ -568,7 +571,7 @@ SINT32 sf_file_subscribe_check(SF_FILE_ATTR_S *pstfileAttr, SF_SEND_FILE_ATTR_S* strncpy(fileName, pSendFileAttr->SubFileName + (strlen(pSendFileAttr->SubFileName) - 12), 12); fileKey = atoi(fileName+4); SLOGD("FileName:%s, fileKey:%d\n", fileName, fileKey); - sprintf(filePath, "%s%s/%03d%s/%s%04d.%s", strg_path, SF_DCF_ROOT_DIR_NAME,dirKey, SF_DCF_DIR_NAME_SUFFIX, SF_DCF_FILE_NAME_PREFIX,fileKey,SF_DCF_EXT_MOV); + sprintf(filePath, "%s%s/%03d%s/%s%04d.%s", strg_path, SF_DCF_ROOT_DIR_NAME,dirKey, dcf_file, SF_DCF_FILE_NAME_PREFIX,fileKey,SF_DCF_EXT_MOV); SLOGD("srcFile:%s\n", filePath); // strncpy(fileName, pSendFileAttr->SubFileName + (strlen(pSendFileAttr->SubFileName) - 11), 8); @@ -597,7 +600,7 @@ SINT32 sf_file_subscribe_check(SF_FILE_ATTR_S *pstfileAttr, SF_SEND_FILE_ATTR_S* strncpy(fileName, pSendFileAttr->SubFileName + (strlen(pSendFileAttr->SubFileName) - 12), 12); fileKey = atoi(fileName+4); SLOGD("FileName:%s, fileKey:%d\n", fileName, fileKey); - sprintf(filePath, "%s%s/%03d%s/%s%s", strg_path, SF_DCF_ROOT_DIR_NAME,dirKey, SF_DCF_DIR_NAME_SUFFIX, SF_DCF_FILE_NAME_PREFIX,fileName+4); + sprintf(filePath, "%s%s/%03d%s/%s%s", strg_path, SF_DCF_ROOT_DIR_NAME,dirKey, dcf_file, SF_DCF_FILE_NAME_PREFIX,fileName+4); SLOGD("srcFile:%s\n", filePath); ret = sf_file_IsExsit((CHAR*)filePath); diff --git a/code/application/source/sf_app/code/source/storeMng/sf_storeMng.c b/code/application/source/sf_app/code/source/storeMng/sf_storeMng.c index 188febbcb..b106a27e9 100644 --- a/code/application/source/sf_app/code/source/storeMng/sf_storeMng.c +++ b/code/application/source/sf_app/code/source/storeMng/sf_storeMng.c @@ -353,7 +353,7 @@ SINT32 sf_sd_loopremove(const char *path) filedir[2] = *pTemp++; /*get file group ID*/ filedir[3] = '\0'; - pTemp = strstr(g_cFileList[FileCount], DCF_FILE_NAME); + pTemp = strstr(g_cFileList[FileCount], "SYGW"); if(pTemp) { @@ -879,13 +879,13 @@ int sf_app_sd_loop(void) return SF_FAILURE; } char font = sf_get_strg_dev() == MMC_DEV_EMMC ? 'B' : 'E'; - char *font_str = sf_get_strg_dev() == MMC_DEV_EMMC ? "BX" : "EX"; + char *dcf_file = sf_get_strg_dev() == MMC_DEV_EMMC ? "SYBX" : "SYEX"; while((nloop) && (dircount < 5)) { sprintf(cPathTmp,"%s%s/%03d%s", strg_path, SF_DCF_ROOT_DIR_NAME, nDirKey, DCF_DIR_NAME); // ""/mnt/sd/DCIM/100MEDIA" //Not Empty,Record File Name - sprintf(cFileTmp, "%s/%s%s%04d.%s",cPathTmp, DCF_FILE_NAME, font_str, nFileKey, SF_DCF_EXT_PHOTO); + sprintf(cFileTmp, "%s/%s%04d.%s",cPathTmp, dcf_file, nFileKey, SF_DCF_EXT_PHOTO); if(access(cFileTmp,R_OK) == 0) { @@ -895,7 +895,7 @@ int sf_app_sd_loop(void) } else { - sprintf(cFileTmp, "%s/%s%s%04d.%s", cPathTmp, DCF_FILE_NAME, font_str, nFileKey, SF_DCF_EXT_MOV); + sprintf(cFileTmp, "%s/%s%04d.%s", cPathTmp, dcf_file, nFileKey, SF_DCF_EXT_MOV); if(access(cFileTmp,R_OK) == 0) { MLOGD("Will Delete File Name:%s\n", cFileTmp); diff --git a/code/application/source/sf_app/code/source/wifi/sf_wifi_svr.c b/code/application/source/sf_app/code/source/wifi/sf_wifi_svr.c index a214f865e..7948b71d3 100755 --- a/code/application/source/sf_app/code/source/wifi/sf_wifi_svr.c +++ b/code/application/source/sf_app/code/source/wifi/sf_wifi_svr.c @@ -703,7 +703,7 @@ UINT8 appCmpFileList(void) //appThumbNameToKey(&fileType, &dirKey, &fileKey, gDevFileList[i].fileNameString);ERROR:dirKey always zero //printf("dirkey=%d\n",dirKey); sprintf(fileName,"D:/DCIM/%.3s%s/%s%.4s%s", - gDevFileList[i].fileNameString,DCF_DIR_NAME,DCF_FILE_NAME,gDevFileList[i].fileNameString+4, + gDevFileList[i].fileNameString,DCF_DIR_NAME,"SYGW",gDevFileList[i].fileNameString+4, (gDevFileList[i].fileNameString[3] == '0' ? ".JPG" : (gDevFileList[i].fileNameString[3] == '1' ? ".MP4" : ".MP4"))); //profLogPrintf(0,"file:%s", fileName); //printf("str:%s,name:%s,\n",gDevFileList[i].fileNameString,fileName); @@ -1143,7 +1143,7 @@ SINT32 sf_svr_packet_proc(SINT32 fd, UINT8 *pAppData, UINT16 dataLen) return SF_FAILURE; } - char *font_str = sf_get_strg_dev() == MMC_DEV_EMMC ? "BX" : "EX"; + char *dcf_file = sf_get_strg_dev() == MMC_DEV_EMMC ? "SYBX" : "SYEX"; //printf("[sf_svr_packet_proc]dataLen: %d\n",dataLen); @@ -1358,12 +1358,11 @@ SINT32 sf_svr_packet_proc(SINT32 fd, UINT8 *pAppData, UINT16 dataLen) strcpy((char *)tempbuf, (char *)pMsgStruct->msgBuf.getHdFile.dirName); strncpy((char *)tempbuf2, (char *)tempbuf, 3); tempbuf[8] = '\0'; - sprintf((char *)gFileName, "%sDCIM/%s%s/%s%s%s%s", + sprintf((char *)gFileName, "%sDCIM/%s%s/%s%s%s", strg_path, tempbuf2, DCF_DIR_NAME, - DCF_FILE_NAME, - font_str, + dcf_file, tempbuf+4, (tempbuf[3] == '0' ? ".JPG" : (tempbuf[3] == '1' ? ".MP4" : ".MP4"))); } @@ -1900,12 +1899,11 @@ SINT32 sf_svr_packet_proc(SINT32 fd, UINT8 *pAppData, UINT16 dataLen) strncpy((char *)tempbuf2, (char *)pMsgStruct->msgBuf.ctrlFileTransfer.fileName +1, 3); tempbuf[8] = '\0'; - sprintf((char *)fileName, "%sDCIM/%s%s/%s%s%s%s", + sprintf((char *)fileName, "%sDCIM/%s%s/%s%s%s", strg_path, tempbuf2, DCF_DIR_NAME, - DCF_FILE_NAME, - font_str, + dcf_file, tempbuf+4, (tempbuf[0] == 'W' ? ".JPG" : (tempbuf[0] == 'S' ? ".MP4" : ".MP4"))); } @@ -2008,9 +2006,9 @@ SINT32 sf_svr_packet_proc(SINT32 fd, UINT8 *pAppData, UINT16 dataLen) ret = remove((char *)fileName); MLOGI("delete thumb name=%s ret=%d\n",fileName,ret); if(fileType == STILL_THUMB) - sprintf((char *)fileName,"./%3dMEDIA/%s%s%04d.JPG", dirKey, DCF_FILE_NAME, font_str, fileKey); + sprintf((char *)fileName,"./%3dMEDIA/%s%04d.JPG", dirKey, dcf_file, fileKey); else - sprintf((char *)fileName,"./%3dMEDIA/%s%s%04d.MP4", dirKey, DCF_FILE_NAME, font_str, fileKey); + sprintf((char *)fileName,"./%3dMEDIA/%s%04d.MP4", dirKey, dcf_file, fileKey); ret = remove((char *)fileName); } diff --git a/rtos/code/application/source/cardv/SrcCode/System/SysStrg_Exe.c b/rtos/code/application/source/cardv/SrcCode/System/SysStrg_Exe.c index 4c9c38ecc..e61256db8 100644 --- a/rtos/code/application/source/cardv/SrcCode/System/SysStrg_Exe.c +++ b/rtos/code/application/source/cardv/SrcCode/System/SysStrg_Exe.c @@ -445,7 +445,7 @@ void System_OnStrgInit_FS(void) DCF_SetParm(DCF_PRMID_SET_VALID_FILE_FMT, DCF_FILE_TYPE_JPG|DCF_FILE_TYPE_MP4|DCF_FILE_TYPE_MOV); DCF_SetParm(DCF_PRMID_SET_DEP_FILE_FMT, DCF_FILE_TYPE_JPG|DCF_FILE_TYPE_WAV|DCF_FILE_TYPE_MPO); DCF_SetDirFreeChars(DCF_DIR_NAME); - DCF_SetFileFreeChars(DCF_FILE_TYPE_ANYFORMAT, DCF_FILE_NAME); + //DCF_SetFileFreeChars(DCF_FILE_TYPE_ANYFORMAT, DCF_FILE_NAME); } #endif } diff --git a/rtos/code/application/source/cardv/SrcCode/UIApp/MovieFast/MovieFast.c b/rtos/code/application/source/cardv/SrcCode/UIApp/MovieFast/MovieFast.c index 08fcb492c..fc54794d0 100644 --- a/rtos/code/application/source/cardv/SrcCode/UIApp/MovieFast/MovieFast.c +++ b/rtos/code/application/source/cardv/SrcCode/UIApp/MovieFast/MovieFast.c @@ -998,6 +998,8 @@ static void MovieFast_FileNamingCB(MOVIE_CFG_REC_ID id, char *pFileName) } } } + char *dcf_file = mmc_dev->dev_type == MMC_DEV_EMMC ? "SYBX" : "SYEX"; + DCF_SetFileFreeChars(DCF_FILE_TYPE_ANYFORMAT, dcf_file); DCF_MakeObjPathEx(handle, nextFolderID, nextFileID, DCF_FILE_TYPE_MP4, pFileName); DCF_AddDBfileEx(handle, pFileName); DBG_DUMP("%s added to DCF\r\n", pFileName); @@ -1294,7 +1296,7 @@ static void MovieFast_FileNaming_Init(void) { static UINT8 is_init = 0; -#if USE_RTOS_MMC_CHECK +#if 0//USE_RTOS_MMC_CHECK SF_RTOS_ST_MMC_DEV *mmc_dev = SF_RtosStrgCheckWorkableDev(); if(mmc_dev ==NULL) { @@ -1306,14 +1308,11 @@ static void MovieFast_FileNaming_Init(void) DBG_ERR("dcf_handle err\n"); return; } - + //char *font_str = mmc_dev->dev_type == MMC_DEV_EMMC ? "BX" : "EX"; + //char file_name[64] = {'\0'}; + //snprintf(file_name, sizeof(file_name), "%s%s", DCF_FILE_NAME, font_str); /* DCF 8.3 naming rule */ #endif - char *font_str = mmc_dev->dev_type == MMC_DEV_EMMC ? "BX" : "EX"; - char file_name[64] = {'\0'}; - - snprintf(file_name, sizeof(file_name), "%s%s", DCF_FILE_NAME, font_str); /* DCF 8.3 naming rule */ - if(is_init == 1) return; @@ -1325,7 +1324,7 @@ static void MovieFast_FileNaming_Init(void) DCF_SetParm(DCF_PRMID_SET_VALID_FILE_FMT, DCF_FILE_TYPE_JPG|DCF_FILE_TYPE_MP4|DCF_FILE_TYPE_MOV); DCF_SetParm(DCF_PRMID_SET_DEP_FILE_FMT, DCF_FILE_TYPE_JPG|DCF_FILE_TYPE_WAV|DCF_FILE_TYPE_MPO); DCF_SetDirFreeChars(DCF_DIR_NAME); - DCF_SetFileFreeChars(DCF_FILE_TYPE_ANYFORMAT, file_name); + //DCF_SetFileFreeChars(DCF_FILE_TYPE_ANYFORMAT, DCF_FILE_NAME); } THREAD_RETTYPE MovieFast_InitFileNamingThread(void *arg) diff --git a/rtos/code/application/source/cardv/SrcCode/UIApp/PhotoFast/PhotoFast.c b/rtos/code/application/source/cardv/SrcCode/UIApp/PhotoFast/PhotoFast.c index 62557004d..74d461979 100644 --- a/rtos/code/application/source/cardv/SrcCode/UIApp/PhotoFast/PhotoFast.c +++ b/rtos/code/application/source/cardv/SrcCode/UIApp/PhotoFast/PhotoFast.c @@ -715,24 +715,6 @@ HD_RESULT PhotoFast_get_hd_common_buf(PPHOTOFAST_HD_COM_BUF p_hd_comm_buf) static void PhotoFast_FileNaming_Init(void) { static UINT8 is_init = 0; -#if USE_RTOS_MMC_CHECK - SF_RTOS_ST_MMC_DEV *mmc_dev = SF_RtosStrgCheckWorkableDev(); - if(mmc_dev ==NULL) - { - DBG_ERR("No MMC_Dev Can use!\n"); - return; - } - if(mmc_dev->dcf_handle < 0) - { - DBG_ERR("dcf_handle err\n"); - return; - } - -#endif - char *font_str = mmc_dev->dev_type == MMC_DEV_EMMC ? "BX" : "EX"; - char file_name[64] = {'\0'}; - - snprintf(file_name, sizeof(file_name), "%s%s", DCF_FILE_NAME, font_str); /* DCF 8.3 naming rule */ if(is_init == 1) return; @@ -745,7 +727,7 @@ static void PhotoFast_FileNaming_Init(void) DCF_SetParm(DCF_PRMID_SET_VALID_FILE_FMT, DCF_FILE_TYPE_JPG|DCF_FILE_TYPE_MP4|DCF_FILE_TYPE_MOV); DCF_SetParm(DCF_PRMID_SET_DEP_FILE_FMT, DCF_FILE_TYPE_JPG|DCF_FILE_TYPE_WAV|DCF_FILE_TYPE_MPO); DCF_SetDirFreeChars(DCF_DIR_NAME); - DCF_SetFileFreeChars(DCF_FILE_TYPE_ANYFORMAT, file_name); + //DCF_SetFileFreeChars(DCF_FILE_TYPE_ANYFORMAT, DCF_FILE_NAME); } INT32 PhotoFast_FileNaming_Open(void) @@ -1032,6 +1014,20 @@ INT32 PhotoFast_WriteFile(UINT32 Addr, UINT32 Size, UINT32 Fmt, UINT32 uiPathId, UINT32 nextFolderID = 0, nextFileID = 0; DCF_HANDLE handle = PhotoFast_Get_DCF_Handle(); /* handle determines which storage would be written */ +#if USE_RTOS_MMC_CHECK + SF_RTOS_ST_MMC_DEV *mmc_dev = SF_RtosStrgCheckWorkableDev(); + if(mmc_dev ==NULL) + { + DBG_ERR("No MMC_Dev Can use!\n"); + return -1; + } + if(mmc_dev->dcf_handle < 0) + { + DBG_ERR("dcf_handle err\n"); + return -1; + } +#endif + if(Path == NULL){ if (DCF_GetDBInfoEx(handle, DCF_INFO_IS_9999)) { DBG_ERR("Exceed max dcf file!\r\n"); @@ -1069,6 +1065,8 @@ INT32 PhotoFast_WriteFile(UINT32 Addr, UINT32 Size, UINT32 Fmt, UINT32 uiPathId, } } } + char *dcf_file = mmc_dev->dev_type == MMC_DEV_EMMC ? "SYBX" : "SYEX"; + DCF_SetFileFreeChars(DCF_FILE_TYPE_ANYFORMAT, dcf_file); DCF_MakeObjPathEx(handle, nextFolderID, nextFileID, fileType, FilePath); DCF_AddDBfileEx(handle, FilePath); DBG_DUMP("%s added to DCF\r\n", FilePath); @@ -1082,9 +1080,10 @@ INT32 PhotoFast_WriteFile(UINT32 Addr, UINT32 Size, UINT32 Fmt, UINT32 uiPathId, char tmp[NMC_TOTALFILEPATH_MAX_LEN] = {'\0'}; char str1[5] = { 0 }; char str2[5] = { 0 }; + char font = mmc_dev->dev_type == MMC_DEV_EMMC ? 'B' : 'E'; memcpy(str1, FilePath + 8, 3); memcpy(str2, FilePath + 21, 4); - sprintf(tmp, "W%s%s.JPG", str1, str2); + sprintf(tmp, "W%c%s%s.JPG", font, str1, str2); //sprintf(tmp, "W%03ld%04ld.JPG", nextFolderID, nextFileID); strncpy(g_photo_fast_write_file_Path, tmp, sizeof(g_photo_fast_write_file_Path) - 1); DBG_IND("last send file:%s\r\n", tmp); From 9b6fa552e6e530a923424bd81830fa6ec8a34267 Mon Sep 17 00:00:00 2001 From: "sober.song" Date: Sat, 6 Jan 2024 18:36:22 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dlinux=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E5=90=AF=E5=8A=A8=E9=A6=96=E6=AC=A1=E5=91=BD=E5=90=8D=E7=9B=98?= =?UTF-8?q?=E7=AC=A6=E9=94=99=E4=B9=B1=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../source/cardv/SrcCode/System/SF_SysStrgMng.c | 10 ++++++++++ .../source/cardv/SrcCode/System/SysStrg_Exe.c | 4 ++-- .../source/cardv/SrcCode/UIApp/Movie/UIAppMovie_Exe.c | 9 ++++++--- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/code/application/source/cardv/SrcCode/System/SF_SysStrgMng.c b/code/application/source/cardv/SrcCode/System/SF_SysStrgMng.c index 7a363e3de..d8049ba2c 100755 --- a/code/application/source/cardv/SrcCode/System/SF_SysStrgMng.c +++ b/code/application/source/cardv/SrcCode/System/SF_SysStrgMng.c @@ -19,6 +19,10 @@ #include #include #include "sf_mcu.h" +#if (USE_DCF == ENABLE) +#include "DCF.h" +#endif + #if HUNTING_CAMERA_MCU == ENABLE #include @@ -336,6 +340,12 @@ SF_ST_MMC_DEV *SF_StrgCheckWorkableDev(void) sf_mmc_dev[workable_dev]->dev_type = workable_dev; //MLOGD("Strg Check, workable_dev = %d\n", workable_dev); SF_SetMMCDev(sf_mmc_dev[workable_dev]); + + if(workable_dev == MMC_DEV_SD) + DCF_SetFileFreeChars(DCF_FILE_TYPE_ANYFORMAT, "SYEX"); + else if(workable_dev == MMC_DEV_EMMC) + DCF_SetFileFreeChars(DCF_FILE_TYPE_ANYFORMAT, "SYBX"); + return sf_mmc_dev[workable_dev]; } } diff --git a/code/application/source/cardv/SrcCode/System/SysStrg_Exe.c b/code/application/source/cardv/SrcCode/System/SysStrg_Exe.c index 05c0620e9..ee4d0a1fd 100644 --- a/code/application/source/cardv/SrcCode/System/SysStrg_Exe.c +++ b/code/application/source/cardv/SrcCode/System/SysStrg_Exe.c @@ -983,11 +983,11 @@ INT32 System_OnStrgInsert(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray) if(strg_id == STRG_ID_SD){ DBG_WRN("sd act\n"); System_Set_Storage_Act_Drive(g_strg_mapping_table[strg_id].drive); - DCF_SetFileFreeChars(DCF_FILE_TYPE_ANYFORMAT, "SYEX"); + //DCF_SetFileFreeChars(DCF_FILE_TYPE_ANYFORMAT, "SYEX"); } else if(strg_id == STRG_ID_EMMC){ DBG_WRN("emmc act\n"); - DCF_SetFileFreeChars(DCF_FILE_TYPE_ANYFORMAT, "SYBX"); + //DCF_SetFileFreeChars(DCF_FILE_TYPE_ANYFORMAT, "SYBX"); System_Set_Storage_Act_Drive(g_strg_mapping_table[strg_id].drive); } #if USE_MMC_DEV_CHECK diff --git a/code/application/source/cardv/SrcCode/UIApp/Movie/UIAppMovie_Exe.c b/code/application/source/cardv/SrcCode/UIApp/Movie/UIAppMovie_Exe.c index 8a61e7e67..d42ea7127 100755 --- a/code/application/source/cardv/SrcCode/UIApp/Movie/UIAppMovie_Exe.c +++ b/code/application/source/cardv/SrcCode/UIApp/Movie/UIAppMovie_Exe.c @@ -1227,6 +1227,8 @@ static void MovieExe_FileNamingCB(MOVIE_CFG_REC_ID id, char *pFileName) UINT32 dcf_handle = (UINT32)System_Get_DCF_Handle(); /* 0:emmc 1:sd */ char font = System_Get_DCF_Disk_Drive(dcf_handle) == 'B' ? 'B' : 'E'; char *dcf_file = System_Get_DCF_Disk_Drive(dcf_handle) == 'B' ? "SYBX" : "SYEX"; + DBG_DUMP("movie naming: %c %s\n", System_Get_DCF_Disk_Drive(dcf_handle), dcf_file); + DCF_SetFileFreeChars(DCF_FILE_TYPE_ANYFORMAT, dcf_file); #if USE_FILEDB static struct tm CurDateTime = {0}; g_FileSerialNum++; @@ -1264,8 +1266,7 @@ static void MovieExe_FileNamingCB(MOVIE_CFG_REC_ID id, char *pFileName) DBG_ERR("Exceed max dcf file!\r\n"); pFileName[0] = '\0'; } else { - - DCF_SetFileFreeChars(DCF_FILE_TYPE_ANYFORMAT, dcf_file); + DCF_GetNextIDEx(dcf_handle, &nextFolderID,&nextFileID); DCF_MakeObjPathEx(dcf_handle, nextFolderID, nextFileID, DCF_FILE_TYPE_MP4, pFileName); DCF_AddDBfileEx(dcf_handle, pFileName); @@ -1301,6 +1302,8 @@ static void MovieExe_RawEncodeFileNamingCB(MOVIE_CFG_REC_ID id, char *pFileName) { UINT32 dcf_handle = (UINT32)System_Get_DCF_Handle(); /* 0:emmc 1:sd */ char *dcf_file = System_Get_DCF_Disk_Drive(dcf_handle) == 'B' ? "SYBX" : "SYEX"; + DBG_DUMP("photo naming: %c %s\n", System_Get_DCF_Disk_Drive(dcf_handle), dcf_file); + DCF_SetFileFreeChars(DCF_FILE_TYPE_ANYFORMAT, dcf_file); #if USE_FILEDB static struct tm CurDateTime = {0}; @@ -1339,7 +1342,7 @@ static void MovieExe_RawEncodeFileNamingCB(MOVIE_CFG_REC_ID id, char *pFileName) pFileName[0] = '\0'; } else { DBG_DUMP("JPG %s added to DCF Path%lu\r\n", pFileName, dcf_handle); - DCF_SetFileFreeChars(DCF_FILE_TYPE_ANYFORMAT, dcf_file); + DCF_GetNextIDEx(dcf_handle, &nextFolderID,&nextFileID); DCF_MakeObjPathEx(dcf_handle, nextFolderID, nextFileID, DCF_FILE_TYPE_JPG, pFileName); }