|
@@ -32,6 +32,11 @@ using namespace Recorder;
|
|
|
#define RVC_TRANSATCION_RECORD_SUFFIX "B_"
|
|
|
#endif // !RVC_TRANSATCION_RECORD_SUFFIX
|
|
|
|
|
|
+#ifndef RVC_ENCRYPT_TRANSATCION_RECORD_SUFFIX
|
|
|
+#define RVC_ENCRYPT_TRANSATCION_RECORD_SUFFIX "enc_B_"
|
|
|
+#endif // !RVC_ENCRYPT_TRANSATCION_RECORD_SUFFIX
|
|
|
+
|
|
|
+
|
|
|
static unsigned long GetFileSize(const char* pfilename)
|
|
|
{
|
|
|
#ifdef RVC_OS_WIN
|
|
@@ -373,8 +378,6 @@ ErrorCodeEnum CRecorderEntity::LoadEntityConfig()
|
|
|
m_strHttpServerAddr = strHttpServerAddr;
|
|
|
}
|
|
|
|
|
|
- m_eRecordType = eMP4;
|
|
|
-
|
|
|
if (iTimeOut > 0 && iTimeOut < 20 * RVC_HTTPTIMEOUT) {
|
|
|
m_iHttpTimeOut = iTimeOut;
|
|
|
}
|
|
@@ -642,7 +645,7 @@ void CRecorderEntity::StartRecord(const char *videofilename)
|
|
|
tAudioParams.bIsTransOn = false;
|
|
|
tAudioParams.iAudioChannels = 1;
|
|
|
|
|
|
- if (m_pRecorder->StartVideoRecord(fps, 75, m_eRecordType, &tAudioParams, NULL, false, true, m_TempDir.GetData(), m_RecordSaveDir.GetLength(), videofilename, strlen(videofilename)))
|
|
|
+ if (m_pRecorder->StartVideoRecord(fps, 75, eMP4, &tAudioParams, NULL, false, true, m_TempDir.GetData(), m_RecordSaveDir.GetLength(), videofilename, strlen(videofilename)))
|
|
|
{
|
|
|
m_bStarted = true;
|
|
|
m_eBusinessStatus = eSuccess;
|
|
@@ -789,7 +792,7 @@ int CRecorderEntity::HandleEncryptVideoRecord(const char* videofilename)
|
|
|
return iRet;
|
|
|
}
|
|
|
else{
|
|
|
- if (!rvcMoveFile(strOutFile, videofilename)){
|
|
|
+ if (rvcMoveFile(strOutFile, videofilename)){
|
|
|
DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("rename %s to %s Success!",strOutFile, videofilename);
|
|
|
iRet = 0;
|
|
|
}
|
|
@@ -802,7 +805,7 @@ int CRecorderEntity::HandleEncryptVideoRecord(const char* videofilename)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-#ifdef DEVOPS_ON_ST /*DevOps流水线编译,ST环境*/
|
|
|
+#if 0
|
|
|
char strdecFile[MAX_PATH] = { 0 };
|
|
|
DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("begin decrypt file %s.", videofilename);
|
|
|
iresult = decryption_file(strdecFile, MAX_PATH, videofilename, &cb, eVerB);
|
|
@@ -923,14 +926,9 @@ int CRecorderEntity::SaveExceptionRecordVideos()
|
|
|
HANDLE hFind;
|
|
|
bool fFinished = false;
|
|
|
char strVideoFormat[MAX_PATH] = { 0 };
|
|
|
- if (eMP4 == m_eRecordType) {
|
|
|
- _snprintf(strVideoFormat, MAX_PATH, "%s", RECORD_MP4_SUFFIX);
|
|
|
- }
|
|
|
- else {
|
|
|
- _snprintf(strVideoFormat, MAX_PATH, "%s", RECORD_WMV_SUFFIX);
|
|
|
- }
|
|
|
+ snprintf(strVideoFormat, MAX_PATH, "%s", RECORD_MP4_SUFFIX);
|
|
|
|
|
|
- _snprintf(srcFilePath, MAX_PATH, "%s*.%s", m_TempDir.GetData(), strVideoFormat);
|
|
|
+ snprintf(srcFilePath, MAX_PATH, "%s*.%s", m_TempDir.GetData(), strVideoFormat);
|
|
|
|
|
|
hFind = FindFirstFile(srcFilePath, &FindFileData);
|
|
|
|
|
@@ -941,7 +939,8 @@ int CRecorderEntity::SaveExceptionRecordVideos()
|
|
|
goto on_next;
|
|
|
}
|
|
|
|
|
|
- if (NULL == strstr(FindFileData.cFileName, "S_")){
|
|
|
+ if (0 == memcmp(FindFileData.cFileName, RVC_TRANSATCION_RECORD_SUFFIX, strlen(RVC_TRANSATCION_RECORD_SUFFIX)) ||
|
|
|
+ 0 == memcmp(FindFileData.cFileName, RVC_ENCRYPT_TRANSATCION_RECORD_SUFFIX, strlen(RVC_ENCRYPT_TRANSATCION_RECORD_SUFFIX))){
|
|
|
CSimpleStringA srcfile = CSimpleStringA::Format("%s%s",m_TempDir.GetData(), FindFileData.cFileName);
|
|
|
if (m_bEncFlag){
|
|
|
filecryption_callback_t cb = {0};
|
|
@@ -968,7 +967,7 @@ int CRecorderEntity::SaveExceptionRecordVideos()
|
|
|
}
|
|
|
|
|
|
CSimpleStringA dstfile = CSimpleStringA::Format("%s%s",m_RecordSaveDir.GetData(), FindFileData.cFileName);
|
|
|
- BOOL bRet = MoveFile(srcfile.GetData(), dstfile.GetData());
|
|
|
+ bool bRet = rvcMoveFile(srcfile.GetData(), dstfile.GetData());
|
|
|
if(!bRet) {
|
|
|
LogWarn(Severity_Low, Error_Debug, LOG_EVT_RECORDER_MOVE_FAILED, CSimpleStringA::Format("Error Code %u while move %s -> %s", GetLastError(), srcfile.GetData(), dstfile.GetData()).GetData());
|
|
|
}
|
|
@@ -990,6 +989,8 @@ on_next:
|
|
|
}
|
|
|
FindClose(hFind);
|
|
|
}
|
|
|
+#else
|
|
|
+
|
|
|
#endif // RVC_OS_WIN
|
|
|
|
|
|
return iRet;
|