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);