|
|
@@ -18,7 +18,7 @@ static MV_CAM_TRIGGER_MODE setTriggerMode = MV_TRIGGER_MODE_ON; /// 默认: 打
|
|
|
#define AE_EXP_STABLE_FRAMES 4 // 相机处于自动曝光模式时, 累计曝光值稳定的帧数
|
|
|
|
|
|
// 保存照片
|
|
|
-static int SavePhoto(HANDLE hCam, MV_FRAME_OUT *pFrame, HKImgType imgType, const char *imgFile);
|
|
|
+static int SavePhoto(HANDLE hCam, MV_FRAME_OUT *pFrame, HKImgType imgType, const char *imgPath);
|
|
|
|
|
|
// 拍照回调
|
|
|
typedef struct
|
|
|
@@ -298,12 +298,12 @@ end_p:
|
|
|
}
|
|
|
|
|
|
// 保存照片
|
|
|
-static int SavePhoto(HANDLE hCam, MV_FRAME_OUT *pFrame, HKImgType imgType, const char *imgFile)
|
|
|
+static int SavePhoto(HANDLE hCam, MV_FRAME_OUT *pFrame, HKImgType imgType, const char *imgPath)
|
|
|
{
|
|
|
MV_SAVE_IMAGE_PARAM_EX3 saveParams = { 0 }; MVCC_INTVALUE_EX iv;
|
|
|
- char *filename1 = (char *)imgFile, *filename2 = NULL; int ret; char ext[5];
|
|
|
+ char *path1 = (char *)imgPath, *path2 = NULL; int ret; char ext[5];
|
|
|
|
|
|
- if(!hCam || !pFrame || !filename1 || strlen(filename1) <= 0) return -15;
|
|
|
+ if(!hCam || !pFrame || !path1 || strlen(path1) <= 0) return -15;
|
|
|
|
|
|
switch(imgType)
|
|
|
{
|
|
|
@@ -339,17 +339,17 @@ static int SavePhoto(HANDLE hCam, MV_FRAME_OUT *pFrame, HKImgType imgType, const
|
|
|
ret = MV_CC_SaveImageEx3(hCam, &saveParams);
|
|
|
if(MV_OK != ret) goto end_p;
|
|
|
|
|
|
- if(!xstrcasestr(filename1, "right", ext))
|
|
|
+ if(!xstrcasestr(path1, "right", ext))
|
|
|
{
|
|
|
- filename2 = (char *)sw_heap_malloc(strlen(filename1) +sizeof(ext));
|
|
|
- if(filename2) sprintf(filename2, "%s%s", filename1, ext);
|
|
|
+ path2 = (char *)sw_heap_malloc(strlen(path1) + sizeof(ext));
|
|
|
+ if(path2) sprintf(path2, "%s%s", path1, ext);
|
|
|
else { ret = -18; goto end_p; }
|
|
|
- ret = sw_file_update(filename2, "wb", (const char *)saveParams.pImageBuffer, saveParams.nImageLen);
|
|
|
- sw_heap_free(filename2);
|
|
|
+ ret = sw_file_update(path2, "wb", (const char *)saveParams.pImageBuffer, saveParams.nImageLen);
|
|
|
+ sw_heap_free(path2);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- ret = sw_file_update(filename1, "wb", (const char *)saveParams.pImageBuffer, saveParams.nImageLen);
|
|
|
+ ret = sw_file_update(path1, "wb", (const char *)saveParams.pImageBuffer, saveParams.nImageLen);
|
|
|
}
|
|
|
|
|
|
if(ret == saveParams.nImageLen) ret = MV_OK;
|