|
您好,按照您的提示,现在改成了如下:
if (BVCU_SEARCH_TYPE_FILE == pRequest->stSearchInfo.iType)
{
s32Ret = HI_PDT_FileMng_GetFileCount_By_DirType(&u32FileCount, DTCF_DIR_PHOTO);
if (s32Ret != HI_SUCCESS)
{
u32FileCount = 0;
MLOGE("HI_PDT_FileMng_GetGroupCount failed\n");
}
if (u32FileCount > pRequest->stSearchInfo.iCount)
{
u32FileCount = pRequest->stSearchInfo.iCount;
}
for (u32Idx = 0; u32Idx < u32FileCount; u32Idx ++)
{
memset(azFileName, 0x0, sizeof(azFileName));
s32Ret = HI_PDT_FileMng_GetFileByIndex(u32Idx, azFileName, sizeof(azFileName));
if (s32Ret != HI_SUCCESS)
{
MLOGW("HI_PDT_FileMng_GetFileByIndex failed\n");
}
stFileInfo[u32Idx].iRecordType = BVCU_STORAGE_RECORDTYPE_MANUAL;
stFileInfo[u32Idx].iFileType = BVCU_STORAGE_FILE_TYPE_CAPTURE;
stFileInfo[u32Idx].iFileSize = search_get_filesize(azFileName);
stFileInfo[u32Idx].iRecordID = u32Idx;
memset(azFilePerfixName, 0x0, sizeof(azFilePerfixName));
memset(azTmpFileName, 0x0, sizeof(azTmpFileName));
pCurFileName = strrchr(azFileName, '/');
if (HI_NULL != pCurFileName)
{
pCurFileName ++;
if (0 == strncmp(pCurFileName, "IMP_", 4))
{
memcpy(azTmpFileName, pCurFileName + 4, 17);
memcpy(azFilePerfixName, azFileName, strlen(azFileName) - 27);
}
else
{
memcpy(azTmpFileName, pCurFileName, 17);
memcpy(azFilePerfixName, azFileName, strlen(azFileName) - 23);
}
}
stat(azFileName, &stBuf);
stFileInfo[u32Idx].iTimeBegin = stBuf.st_mtime;
stFileInfo[u32Idx].iTimeRecord = 0;
sprintf(stFileInfo[u32Idx].szFilePath, "%s", azFileName);
extern BVCSP_HSession g_hSession;
enResult = BVCSP_GetSessionInfo(g_hSession, &stSessionInfo);
if (BVCU_Result_FAILED(enResult))
{
sprintf(stFileInfo[u32Idx].szSourceID, "PU_%s", BVCSP_CLIENT_ID);
MLOGW("BVCSP_GetSessionInfo fail! %d\n", enResult);
}
else
{
strcpy(stFileInfo[u32Idx].szSourceID, stSessionInfo.stParam.szClientID);
}
MLOGD("szFilePath[%d] : [%s]\n", u32Idx, stFileInfo[u32Idx].szFilePath);
}
MLOGD("u32FileCount = %d\n", u32FileCount);
stResponse.iCount = u32FileCount;
stResponse.pData.pFileInfo = stFileInfo;
stResponse.stSearchInfo.iCount = u32FileCount;
stResponse.stSearchInfo.iTotalCount = u32FileCount;
stResponse.stSearchInfo.iType = BVCU_SEARCH_TYPE_FILE;
stResponse.stSearchInfo.iPostition = 0;
pParam->stContent.pData = &stResponse;
pParam->stContent.iDataCount = 1;
pCommand->OnEvent(hSession, pCommand, pParam);
}
打印结果为:
(pu_search_list-173:3): szFilePath[0] : [/app/sd/180920/Photo/20180930_10133700.JPG]
(pu_search_list-173:3): szFilePath[1] : [/app/sd/180920/Photo/20180930_10133600.JPG]
(pu_search_list-173:3): szFilePath[2] : [/app/sd/180920/Photo/20180930_10133400.JPG]
(pu_search_list-176:3): u32FileCount = 3
但是SmartEye监视器在查询时出错:
长度不能小于 0。
参数名: length
在 System.String.Substring(Int32 startIndex, Int32 length)
在 SmartEyeMonitor.RecordCheckWorkingArea.refreshDataSheet(ArrayList records)
在 SmartEyeMonitor.RecordCheckWorkingArea.showRecords(IList records)
在 SmartEyeMonitor.RecordCheckWorkingArea.RecordCache.show(Int32 iPosition, Int32 iCount)
在 SmartEyeMonitor.RecordCheckWorkingArea.showSearchRecordFiles(RecordCheckControl recordCheck, String szTargetId, BVCU_SearchInfo searchInfo, BVCU_Search_FileFilter fileFilter, List`1 records, RecordType type)
在 SmartEyeMonitor.RecordCheckControl.onGetSearchResponse(String szTargetId, BVSearchResponse searchResponse, IntPtr pUserData)
在 SmartEyeMonitor.InterfaceAdapter.onGetSearchResponse(String szTargetId, BVSearchResponse searchResponse, IntPtr pUserData)
在 SmartEye.SndCmdEventHandler.procOnGetSearchResponse(BVSearchResponse searchResponse, IntPtr pUserData, String szTargetId)
|
|