1.修复预约功能
This commit is contained in:
parent
b076336ce7
commit
f4be410904
|
@ -944,6 +944,7 @@
|
||||||
#define SF_HD_DIR_LIST SF_SEND_LIST_DIR"HD/send.list" //No use
|
#define SF_HD_DIR_LIST SF_SEND_LIST_DIR"HD/send.list" //No use
|
||||||
#define SF_HD_DIR SF_SEND_LIST_DIR"HD"
|
#define SF_HD_DIR SF_SEND_LIST_DIR"HD"
|
||||||
#define SF_HD_DIR_CARDV "A:\\THUMB\\HD\\" //No use
|
#define SF_HD_DIR_CARDV "A:\\THUMB\\HD\\" //No use
|
||||||
|
#define SF_HD_DIR_EMMC "B:\\THUMB\\HD\\" //No use
|
||||||
|
|
||||||
|
|
||||||
#define SF_FW_CFG_FILE_NAME "SPHOST_REVEAL.CFG"
|
#define SF_FW_CFG_FILE_NAME "SPHOST_REVEAL.CFG"
|
||||||
|
|
|
@ -301,6 +301,7 @@ typedef struct HDImgList
|
||||||
{
|
{
|
||||||
UINT16 dirKey;
|
UINT16 dirKey;
|
||||||
UINT16 fileKey;
|
UINT16 fileKey;
|
||||||
|
UINT16 storage;//0:emmc; 1:sd
|
||||||
} HDImgList_t;
|
} HDImgList_t;
|
||||||
typedef struct sf_HDFILE_ATTR_S {
|
typedef struct sf_HDFILE_ATTR_S {
|
||||||
UINT8 filecnt;
|
UINT8 filecnt;
|
||||||
|
|
|
@ -1799,15 +1799,6 @@ SINT32 sf_hd_ftp_send(void)
|
||||||
UINT8 timeoutCnt = 0;
|
UINT8 timeoutCnt = 0;
|
||||||
double elapsed_time = 0;
|
double elapsed_time = 0;
|
||||||
|
|
||||||
char *strg_path = sf_get_root_path();
|
|
||||||
if(strg_path == NULL)
|
|
||||||
{
|
|
||||||
free(strg_path);
|
|
||||||
return SF_FAILURE;
|
|
||||||
}
|
|
||||||
|
|
||||||
char font = sf_get_strg_dev() == MMC_DEV_EMMC ? SF_EMMC_DCF_HANDLE : SF_SD_DCF_HANDLE;
|
|
||||||
|
|
||||||
sf_set_send_hd(0);
|
sf_set_send_hd(0);
|
||||||
sf_custom_str_get(CamNameStr);
|
sf_custom_str_get(CamNameStr);
|
||||||
sf_4G_signal_level_get(sf_get_net_generation(),sf_get_cq_signal(),&csqlevel);
|
sf_4G_signal_level_get(sf_get_net_generation(),sf_get_cq_signal(),&csqlevel);
|
||||||
|
@ -1821,9 +1812,9 @@ 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))))
|
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%c%03d%04d.JPG", font, 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);
|
//snprintf((char *)filePath, sizeof(filePath), "%s%s/%s", strg_path, SF_HD_DIR, ftpFileName);
|
||||||
free(strg_path);
|
//free(strg_path);
|
||||||
sf_set_del_flag(FALSE);
|
sf_set_del_flag(FALSE);
|
||||||
ret1 = SF_SUCCESS;//sf_quectel_upload_file_to_module(filePath, ftpFileName);
|
ret1 = SF_SUCCESS;//sf_quectel_upload_file_to_module(filePath, ftpFileName);
|
||||||
|
|
||||||
|
@ -1840,10 +1831,19 @@ SINT32 sf_hd_ftp_send(void)
|
||||||
battery = sf_app_get_battery();
|
battery = sf_app_get_battery();
|
||||||
memset(cameraID, '\0', sizeof(cameraID));
|
memset(cameraID, '\0', sizeof(cameraID));
|
||||||
memset(ftpFileName, '\0', sizeof(ftpFileName));
|
memset(ftpFileName, '\0', sizeof(ftpFileName));
|
||||||
//memset(filePath, '\0', sizeof(filePath));
|
memset(filePath, '\0', sizeof(filePath));
|
||||||
|
|
||||||
snprintf(cameraID, sizeof(cameraID), "%s-%d-%d-%s-", pPara->ModuleImei, battery, csqlevel, CamNameStr);
|
snprintf(cameraID, sizeof(cameraID), "%s-%d-%d-%s-", pPara->ModuleImei, battery, csqlevel, CamNameStr);
|
||||||
snprintf((char *)ftpFileName, sizeof(ftpFileName), "%sHD-W%c%03d%04d.JPG", cameraID, font, fileCfg->stfileattr[piccount].dirKey, fileCfg->stfileattr[piccount].fileKey);
|
if(fileCfg->stfileattr[piccount].storage == 1)
|
||||||
|
{
|
||||||
|
snprintf((char *)ftpFileName, sizeof(ftpFileName), "%sHD-%c%03d%04d.JPG", cameraID, SF_SD_DCF_HANDLE, fileCfg->stfileattr[piccount].dirKey, fileCfg->stfileattr[piccount].fileKey);
|
||||||
|
snprintf((char *)filePath, sizeof(filePath), "%s%s/%c%03d%04d.JPG", SF_SD_ROOT, SF_HD_DIR, SF_SD_DCF_HANDLE, fileCfg->stfileattr[piccount].dirKey, fileCfg->stfileattr[piccount].fileKey);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
snprintf((char *)ftpFileName, sizeof(ftpFileName), "%sHD-%c%03d%04d.JPG", cameraID, SF_EMMC_DCF_HANDLE, fileCfg->stfileattr[piccount].dirKey, fileCfg->stfileattr[piccount].fileKey);
|
||||||
|
snprintf((char *)filePath, sizeof(filePath), "%s%s/%c%03d%04d.JPG", SF_EMMC_ROOT, SF_HD_DIR, SF_EMMC_DCF_HANDLE, 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);
|
//snprintf((char *)filePath, sizeof(filePath), "UFS:/W%03d%04d.JPG", fileCfg->stfileattr[piccount].dirKey, fileCfg->stfileattr[piccount].fileKey);
|
||||||
|
|
||||||
|
@ -1959,7 +1959,7 @@ SF_HD_END:
|
||||||
Return: file size
|
Return: file size
|
||||||
Others: N/A
|
Others: N/A
|
||||||
*************************************************/
|
*************************************************/
|
||||||
UINT32 sf_video_find_file(UINT16 dirKey, UINT16 fileKey, UINT8 *destFname)
|
UINT32 sf_video_find_file(UINT16 dirKey, UINT16 fileKey, UINT16 storage, UINT8 *destFname)
|
||||||
{
|
{
|
||||||
UINT32 fileIndex = 0;
|
UINT32 fileIndex = 0;
|
||||||
UINT32 fileSize = 0;
|
UINT32 fileSize = 0;
|
||||||
|
@ -1967,22 +1967,20 @@ UINT32 sf_video_find_file(UINT16 dirKey, UINT16 fileKey, UINT8 *destFname)
|
||||||
char fname[50] = {0};
|
char fname[50] = {0};
|
||||||
//UINT8 srcFname[50] = {0};
|
//UINT8 srcFname[50] = {0};
|
||||||
|
|
||||||
char *strg_path = sf_get_root_path();
|
|
||||||
char *dcf_file = sf_get_strg_dev() == MMC_DEV_EMMC ? SF_EMMC_DCF_FILE_NAME : SF_SD_DCF_FILE_NAME;
|
|
||||||
if(strg_path == NULL)
|
|
||||||
{
|
|
||||||
free(strg_path);
|
|
||||||
return SF_FAILURE;
|
|
||||||
}
|
|
||||||
|
|
||||||
fileIndex = dirKey * 10000 + fileKey + 1;
|
fileIndex = dirKey * 10000 + fileKey + 1;
|
||||||
|
|
||||||
for(i = 0; i < 3; i++)
|
for(i = 0; i < 3; i++)
|
||||||
{
|
{
|
||||||
dirKey = fileIndex / 10000;
|
dirKey = fileIndex / 10000;
|
||||||
fileKey = fileIndex % 10000;
|
fileKey = fileIndex % 10000;
|
||||||
SF_SPRINTF(fname, "%s%s/%03dMEDIA/%s%04d.MP4", strg_path, SF_DCIM_DIR, dirKey, dcf_file, fileKey);
|
if(storage == 1)
|
||||||
|
{
|
||||||
|
SF_SPRINTF(fname, "%s%s/%03dMEDIA/%s%04d.MP4", SF_SD_ROOT, SF_DCIM_DIR, dirKey, SF_SD_DCF_FILE_NAME, fileKey);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SF_SPRINTF(fname, "%s%s/%03dMEDIA/%s%04d.MP4", SF_EMMC_ROOT, SF_DCIM_DIR, dirKey, SF_EMMC_DCF_FILE_NAME, fileKey);
|
||||||
|
}
|
||||||
//fileSize = sf_get_file_size(fname);
|
//fileSize = sf_get_file_size(fname);
|
||||||
sf_file_size_get(fname,&fileSize);
|
sf_file_size_get(fname,&fileSize);
|
||||||
printf("find video:%s size=%d\n", fname, fileSize);
|
printf("find video:%s size=%d\n", fname, fileSize);
|
||||||
|
@ -1994,7 +1992,6 @@ UINT32 sf_video_find_file(UINT16 dirKey, UINT16 fileKey, UINT8 *destFname)
|
||||||
}
|
}
|
||||||
fileIndex++;
|
fileIndex++;
|
||||||
}
|
}
|
||||||
free(strg_path);
|
|
||||||
return fileSize;
|
return fileSize;
|
||||||
}
|
}
|
||||||
/*************************************************
|
/*************************************************
|
||||||
|
@ -2039,8 +2036,6 @@ SINT32 sf_video_ftp_send(void)
|
||||||
double elapsed_time = 0;
|
double elapsed_time = 0;
|
||||||
SINT64 sendEndTime = 0;
|
SINT64 sendEndTime = 0;
|
||||||
UINT32 size = 0;
|
UINT32 size = 0;
|
||||||
|
|
||||||
char font = sf_get_strg_dev() == MMC_DEV_EMMC ? SF_EMMC_DCF_HANDLE : SF_SD_DCF_HANDLE;
|
|
||||||
|
|
||||||
sf_set_send_video(0);
|
sf_set_send_video(0);
|
||||||
sf_custom_str_get(CamNameStr);
|
sf_custom_str_get(CamNameStr);
|
||||||
|
@ -2055,11 +2050,11 @@ 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))))
|
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%c%03d%04d.MP4", font, 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);
|
//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);
|
printf("[%s:%d] piccount:%d dirKey:%d fileKey:%d\n", __FUNCTION__, __LINE__, piccount, fileCfg->stfileattr[piccount].dirKey, fileCfg->stfileattr[piccount].fileKey);
|
||||||
|
|
||||||
size = sf_video_find_file(fileCfg->stfileattr[piccount].dirKey, fileCfg->stfileattr[piccount].fileKey,filePath);
|
size = sf_video_find_file(fileCfg->stfileattr[piccount].dirKey, fileCfg->stfileattr[piccount].fileKey, fileCfg->stfileattr[piccount].storage, filePath);
|
||||||
if(size == 0)
|
if(size == 0)
|
||||||
{
|
{
|
||||||
pSifarPara->videoSendCount--;
|
pSifarPara->videoSendCount--;
|
||||||
|
@ -2085,7 +2080,7 @@ SINT32 sf_video_ftp_send(void)
|
||||||
//memset(filePath, '\0', sizeof(filePath));
|
//memset(filePath, '\0', sizeof(filePath));
|
||||||
|
|
||||||
snprintf(cameraID, sizeof(cameraID), "%s-%d-%d-%s-", pPara->ModuleImei, battery, csqlevel, CamNameStr);
|
snprintf(cameraID, sizeof(cameraID), "%s-%d-%d-%s-", pPara->ModuleImei, battery, csqlevel, CamNameStr);
|
||||||
snprintf((char *)ftpFileName, sizeof(ftpFileName), "%sW%c%03d%04d.MP4", cameraID, font, fileCfg->stfileattr[piccount].dirKey, fileCfg->stfileattr[piccount].fileKey);
|
snprintf((char *)ftpFileName, sizeof(ftpFileName), "%s%c%03d%04d.MP4", cameraID, fileCfg->stfileattr[piccount].storage == 0 ? SF_EMMC_DCF_HANDLE : SF_SD_DCF_HANDLE, 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);
|
//snprintf((char *)filePath, sizeof(filePath), "UFS:/W%03d%04d.MP4", fileCfg->stfileattr[piccount].dirKey, fileCfg->stfileattr[piccount].fileKey);
|
||||||
|
|
||||||
|
|
|
@ -1973,24 +1973,24 @@ void sf_hd_pic_add_to_list(UINT8 *fileName)
|
||||||
UINT16 dirKey = 0;
|
UINT16 dirKey = 0;
|
||||||
UINT16 fileKey = 0;
|
UINT16 fileKey = 0;
|
||||||
UINT8 tempStr[20] = {0};
|
UINT8 tempStr[20] = {0};
|
||||||
char emmcsdStr[4] = {0};
|
UINT16 storage = 0;
|
||||||
|
|
||||||
SubImgList_t *pList = pSubImgListHead;
|
SubImgList_t *pList = pSubImgListHead;
|
||||||
SubImgList_t *qList = pSubImgListHead;
|
SubImgList_t *qList = pSubImgListHead;
|
||||||
char fname[50] = {0};
|
char fname[50] = {0};
|
||||||
printf("[%s:%d] add to list:%s\n", __FUNCTION__, __LINE__, fileName);
|
printf("[%s:%d] add to list:%s\n", __FUNCTION__, __LINE__, fileName);
|
||||||
|
|
||||||
SF_STRNCPY(emmcsdStr, fileName, 1);
|
|
||||||
SF_STRNCPY(tempStr, fileName+1, 3);
|
SF_STRNCPY(tempStr, fileName+1, 3);
|
||||||
dirKey = atoi((const char *)tempStr);
|
dirKey = atoi((const char *)tempStr);
|
||||||
fileKey = atoi((const char *)fileName+4);
|
fileKey = atoi((const char *)fileName+4);
|
||||||
if(strstr(emmcsdStr, "E"))
|
if(strstr((char*)fileName, "E"))
|
||||||
{
|
{
|
||||||
SF_SPRINTF(fname, "mmt/sd/%s/%03dMEDIA/%s%04d.JPG", SF_DCIM_DIR, dirKey, SF_SD_DCF_FILE_NAME, fileKey);
|
SF_SPRINTF(fname, "%s%s/%03dMEDIA/%s%04d.JPG", SF_SD_ROOT,SF_DCIM_DIR, dirKey, SF_SD_DCF_FILE_NAME, fileKey);
|
||||||
|
storage = 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SF_SPRINTF(fname, "mmt/sd2/%s/%03dMEDIA/%s%04d.JPG", SF_DCIM_DIR, dirKey, SF_EMMC_DCF_FILE_NAME, fileKey);
|
SF_SPRINTF(fname, "%s%s/%03dMEDIA/%s%04d.JPG", SF_EMMC_ROOT, SF_DCIM_DIR, dirKey, SF_EMMC_DCF_FILE_NAME, fileKey);
|
||||||
|
storage = 0;
|
||||||
}
|
}
|
||||||
if(sf_file_IsExsit(fname) != SF_TRUE)
|
if(sf_file_IsExsit(fname) != SF_TRUE)
|
||||||
{
|
{
|
||||||
|
@ -2018,6 +2018,7 @@ void sf_hd_pic_add_to_list(UINT8 *fileName)
|
||||||
/* add file key to list*/
|
/* add file key to list*/
|
||||||
pList->dirKey = dirKey;
|
pList->dirKey = dirKey;
|
||||||
pList->fileKey = fileKey;
|
pList->fileKey = fileKey;
|
||||||
|
pList->storage = storage;
|
||||||
pList->pNext = NULL;
|
pList->pNext = NULL;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -2050,16 +2051,17 @@ void sf_hd_pic_list_print(void)
|
||||||
printf("[%s:%d] print list:\n", __FUNCTION__, __LINE__);
|
printf("[%s:%d] print list:\n", __FUNCTION__, __LINE__);
|
||||||
SF_HDFILE_ATTR_S* fileCfg = sf_file_hd_cfg_get();
|
SF_HDFILE_ATTR_S* fileCfg = sf_file_hd_cfg_get();
|
||||||
|
|
||||||
char *strg_path = sf_get_root_path();
|
snprintf(hd_dir, sizeof(hd_dir), "%s%s", SF_SD_ROOT, SF_HD_DIR);
|
||||||
if(strg_path == NULL)
|
if (stat(hd_dir, &st_buffer) == 0 && S_ISDIR(st_buffer.st_mode)) {
|
||||||
{
|
printf("%s exists\n", hd_dir);
|
||||||
free(strg_path);
|
}
|
||||||
return;
|
else{
|
||||||
}
|
if (mkdir(hd_dir, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH) != 0) {
|
||||||
|
printf("Failed to create directory");
|
||||||
snprintf(hd_dir, sizeof(hd_dir), "%s%s", strg_path, SF_HD_DIR);
|
}
|
||||||
free(strg_path);
|
}
|
||||||
|
|
||||||
|
snprintf(hd_dir, sizeof(hd_dir), "%s%s", SF_EMMC_ROOT, SF_HD_DIR);
|
||||||
if (stat(hd_dir, &st_buffer) == 0 && S_ISDIR(st_buffer.st_mode)) {
|
if (stat(hd_dir, &st_buffer) == 0 && S_ISDIR(st_buffer.st_mode)) {
|
||||||
printf("%s exists\n", hd_dir);
|
printf("%s exists\n", hd_dir);
|
||||||
}
|
}
|
||||||
|
@ -2077,9 +2079,10 @@ void sf_hd_pic_list_print(void)
|
||||||
{
|
{
|
||||||
//snprintf(buff, sizeof(buff), "%d%d\r\n", pList->dirKey, pList->fileKey);
|
//snprintf(buff, sizeof(buff), "%d%d\r\n", pList->dirKey, pList->fileKey);
|
||||||
//write(fd, buff, strlen(buff));
|
//write(fd, buff, strlen(buff));
|
||||||
printf("ID:%d f:%d,%d\n", i++, pList->dirKey, pList->fileKey);
|
printf("ID:%d f:%d,%d,%d\n", i++, pList->dirKey, pList->fileKey, pList->storage);
|
||||||
fileCfg->stfileattr[fileCfg->filecnt].dirKey = pList->dirKey;
|
fileCfg->stfileattr[fileCfg->filecnt].dirKey = pList->dirKey;
|
||||||
fileCfg->stfileattr[fileCfg->filecnt].fileKey = pList->fileKey;
|
fileCfg->stfileattr[fileCfg->filecnt].fileKey = pList->fileKey;
|
||||||
|
fileCfg->stfileattr[fileCfg->filecnt].storage = pList->storage;
|
||||||
fileCfg->filecnt += 1;
|
fileCfg->filecnt += 1;
|
||||||
pList = pList->pNext;
|
pList = pList->pNext;
|
||||||
}
|
}
|
||||||
|
@ -2121,15 +2124,9 @@ void sf_video_add_to_list(UINT8 *fileName)
|
||||||
UINT8 i = 0;
|
UINT8 i = 0;
|
||||||
UINT16 dirKeytmp = 0;
|
UINT16 dirKeytmp = 0;
|
||||||
UINT16 fileKeytmp = 0;
|
UINT16 fileKeytmp = 0;
|
||||||
char *dcf_file = sf_get_strg_dev() == MMC_DEV_EMMC ? SF_EMMC_DCF_FILE_NAME : SF_SD_DCF_FILE_NAME;
|
UINT16 storage = 0;
|
||||||
printf("add to list:%s\n", fileName);
|
|
||||||
|
|
||||||
char *strg_path = sf_get_root_path();
|
printf("add to list:%s\n", fileName);
|
||||||
if(strg_path == NULL)
|
|
||||||
{
|
|
||||||
free(strg_path);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
SF_STRNCPY(tempStr, fileName+1, 3);
|
SF_STRNCPY(tempStr, fileName+1, 3);
|
||||||
dirKey = atoi((const char *)tempStr);
|
dirKey = atoi((const char *)tempStr);
|
||||||
|
@ -2141,8 +2138,16 @@ void sf_video_add_to_list(UINT8 *fileName)
|
||||||
{
|
{
|
||||||
dirKeytmp = fileIndex / 10000;
|
dirKeytmp = fileIndex / 10000;
|
||||||
fileKeytmp = fileIndex % 10000;
|
fileKeytmp = fileIndex % 10000;
|
||||||
SF_SPRINTF(fname, "%s%s/%03dMEDIA/%s%04d.MP4", strg_path, SF_DCIM_DIR, dirKeytmp, dcf_file, fileKeytmp);
|
if(strstr((char*)fileName, "E"))
|
||||||
free(strg_path);
|
{
|
||||||
|
SF_SPRINTF(fname, "%s%s/%03dMEDIA/%s%04d.MP4", SF_SD_ROOT, SF_DCIM_DIR, dirKeytmp, SF_SD_DCF_FILE_NAME, fileKeytmp);
|
||||||
|
storage = 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SF_SPRINTF(fname, "%s%s/%03dMEDIA/%s%04d.MP4", SF_EMMC_ROOT, SF_DCIM_DIR, dirKeytmp, SF_EMMC_DCF_FILE_NAME, fileKeytmp);
|
||||||
|
storage = 0;
|
||||||
|
}
|
||||||
sf_file_size_get(fname,&fileSize);
|
sf_file_size_get(fname,&fileSize);
|
||||||
printf("find video:%s size=%d\n", fname, fileSize);
|
printf("find video:%s size=%d\n", fname, fileSize);
|
||||||
|
|
||||||
|
@ -2179,6 +2184,7 @@ void sf_video_add_to_list(UINT8 *fileName)
|
||||||
/* add file key to list*/
|
/* add file key to list*/
|
||||||
pList->dirKey = dirKey;
|
pList->dirKey = dirKey;
|
||||||
pList->fileKey = fileKey;
|
pList->fileKey = fileKey;
|
||||||
|
pList->storage = storage;
|
||||||
pList->pNext = NULL;
|
pList->pNext = NULL;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -2209,8 +2215,9 @@ void sf_video_list_print(void)
|
||||||
{
|
{
|
||||||
fileCfg->stfileattr[fileCfg->filecnt].dirKey = pList->dirKey;
|
fileCfg->stfileattr[fileCfg->filecnt].dirKey = pList->dirKey;
|
||||||
fileCfg->stfileattr[fileCfg->filecnt].fileKey = pList->fileKey;
|
fileCfg->stfileattr[fileCfg->filecnt].fileKey = pList->fileKey;
|
||||||
|
fileCfg->stfileattr[fileCfg->filecnt].storage = pList->storage;
|
||||||
fileCfg->filecnt += 1;
|
fileCfg->filecnt += 1;
|
||||||
printf("filecnt:%d f:%d,%d\n", fileCfg->filecnt, pList->dirKey, pList->fileKey);
|
printf("filecnt:%d f:%d,%d,%d\n", fileCfg->filecnt, pList->dirKey, pList->fileKey, pList->storage);
|
||||||
pList = pList->pNext;
|
pList = pList->pNext;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2080,29 +2080,13 @@ SINT32 sf_app_to_cardv_hd_ture(void) {
|
||||||
SINT32 s32ret = SF_FAILURE;
|
SINT32 s32ret = SF_FAILURE;
|
||||||
MLOGI(" falg:%d\n",falg);
|
MLOGI(" falg:%d\n",falg);
|
||||||
|
|
||||||
char *strg_path = sf_get_root_path();
|
|
||||||
if(strg_path == NULL)
|
|
||||||
{
|
|
||||||
free(strg_path);
|
|
||||||
return SF_FAILURE;
|
|
||||||
}
|
|
||||||
|
|
||||||
char sendHDName[64] = {0};
|
|
||||||
if(falg)
|
if(falg)
|
||||||
{
|
{
|
||||||
return falg;
|
return falg;
|
||||||
}
|
}
|
||||||
falg = 1;
|
falg = 1;
|
||||||
snprintf(sendHDName, sizeof(sendHDName), "%s%s", strg_path, SF_HD_DIR);
|
|
||||||
|
|
||||||
if(sf_file_IsExsit((CHAR *)sendHDName) != SF_TRUE)
|
|
||||||
{
|
|
||||||
MLOGI(" not HD Dir [%s]\n",sendHDName);
|
|
||||||
|
|
||||||
}
|
|
||||||
MLOGI(" [%s]\n",sendHDName);
|
|
||||||
|
|
||||||
s32ret = sf_share_mem_hd_down(1);
|
s32ret = sf_share_mem_hd_down(1);
|
||||||
|
MLOGI(" e ret:0x%08X\n",s32ret);
|
||||||
return s32ret;
|
return s32ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1640,11 +1640,11 @@ UINT32 sf_cardv_adc_value_get(UINT32 mux, UINT32 *pval)
|
||||||
void sf_transcode_bs_ready_cb(void* bitstream_va, UINT32 size)
|
void sf_transcode_bs_ready_cb(void* bitstream_va, UINT32 size)
|
||||||
{
|
{
|
||||||
//SF_HD_DIR
|
//SF_HD_DIR
|
||||||
char tmp[64] = {'\0'};
|
//char tmp[64] = {'\0'};
|
||||||
snprintf(tmp, sizeof(tmp), "%s%s", SF_HD_DIR_CARDV, HdflieName);
|
//snprintf(tmp, sizeof(tmp), "%s%s", SF_HD_DIR_CARDV, HdflieName);
|
||||||
SLOGI("bitstream_va = %lx , size = %lx File:%s\n", bitstream_va, size, tmp);
|
SLOGI("bitstream_va = %lx , size = %lx File:%s\n", bitstream_va, size, HdflieName);
|
||||||
|
|
||||||
FST_FILE fp = FileSys_OpenFile(tmp, FST_OPEN_ALWAYS | FST_OPEN_WRITE);
|
FST_FILE fp = FileSys_OpenFile(HdflieName, FST_OPEN_ALWAYS | FST_OPEN_WRITE);
|
||||||
FileSys_WriteFile(fp, (UINT8*)bitstream_va, &size, 0, NULL);
|
FileSys_WriteFile(fp, (UINT8*)bitstream_va, &size, 0, NULL);
|
||||||
FileSys_CloseFile(fp);
|
FileSys_CloseFile(fp);
|
||||||
|
|
||||||
|
@ -2917,8 +2917,6 @@ void* sf_cardv_hd_cap_thread(void *arg)
|
||||||
UINT8 PowerOnMode = sf_cardv_convert_power_on_mode();
|
UINT8 PowerOnMode = sf_cardv_convert_power_on_mode();
|
||||||
MLOGD(" HD start PowerOnMode:%d\n", PowerOnMode);
|
MLOGD(" HD start PowerOnMode:%d\n", PowerOnMode);
|
||||||
|
|
||||||
char font = sf_get_strg_dev() == MMC_DEV_EMMC ? SF_EMMC_DCF_HANDLE : SF_SD_DCF_HANDLE;
|
|
||||||
char *font_str = sf_get_strg_dev() == MMC_DEV_EMMC ? "BX" : "EX";
|
|
||||||
if((PWR_ON_SMS == PowerOnMode) || (PWR_ON_TIME_SYNC == PowerOnMode))
|
if((PWR_ON_SMS == PowerOnMode) || (PWR_ON_TIME_SYNC == PowerOnMode))
|
||||||
{
|
{
|
||||||
//if(TRUE != sf_is_preview())
|
//if(TRUE != sf_is_preview())
|
||||||
|
@ -2926,8 +2924,6 @@ void* sf_cardv_hd_cap_thread(void *arg)
|
||||||
if(!hdFlagInit)
|
if(!hdFlagInit)
|
||||||
{
|
{
|
||||||
hdFlagInit = 1;
|
hdFlagInit = 1;
|
||||||
FileSys_MakeDir(PHOTO_THUMB_PATH);
|
|
||||||
FileSys_MakeDir(SF_HD_DIR_CARDV);
|
|
||||||
sf_hd_flag_init();
|
sf_hd_flag_init();
|
||||||
}
|
}
|
||||||
char *arg[2] = { 0 };
|
char *arg[2] = { 0 };
|
||||||
|
@ -2945,9 +2941,16 @@ void* sf_cardv_hd_cap_thread(void *arg)
|
||||||
//HdflieName
|
//HdflieName
|
||||||
memset(HdflieName, '\0', sizeof(HdflieName));
|
memset(HdflieName, '\0', sizeof(HdflieName));
|
||||||
sf_hd_flag_clear_done(0);
|
sf_hd_flag_clear_done(0);
|
||||||
snprintf(HdflieName, sizeof(HdflieName), "W%c%03d%04d.JPG", font, fileCfg->stfileattr[fileIndex].dirKey, fileCfg->stfileattr[fileIndex].fileKey);
|
if(fileCfg->stfileattr[fileIndex].storage == 1)
|
||||||
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);
|
snprintf(HdflieName, sizeof(HdflieName), "%s%c%03d%04d.JPG", SF_HD_DIR_CARDV, (SF_SD_DCF_HANDLE), 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, SF_SD_DCF_FILE_NAME, fileCfg->stfileattr[fileIndex].fileKey);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
snprintf(HdflieName, sizeof(HdflieName), "%s%c%03d%04d.JPG", SF_HD_DIR_EMMC , (SF_EMMC_DCF_HANDLE), fileCfg->stfileattr[fileIndex].dirKey, fileCfg->stfileattr[fileIndex].fileKey);
|
||||||
|
snprintf(str, 64, "B:\\DCIM\\%03d%s\\%s%04d.JPG", fileCfg->stfileattr[fileIndex].dirKey, DCF_DIR_NAME, SF_EMMC_DCF_FILE_NAME, fileCfg->stfileattr[fileIndex].fileKey);
|
||||||
|
}
|
||||||
|
printf("flie:%s HdflieName:%s\n", str, HdflieName);
|
||||||
arg[0] = str;
|
arg[0] = str;
|
||||||
sf_cmd_transcode_start(arg);
|
sf_cmd_transcode_start(arg);
|
||||||
if(sf_hd_flag_wait_done_timeout(HD_FLAG_INITT_OK, 5000))
|
if(sf_hd_flag_wait_done_timeout(HD_FLAG_INITT_OK, 5000))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user