1.合并Linux下回复修改

This commit is contained in:
payton 2024-01-02 13:54:36 +08:00
parent 47577a6f3e
commit 34c50b2cc0
5 changed files with 43 additions and 26 deletions

View File

@ -15,6 +15,7 @@
#include "UIApp/Network/UIAppWiFiCmd.h"
#include "GxStrg.h"
#include "GxVideoFile.h"
#include "DCF.h"
#define PB_FILE_FMT PBFMT_JPG | PBFMT_WAV | PBFMT_AVI | PBFMT_MOVMJPG | PBFMT_MP4 | PBFMT_TS
#define RTSP_PLAY_FUNC DISABLE
@ -233,7 +234,7 @@ BOOL PBDecVideoCB(UINT32 uiUserDataAddr, UINT32 uiUserDataSize)
*/
INT32 PlayExe_OnOpen(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray)
{
printf("[------------------------------------------------------------------------------------------------------------------]\n");
UINT32 useFileDB = 0;
UINT32 uiPoolAddr = (UINT32)mempool_filedb;
@ -260,7 +261,7 @@ INT32 PlayExe_OnOpen(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray)
if (useFileDB) {
CHAR *rootPath = "A:\\";
//CHAR* defaultfolder="A:\\CarDV\\";
printf("[---------useFileDB IN -]%d\n", useFileDB);
PPBX_FLIST_OBJ pFlist = PBXFList_FDB_getObject();
pFlist->Config(PBX_FLIST_CONFIG_MEM, uiPoolAddr, POOL_SIZE_FILEDB);
pFlist->Config(PBX_FLIST_CONFIG_MAX_FILENUM, 5000, 0);
@ -275,8 +276,13 @@ INT32 PlayExe_OnOpen(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray)
pFlist->Config(PBX_FLIST_CONFIG_SUPPORT_LONGNAME, 1, 0);
PB_SetParam(PBPRMID_FILELIST_OBJ, (UINT32)pFlist);
} else {
printf("[---------useFileDB not in -]%d\n", useFileDB);
PB_SetParam(PBPRMID_FILELIST_OBJ, (UINT32)PBXFList_DCF_getObject());
extern DCF_HANDLE System_Get_DCF_Handle(void);
PPBX_FLIST_OBJ pFlist = PBXFList_DCF_getObject();
DCF_HANDLE handle = System_Get_DCF_Handle();
pFlist->Config(PBX_FLIST_CONFIG_DCF_HANDLE, (UINT32)handle, 0);
PB_SetParam(PBPRMID_FILELIST_OBJ, (UINT32)pFlist);
}
PB_SetParam(PBPRMID_DEC_VIDEO_CALLBACK, (UINT32)PBDecVideoCB);
PB_SetParam(PBPRMID_ONDRAW_CALLBACK, (UINT32)PBView_OnDrawCB);

View File

@ -15,6 +15,7 @@
#define __DBGFLT__ "*" //*=All, [mark]=CustomClass
#include <kwrap/debug.h>
extern DCF_HANDLE System_Get_DCF_Handle(void);
void CloseAutoHideTimer(void)
{
@ -61,11 +62,13 @@ void ChkKeySoundComm(void)
static BOOL gbNoFile = TRUE;
static void xUIPlay_Filesys_DelCB(FIND_DATA *pFindData, BOOL *bDelete, UINT32 Param1, UINT32 Param2)
{
INT32 fileNum;
UINT32 fileType;
UINT32 filterType = (DCF_GetDBInfo(DCF_INFO_VALID_FILE_FMT) | DCF_GetDBInfo(DCF_INFO_DEP_FILE_FMT));
DCF_HANDLE dcf_handle = System_Get_DCF_Handle();
UINT32 filterType = (DCF_GetDBInfoEx(dcf_handle, DCF_INFO_VALID_FILE_FMT) | DCF_GetDBInfoEx(dcf_handle, DCF_INFO_DEP_FILE_FMT));
UINT8 attrib;
attrib = pFindData->attrib;
@ -85,7 +88,8 @@ static void xUIPlay_Filesys_LockCB(FIND_DATA *pFindData, BOOL *bApply, UINT32 Pa
{
INT32 fileNum;
UINT32 fileType;
UINT32 filterType = (DCF_GetDBInfo(DCF_INFO_VALID_FILE_FMT) | DCF_GetDBInfo(DCF_INFO_DEP_FILE_FMT));
DCF_HANDLE dcf_handle = System_Get_DCF_Handle();
UINT32 filterType = (DCF_GetDBInfoEx(dcf_handle, DCF_INFO_VALID_FILE_FMT) | DCF_GetDBInfoEx(dcf_handle, DCF_INFO_DEP_FILE_FMT));
DBG_IND("FileName = %s\r\n", pFindData->FATMainName);
@ -102,14 +106,15 @@ static void xUIPlay_FList_DCF_DelAll(void)
char path[DCF_FULL_FILE_PATH_LEN];
BOOL ret;
UINT32 i, uiMaxDirNum;
DCF_HANDLE dcf_handle = System_Get_DCF_Handle();
uiMaxDirNum = DCF_GetDBInfo(DCF_INFO_MAX_DIR_ID);
uiMaxDirNum = DCF_GetDBInfoEx(dcf_handle, DCF_INFO_MAX_DIR_ID);
for (i = 100; i <= uiMaxDirNum; i++) {
// check if folder has file
ret = DCF_GetDirInfo(i, &dirinfo);
ret = DCF_GetDirInfoEx(dcf_handle, i, &dirinfo);
if (ret /*&& dirinfo.uiNumOfDcfObj*/) {
// delete all in one folder
DCF_GetDirPath(i, path);
DCF_GetDirPathEx(dcf_handle, i, path);
gbNoFile = TRUE;
FileSys_DelDirFiles(path, xUIPlay_Filesys_DelCB);
// delete empty folder
@ -120,7 +125,7 @@ static void xUIPlay_FList_DCF_DelAll(void)
}
}
}
DCF_Refresh();
DCF_RefreshEx(dcf_handle);
}
static ER xUIPlay_FList_FDB_ProtectFile(UINT32 cmdID)
{
@ -191,13 +196,14 @@ static void xUIPlay_FList_DCF_LockAll(BOOL bLock)
SDCFDIRINFO dirinfo = {0};
char path[DCF_FULL_FILE_PATH_LEN] = {0};
UINT32 i, uiMaxDirNum;
DCF_HANDLE dcf_handle = System_Get_DCF_Handle();
uiMaxDirNum = DCF_GetDBInfo(DCF_INFO_MAX_DIR_ID);
uiMaxDirNum = DCF_GetDBInfoEx(dcf_handle, DCF_INFO_MAX_DIR_ID);
for (i = 100; i <= uiMaxDirNum; i++) {
// check if folder has file
if (DCF_GetDirInfo(i, &dirinfo)) {
if (DCF_GetDirInfoEx(dcf_handle, i, &dirinfo)) {
if (dirinfo.uiNumOfDcfObj) {
DCF_GetDirPath(i, path);
DCF_GetDirPathEx(dcf_handle, i, path);
FileSys_LockDirFiles(path, bLock, xUIPlay_Filesys_LockCB);
}
}
@ -209,6 +215,7 @@ static ER xUIPlay_FList_DCF_ProtectFile(UINT32 cmdID)
char filePath[DCF_FULL_FILE_PATH_LEN];
UINT32 index, i, uiThisFileFormat, tmpFileType;
BOOL bLock;
DCF_HANDLE dcf_handle = System_Get_DCF_Handle();
DBG_IND("cmdID=%d\r\n", cmdID);
if ((cmdID == PLAY_PROTECT_ONE) || (cmdID == PLAY_UNPROTECT_ONE)) {
@ -217,13 +224,13 @@ static ER xUIPlay_FList_DCF_ProtectFile(UINT32 cmdID)
} else {
bLock = FALSE; // unlock
}
index = DCF_GetCurIndex();
uiThisFileFormat = DCF_GetDBInfo(DCF_INFO_CUR_FILE_TYPE);
index = DCF_GetDBInfoEx(dcf_handle, DCF_INFO_CUR_INDEX);
uiThisFileFormat = DCF_GetDBInfoEx(dcf_handle, DCF_INFO_CUR_FILE_TYPE);
for (i = 0; i <= DCF_FILE_TYPE_NUM; i++) {
tmpFileType = 1;
tmpFileType <<= i;
if (uiThisFileFormat & tmpFileType) {
DCF_GetObjPath(index, tmpFileType, filePath);
DCF_GetObjPathEx(dcf_handle, index, tmpFileType, filePath);
FileSys_SetAttrib(filePath, FST_ATTRIB_READONLY, bLock);
}
}
@ -361,6 +368,9 @@ static ER xUIPlay_FList_FDB_DelFile(UINT32 cmdID)
static ER xUIPlay_FList_DCF_DelFile(UINT32 cmdID)
{
DBG_IND("cmdID=%d\r\n", cmdID);
DCF_HANDLE dcf_handle = System_Get_DCF_Handle();
if (cmdID == PB_DELETE_ONE) {
//#NT#2016/05/24#Ben Wang -begin
//#NT#Fix the coverity issue.
@ -368,14 +378,14 @@ static ER xUIPlay_FList_DCF_DelFile(UINT32 cmdID)
//#NT#2016/05/24#Ben Wang -end
CHAR filePath[DCF_FULL_FILE_PATH_LEN] = {0};
index = DCF_GetCurIndex();
uiThisFileFormat = DCF_GetDBInfo(DCF_INFO_CUR_FILE_TYPE);
index = DCF_GetDBInfoEx(dcf_handle, DCF_INFO_CUR_INDEX);
uiThisFileFormat = DCF_GetDBInfoEx(dcf_handle, DCF_INFO_CUR_FILE_TYPE);
for (i = 0; i <= DCF_FILE_TYPE_NUM; i++) {
tmpFileType = 0x0001 << i;
if (uiThisFileFormat & tmpFileType) {
if (DCF_GetObjPath(index, uiThisFileFormat, filePath)) {
if (DCF_GetObjPathEx(dcf_handle, index, uiThisFileFormat, filePath)) {
if (FST_STA_OK == FileSys_DeleteFile(filePath)) {
DCF_DelDBfile(filePath);
DCF_DelDBfileEx(dcf_handle, filePath);
}
}
}
@ -387,9 +397,9 @@ static ER xUIPlay_FList_DCF_DelFile(UINT32 cmdID)
UINT32 DirID = 0, FileID = 0, Index = 0, uiThisFileFormat = 0;
BOOL isCurrFileReadOnly = FALSE;
Index = DCF_GetDBInfo(DCF_INFO_CUR_INDEX);
DCF_GetObjInfo(Index, &DirID, &FileID, &uiThisFileFormat);
DCF_GetObjPath(Index, uiThisFileFormat, filePath);
Index = DCF_GetDBInfoEx(dcf_handle, DCF_INFO_CUR_INDEX);
DCF_GetObjInfoEx(dcf_handle, Index, &DirID, &FileID, &uiThisFileFormat);
DCF_GetObjPathEx(dcf_handle, Index, uiThisFileFormat, filePath);
ret = FileSys_GetAttrib(filePath, &attrib);
if ((ret == E_OK) && M_IsReadOnly(attrib) == TRUE) {
@ -399,10 +409,10 @@ static ER xUIPlay_FList_DCF_DelFile(UINT32 cmdID)
// --------- delete all files -----------------------
xUIPlay_FList_DCF_DelAll();
if (isCurrFileReadOnly) {
Index = DCF_GetIndexByID(DirID, FileID);
DCF_SetCurIndex(Index);
Index = DCF_GetIndexByIDEx(dcf_handle, DirID, FileID);
DCF_SetCurIndexEx(dcf_handle, Index);
}
DCF_Refresh();
DCF_RefreshEx(dcf_handle);
}
return E_OK;
}

View File

@ -78,6 +78,7 @@ typedef enum _PBX_FLIST_CONFIG_ID {
PBX_FLIST_CONFIG_SORT_BYSN_DELIMSTR = 0x10, ///< only for FileDB, set the delimiter string, e.g. underline "_", "AA"
PBX_FLIST_CONFIG_SORT_BYSN_DELIMNUM = 0x11, ///< only for FileDB, set the delimiter count to find the serial number
PBX_FLIST_CONFIG_SORT_BYSN_NUMOFSN = 0x12, ///< only for FileDB, set the character number of the serial number
PBX_FLIST_CONFIG_DCF_HANDLE = 0x13, ///< only for DCF , multi storage DCF handle
ENUM_DUMMY4WORD(PBX_FLIST_CONFIG_ID)
} PBX_FLIST_CONFIG_ID;